summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp5
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();