Skip to content

Commit

Permalink
fix cylinder issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ughuuu committed Sep 15, 2024
1 parent b387591 commit 48a36c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish = false
crate-type = ["cdylib"]

[features]
default = ["build2d", "test"]
default = ["build3d", "test"]
test = []
build2d = ["single-dim2", "serde-serialize", "parallel", "simd-stable"]
build3d = ["single-dim3", "serde-serialize", "parallel", "simd-stable"]
Expand Down
5 changes: 1 addition & 4 deletions src/shapes/rapier_cylinder_shape_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl IRapierShape for RapierCylinderShape3D {
}

fn create_rapier_shape(&mut self, physics_engine: &mut PhysicsEngine) -> ShapeHandle {
physics_engine.shape_create_cylinder((self.height / 2.0) - self.radius, self.radius)
physics_engine.shape_create_cylinder(self.height / 2.0, self.radius)
}

fn set_data(&mut self, data: Variant, physics_engine: &mut PhysicsEngine) {
Expand Down Expand Up @@ -84,9 +84,6 @@ impl IRapierShape for RapierCylinderShape3D {
return;
}
}
if self.radius >= self.height * 0.5 {
self.radius = self.height * 0.5;
}
let handle = self.create_rapier_shape(physics_engine);
self.base.set_handle_and_reset_aabb(handle, physics_engine);
}
Expand Down

0 comments on commit 48a36c3

Please sign in to comment.