aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-08-09 09:58:39 +0200
committerSébastien Crozet <developer@crozet.re>2022-08-09 10:06:20 +0200
commit68d250f0ad80bb2e5e10e43f2fd1b8824e2a1216 (patch)
tree7acbf4b88f03fcf39d2f00ded3d3a07e89769d16 /src/dynamics
parent1dddb7de9fa5a46baeaa47e3e62bde99ae385cb5 (diff)
parenta19c6131ff63860aa87f320e3e3770ef4e6f4774 (diff)
downloadrapier-68d250f0ad80bb2e5e10e43f2fd1b8824e2a1216.tar.gz
rapier-68d250f0ad80bb2e5e10e43f2fd1b8824e2a1216.tar.bz2
rapier-68d250f0ad80bb2e5e10e43f2fd1b8824e2a1216.zip
Merge pull request #380 from dimforge/set-rotation
Make Collider::set_rotation and RigidBody::set_rotation take a rotation instead of an axis-angle.
Diffstat (limited to 'src/dynamics')
-rw-r--r--src/dynamics/rigid_body.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/dynamics/rigid_body.rs b/src/dynamics/rigid_body.rs
index 9fa05a6..ee64f93 100644
--- a/src/dynamics/rigid_body.rs
+++ b/src/dynamics/rigid_body.rs
@@ -681,9 +681,7 @@ impl RigidBody {
/// Sets the rotational part of this rigid-body's position.
#[inline]
- pub fn set_rotation(&mut self, rotation: AngVector<Real>, wake_up: bool) {
- let rotation = Rotation::new(rotation);
-
+ pub fn set_rotation(&mut self, rotation: Rotation<Real>, wake_up: bool) {
if self.pos.position.rotation != rotation || self.pos.next_position.rotation != rotation {
self.changes.insert(RigidBodyChanges::POSITION);
self.pos.position.rotation = rotation;
@@ -719,9 +717,9 @@ impl RigidBody {
}
/// If this rigid body is kinematic, sets its future translation after the next timestep integration.
- pub fn set_next_kinematic_rotation(&mut self, rotation: AngVector<Real>) {
+ pub fn set_next_kinematic_rotation(&mut self, rotation: Rotation<Real>) {
if self.is_kinematic() {
- self.pos.next_position.rotation = Rotation::new(rotation);
+ self.pos.next_position.rotation = rotation;
}
}