aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/joint/revolute_joint.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2021-01-29 14:42:32 +0100
committerGitHub <noreply@github.com>2021-01-29 14:42:32 +0100
commit7ca46f38cde6cf8bf8bf41ea6067ae5bc938205c (patch)
tree3781b9d7c92a6a8111573ba4cae1c5d41435950e /src/dynamics/joint/revolute_joint.rs
parente6fc8f67faf3e37afe38d683cbd930d457f289be (diff)
parent825f33efaec4ce6a8903751e836a0ea9c466ff92 (diff)
downloadrapier-7ca46f38cde6cf8bf8bf41ea6067ae5bc938205c.tar.gz
rapier-7ca46f38cde6cf8bf8bf41ea6067ae5bc938205c.tar.bz2
rapier-7ca46f38cde6cf8bf8bf41ea6067ae5bc938205c.zip
Merge pull request #79 from dimforge/split_geom
Move most of the geometric code to another crate.
Diffstat (limited to 'src/dynamics/joint/revolute_joint.rs')
-rw-r--r--src/dynamics/joint/revolute_joint.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/dynamics/joint/revolute_joint.rs b/src/dynamics/joint/revolute_joint.rs
index cdb424b..ad7db0d 100644
--- a/src/dynamics/joint/revolute_joint.rs
+++ b/src/dynamics/joint/revolute_joint.rs
@@ -1,4 +1,4 @@
-use crate::math::{Point, Vector};
+use crate::math::{Point, Real, Vector};
use crate::utils::WBasis;
use na::{Unit, Vector5};
@@ -7,31 +7,31 @@ use na::{Unit, Vector5};
/// A joint that removes all relative motion between two bodies, except for the rotations along one axis.
pub struct RevoluteJoint {
/// Where the revolute joint is attached on the first body, expressed in the local space of the first attached body.
- pub local_anchor1: Point<f32>,
+ pub local_anchor1: Point<Real>,
/// Where the revolute joint is attached on the second body, expressed in the local space of the second attached body.
- pub local_anchor2: Point<f32>,
+ pub local_anchor2: Point<Real>,
/// The rotation axis of this revolute joint expressed in the local space of the first attached body.
- pub local_axis1: Unit<Vector<f32>>,
+ pub local_axis1: Unit<Vector<Real>>,
/// The rotation axis of this revolute joint expressed in the local space of the second attached body.
- pub local_axis2: Unit<Vector<f32>>,
+ pub local_axis2: Unit<Vector<Real>>,
/// The basis orthonormal to `local_axis1`, expressed in the local space of the first attached body.
- pub basis1: [Vector<f32>; 2],
+ pub basis1: [Vector<Real>; 2],
/// The basis orthonormal to `local_axis2`, expressed in the local space of the second attached body.
- pub basis2: [Vector<f32>; 2],
+ pub basis2: [Vector<Real>; 2],
/// The impulse applied by this joint on the first body.
///
/// The impulse applied to the second body is given by `-impulse`.
- pub impulse: Vector5<f32>,
+ pub impulse: Vector5<Real>,
}
impl RevoluteJoint {
/// Creates a new revolute joint with the given point of applications and axis, all expressed
/// in the local-space of the affected bodies.
pub fn new(
- local_anchor1: Point<f32>,
- local_axis1: Unit<Vector<f32>>,
- local_anchor2: Point<f32>,
- local_axis2: Unit<Vector<f32>>,
+ local_anchor1: Point<Real>,
+ local_axis1: Unit<Vector<Real>>,
+ local_anchor2: Point<Real>,
+ local_axis2: Unit<Vector<Real>>,
) -> Self {
Self {
local_anchor1,