Skip to content

Commit

Permalink
fix shape not updating (#91)
Browse files Browse the repository at this point in the history
- Fixes #90
  • Loading branch information
Ughuuu authored May 2, 2024
1 parent 5e38118 commit bfab8cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/bodies/rapier_collision_object_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ void RapierCollisionObject2D::_destroy_shape(Shape &shape, uint32_t p_shape_inde
}

rapier2d::collider_destroy(space_handle, shape.collider_handle);
shape.collider_handle = rapier2d::invalid_handle(); // collider_handle = rapier ID
shape.shape->destroy_rapier_shape();
shape.collider_handle = rapier2d::invalid_handle();
}

void RapierCollisionObject2D::_update_shape_transform(const Shape &shape) {
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/rapier_shape_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class RapierShape2D {
void configure(const Rect2 &p_aabb);

virtual rapier2d::Handle create_rapier_shape() const = 0;
void destroy_rapier_shape();

public:
void destroy_rapier_shape();
_FORCE_INLINE_ void set_rid(const RID &p_rid) { rid = p_rid; }
_FORCE_INLINE_ RID get_rid() const { return rid; }

Expand Down

0 comments on commit bfab8cd

Please sign in to comment.