Skip to content

Copy only dynamic data #258

Open
Open
@majklost

Description

@majklost

I am using pymunk for my bachelor thesis, where I plan using RRT algorithm. Problem is, that I store many copies of space in a tree. I benchmarked my solution and found out that making a copy of space is the most expensive operation in whole process (70 % of time). Since all the simulations contain same bodies, constraints, shapes and collision handlers, I would just need to extract and apply only data that changes when stepping the simulation.

I tried to copy all physical aspects of bodies to bodies in second simulator (pos, velocity, angle,...), But simulation result still differs....
I looked how space.copy() is implemented, but it creates new space, so many things differs from my usecase.

Can you give a hint what all should I export and import from one simulation to another to achieve same behaviour when stepping both of them?
(I can then contribute this feature to pymunk if it works)
Thanks,
Michal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions