Is it safe to retrieve objects transforms from one thread while stepSimulation is in other thread?
Posted: Mon Jan 09, 2023 6:53 am
I do physical simulation and rendering in my program.
People recommend using fixed step simulation independently of rendering thread and framerate.
So I decided to call stepSimulation in, let's say, thread 0 and rendering in thread 1.
To render btRigidBody objects I need their transforms. As far as I know body->getWorldTransform() is the best way of doing it.
So, the question is following:
Is it safe to call getWorldTransform() while simulation is ongoing in other thread?
I heard that modifying state of rigid bodies is not thread safe, but I haven't seen anything about reading their states.
Sorry for my bad English
People recommend using fixed step simulation independently of rendering thread and framerate.
So I decided to call stepSimulation in, let's say, thread 0 and rendering in thread 1.
To render btRigidBody objects I need their transforms. As far as I know body->getWorldTransform() is the best way of doing it.
So, the question is following:
Is it safe to call getWorldTransform() while simulation is ongoing in other thread?
I heard that modifying state of rigid bodies is not thread safe, but I haven't seen anything about reading their states.
Sorry for my bad English