summaryrefslogtreecommitdiff
path: root/servers/physics_2d/collision_object_2d_sw.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-10-16 00:06:34 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-10-16 00:06:34 -0300
commit371eac9beffdfe416b8555ee006baf0ffae2bef3 (patch)
treebfb0f6dc2a0a4812d69a8aa9902ad0c42021a522 /servers/physics_2d/collision_object_2d_sw.h
parent6e87c80e41857fe4f151cdeb8b9a7206c226bd8f (diff)
-added custom metadata to physics shapes (2D only for now)
-gizmos are not displayed in camera preview
Diffstat (limited to 'servers/physics_2d/collision_object_2d_sw.h')
-rw-r--r--servers/physics_2d/collision_object_2d_sw.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/servers/physics_2d/collision_object_2d_sw.h b/servers/physics_2d/collision_object_2d_sw.h
index 1d61a1df4a..00ad361245 100644
--- a/servers/physics_2d/collision_object_2d_sw.h
+++ b/servers/physics_2d/collision_object_2d_sw.h
@@ -55,6 +55,7 @@ private:
BroadPhase2DSW::ID bpid;
Rect2 aabb_cache; //for rayqueries
Shape2DSW *shape;
+ Variant metadata;
bool trigger;
Shape() { trigger=false; }
};
@@ -97,11 +98,15 @@ public:
void add_shape(Shape2DSW *p_shape,const Matrix32& p_transform=Matrix32());
void set_shape(int p_index,Shape2DSW *p_shape);
void set_shape_transform(int p_index,const Matrix32& p_transform);
+ void set_shape_metadata(int p_index,const Variant& p_metadata);
+
+
_FORCE_INLINE_ int get_shape_count() const { return shapes.size(); }
_FORCE_INLINE_ Shape2DSW *get_shape(int p_index) const { return shapes[p_index].shape; }
_FORCE_INLINE_ const Matrix32& get_shape_transform(int p_index) const { return shapes[p_index].xform; }
_FORCE_INLINE_ const Matrix32& get_shape_inv_transform(int p_index) const { return shapes[p_index].xform_inv; }
_FORCE_INLINE_ const Rect2& get_shape_aabb(int p_index) const { return shapes[p_index].aabb_cache; }
+ _FORCE_INLINE_ const Variant& get_shape_metadata(int p_index) const { return shapes[p_index].metadata; }
_FORCE_INLINE_ Matrix32 get_transform() const { return transform; }
_FORCE_INLINE_ Matrix32 get_inv_transform() const { return inv_transform; }