summaryrefslogtreecommitdiff
path: root/src/components.hpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2023-10-31 12:46:09 -0400
committerJonathan Bradley <jcb@pikum.xyz>2023-11-15 13:13:25 -0500
commitf2c808b1235b9d76e4d4753c025f404e7736ca3c (patch)
tree34100f4a05d6feb40474c50f1d3539611b0016ba /src/components.hpp
parent18e65823663af6e2a1472b66486526a23d5e9c30 (diff)
use model for collision + refactor physics init and rigidbody creation
Diffstat (limited to 'src/components.hpp')
-rw-r--r--src/components.hpp15
1 files changed, 6 insertions, 9 deletions
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 <BulletCollision/CollisionShapes/btCollisionShape.h>
-#include <LinearMath/btDefaultMotionState.h>
#include <BulletDynamics/Dynamics/btRigidBody.h>
+#include <LinearMath/btDefaultMotionState.h>
#include <vulkan/vulkan_core.h>
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;
};