diff options
Diffstat (limited to 'src/3d/object.h')
| -rw-r--r-- | src/3d/object.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/3d/object.h b/src/3d/object.h index 2099a5c..6d21393 100644 --- a/src/3d/object.h +++ b/src/3d/object.h @@ -31,9 +31,16 @@ class Object3D { // Material parameters could go here (color, roughness, etc.) vec4 color; + // Physics fields + vec3 velocity; + float mass; + float restitution; + bool is_static; + Object3D(ObjectType t = ObjectType::CUBE) : position(0, 0, 0), rotation(0, 0, 0, 1), scale(1, 1, 1), type(t), - color(1, 1, 1, 1) { + color(1, 1, 1, 1), velocity(0, 0, 0), mass(1.0f), restitution(0.5f), + is_static(false) { } mat4 get_model_matrix() const { @@ -47,6 +54,8 @@ class Object3D { // Returns the local-space AABB of the primitive (before transform) // Used to generate the proxy geometry for rasterization. BoundingVolume get_local_bounds() const { + if (type == ObjectType::TORUS) + return {{-1.5f, -0.5f, -1.5f}, {1.5f, 0.5f, 1.5f}}; // Simple defaults for unit primitives return {{-1, -1, -1}, {1, 1, 1}}; } |
