| 10 | using namespace RavEngine; |
| 11 | |
| 12 | void PhysicsLinkSystemRead::Tick(float fpsScale, Ref<Entity> e) const{ |
| 13 | //physx requires reads and writes to be sequential |
| 14 | |
| 15 | //if there is a crash here: dynamicsWorld was not set on this class in the World when it was created |
| 16 | auto rigid = e->Components().GetComponentOfSubclass<PhysicsBodyComponent>(); |
| 17 | dynamicsWorld->lockRead(); |
| 18 | auto pos = rigid->getPos(); |
| 19 | auto rot = rigid->getRot(); |
| 20 | dynamicsWorld->unlockRead(); |
| 21 | e->transform()->SetWorldPosition(pos); |
| 22 | e->transform()->SetWorldRotation(rot); |
| 23 | } |
| 24 | |
| 25 | void PhysicsLinkSystemWrite::Tick(float fpsScale, Ref<Entity> e) const{ |
| 26 | //physx requires reads and writes to be sequential |
nothing calls this directly
no test coverage detected