summaryrefslogtreecommitdiff
path: root/src/3d/object.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3d/object.h')
-rw-r--r--src/3d/object.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/3d/object.h b/src/3d/object.h
index dcd96e3..a8eb98c 100644
--- a/src/3d/object.h
+++ b/src/3d/object.h
@@ -6,6 +6,7 @@
#include "util/asset_manager_dcl.h"
#include "util/mini_math.h"
+#include <memory> // For std::shared_ptr
enum class ObjectType {
CUBE,
@@ -42,12 +43,14 @@ class Object3D {
AssetId mesh_asset_id;
vec3 local_extent; // Half-extents for AABB (used by meshes for shadows)
void* user_data; // For tool-specific data, not for general use
+ std::shared_ptr<void>
+ shared_user_data; // For tool-specific data managed with shared ownership
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), velocity(0, 0, 0), mass(1.0f), restitution(0.5f),
is_static(false), mesh_asset_id((AssetId)0), local_extent(1, 1, 1),
- user_data(nullptr) {
+ user_data(nullptr), shared_user_data(nullptr) {
}
mat4 get_model_matrix() const {