MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / Tick

Method Tick

src/PhysicsLinkSystem.cpp:12–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace RavEngine;
11
12void 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
25void PhysicsLinkSystemWrite::Tick(float fpsScale, Ref<Entity> e) const{
26 //physx requires reads and writes to be sequential

Callers

nothing calls this directly

Calls 13

lockReadMethod · 0.80
getRotMethod · 0.80
unlockReadMethod · 0.80
SetWorldPositionMethod · 0.80
SetWorldRotationMethod · 0.80
GetWorldPositionMethod · 0.80
GetWorldRotationMethod · 0.80
lockWriteMethod · 0.80
unlockWriteMethod · 0.80
getPosMethod · 0.45
transformMethod · 0.45
setPosMethod · 0.45

Tested by

no test coverage detected