diff options
author | yakun.zhang <Raphael10241024@gmail.com> | 2019-06-21 19:33:01 +0800 |
---|---|---|
committer | yakun.zhang <Raphael10241024@gmail.com> | 2019-06-21 19:33:01 +0800 |
commit | 434fd71d2a4b69f576362c3a9baa5b39db009d31 (patch) | |
tree | ee6b28619ac16adcf899aa0d631926b8507f4dad /servers/physics/collision_object_sw.h | |
parent | 1e833cadbcf1403eec85fa85b290328bc1bf5179 (diff) |
add 2d physic optimization simlilar to 3d physics
Diffstat (limited to 'servers/physics/collision_object_sw.h')
-rw-r--r-- | servers/physics/collision_object_sw.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h index c2c3fe0e5a..895eda8528 100644 --- a/servers/physics/collision_object_sw.h +++ b/servers/physics/collision_object_sw.h @@ -139,8 +139,11 @@ public: _FORCE_INLINE_ void set_ray_pickable(bool p_enable) { ray_pickable = p_enable; } _FORCE_INLINE_ bool is_ray_pickable() const { return ray_pickable; } - _FORCE_INLINE_ void set_shape_as_disabled(int p_idx, bool p_enable) { shapes.write[p_idx].disabled = p_enable; } - _FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const { return shapes[p_idx].disabled; } + void set_shape_as_disabled(int p_idx, bool p_enable); + _FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const { + CRASH_BAD_INDEX(p_idx, shapes.size()); + return shapes[p_idx].disabled; + } _FORCE_INLINE_ void set_collision_layer(uint32_t p_layer) { collision_layer = p_layer; } _FORCE_INLINE_ uint32_t get_collision_layer() const { return collision_layer; } |