From f2c808b1235b9d76e4d4753c025f404e7736ca3c Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 31 Oct 2023 12:46:09 -0400 Subject: use model for collision + refactor physics init and rigidbody creation --- src/components.hpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/components.hpp') diff --git a/src/components.hpp b/src/components.hpp index 0903492..a8b4e88 100644 --- a/src/components.hpp +++ b/src/components.hpp @@ -4,9 +4,8 @@ #include "macros.hpp" #include "dynamic-array.hpp" -#include -#include #include +#include #include const uint64_t ECS_UNSET_VAL = 0xFFFFFFFFFFFFFFFF; @@ -57,18 +56,16 @@ struct InstPos { btTransform posRot; btVector3 scale; }; - +struct InstBt { + btDefaultMotionState *motionState; + btRigidBody *rigidBody; +}; struct CompInstance { EntityHandle entHandle = EntityHandle_MAX; GrBindsHandle grBindsHandle = GrBindsHandle_MAX; InstanceHandle instanceHandle = InstanceHandle_MAX; uint64_t index = ECS_UNSET_VAL; - struct { - btVector3 localInertia; - btCollisionShape *collisionShape; - btDefaultMotionState defaultMotionState; - btRigidBody *rigidBody; - } bt; + InstBt bt; bool isNeedingUpdated = false; }; -- cgit v1.2.3