diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-11-06 15:21:39 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-11-15 13:16:34 -0500 |
| commit | f18bcfbb4ff2bedae2f4565b823f822a31b1344c (patch) | |
| tree | e75190faa07ea05416d2b78c95768cb19ec9fce4 /src | |
| parent | 47e5b3f78e42c2683c5a61d663cdd17ef1850a62 (diff) | |
don't fumble collision settings and mass in the editor
Diffstat (limited to 'src')
| -rw-r--r-- | src/game.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp index 6d80198..cd27812 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -315,6 +315,8 @@ void ParseInstance(std::ifstream &stream) { auto entityHandle = ECS_CreateEntity(); auto &compInst = ECS_CreateInstance(entityHandle, et.entityHandle); + compInst.physicsLayer = comp.physicsLayer; + compInst.physicsMask = comp.physicsMask; btVector3 localInertia(0, 0, 0); et.bt.shape->calculateLocalInertia(instPos.mass, localInertia); compInst.bt.motionState = Pke_New<btDefaultMotionState>(MemBkt_Bullet); @@ -532,6 +534,8 @@ void Game_Tick(double delta) { EntityHandle newEntity = ECS_CreateEntity(); auto &compInst = ECS_CreateInstance(newEntity, createInfo.entityTypeEntityHandle); + compInst.physicsLayer = et.bt.startingCollisionLayer; + compInst.physicsMask = et.bt.startingCollisionMask; btVector3 localInertia(0, 0, 0); et.bt.shape->calculateLocalInertia(et.bt.startingMass, localInertia); btTransform posRot{}; @@ -943,6 +947,7 @@ void RecordImGui_CompInstPos(bool readonly, CompInstance *component) { InstPos instPos; component->bt.motionState->getWorldTransform(instPos.posRot); instPos.scale = component->bt.rigidBody->getCollisionShape()->getLocalScaling(); + instPos.mass = component->bt.rigidBody->getMass(); btVector3 pos = instPos.posRot.getOrigin(); btQuaternion rot = instPos.posRot.getRotation(); |
