diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-01-02 14:47:40 +0100 |
|---|---|---|
| committer | Sébastien Crozet <developer@crozet.re> | 2022-01-02 16:58:36 +0100 |
| commit | f74b8401ad9ef50b8cdbf1f43a2b21f6c42b0ebc (patch) | |
| tree | 53ac492fea5942a7d466f58a0095f39505674ea4 /src/lib.rs | |
| parent | b45d4b5ac2b31856c15e802b31e288a58940cbf2 (diff) | |
| download | rapier-f74b8401ad9ef50b8cdbf1f43a2b21f6c42b0ebc.tar.gz rapier-f74b8401ad9ef50b8cdbf1f43a2b21f6c42b0ebc.tar.bz2 rapier-f74b8401ad9ef50b8cdbf1f43a2b21f6c42b0ebc.zip | |
Implement multibody joints and the new solver
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 50 |
1 files changed, 49 insertions, 1 deletions
@@ -11,7 +11,7 @@ //! User documentation for Rapier is on [the official Rapier site](https://rapier.rs/docs/). #![deny(bare_trait_objects)] -#![warn(missing_docs)] +#![allow(missing_docs)] // FIXME: deny that #[cfg(all(feature = "dim2", feature = "f32"))] pub extern crate parry2d as parry; @@ -140,16 +140,64 @@ pub mod utils; /// Elementary mathematical entities (vectors, matrices, isometries, etc). pub mod math { pub use parry::math::*; + + /* + * 2D + */ /// Max number of pairs of contact points from the same /// contact manifold that can be solved as part of a /// single contact constraint. #[cfg(feature = "dim2")] pub const MAX_MANIFOLD_POINTS: usize = 2; + + /// The type of a constraint Jacobian in twist coordinates. + #[cfg(feature = "dim2")] + pub type Jacobian<N> = na::Matrix3xX<N>; + + /// The type of a slice of the constraint Jacobian in twist coordinates. + #[cfg(feature = "dim2")] + pub type JacobianSlice<'a, N> = na::MatrixSlice3xX<'a, N>; + + /// The type of a mutable slice of the constraint Jacobian in twist coordinates. + #[cfg(feature = "dim2")] + pub type JacobianSliceMut<'a, N> = na::MatrixSliceMut3xX<'a, N>; + + /// The maximum number of possible rotations and translations of a rigid body. + #[cfg(feature = "dim2")] + pub const SPATIAL_DIM: usize = 3; + + /// The maximum number of rotational degrees of freedom of a rigid-body. + #[cfg(feature = "dim2")] + pub const ANG_DIM: usize = 1; + + /* + * 3D + */ /// Max number of pairs of contact points from the same /// contact manifold that can be solved as part of a /// single contact constraint. #[cfg(feature = "dim3")] pub const MAX_MANIFOLD_POINTS: usize = 4; + + /// The type of a constraint Jacobian in twist coordinates. + #[cfg(feature = "dim3")] + pub type Jacobian<N> = na::Matrix6xX<N>; + + /// The type of a slice of the constraint Jacobian in twist coordinates. + #[cfg(feature = "dim3")] + pub type JacobianSlice<'a, N> = na::MatrixSlice6xX<'a, N>; + + /// The type of a mutable slice of the constraint Jacobian in twist coordinates. + #[cfg(feature = "dim3")] + pub type JacobianSliceMut<'a, N> = na::MatrixSliceMut6xX<'a, N>; + + /// The maximum number of possible rotations and translations of a rigid body. + #[cfg(feature = "dim3")] + pub const SPATIAL_DIM: usize = 6; + + /// The maximum number of rotational degrees of freedom of a rigid-body. + #[cfg(feature = "dim3")] + pub const ANG_DIM: usize = 3; } /// Prelude containing the common types defined by Rapier. |
