diff options
| author | Sébastien Crozet <developer@crozet.re> | 2020-11-19 15:48:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-19 15:48:50 +0100 |
| commit | e571a0628de5ce420646b3cb8b316acf1b134e8f (patch) | |
| tree | 3e836ca8fee3f6ddfe838ecbef97ec0d824d7056 /src | |
| parent | 3f619d81ffc7899330e94ac34d3992a508dcf41b (diff) | |
| parent | 49dfe74a1bd21081fcdfc73489430f7515b09e93 (diff) | |
| download | rapier-e571a0628de5ce420646b3cb8b316acf1b134e8f.tar.gz rapier-e571a0628de5ce420646b3cb8b316acf1b134e8f.tar.bz2 rapier-e571a0628de5ce420646b3cb8b316acf1b134e8f.zip | |
Merge pull request #62 from dimforge/salva
Testbed: remove code related to salva and add a plugin system
Diffstat (limited to 'src')
| -rw-r--r-- | src/dynamics/rigid_body.rs | 6 | ||||
| -rw-r--r-- | src/geometry/shape.rs | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/dynamics/rigid_body.rs b/src/dynamics/rigid_body.rs index a1a23a0..303d1a0 100644 --- a/src/dynamics/rigid_body.rs +++ b/src/dynamics/rigid_body.rs @@ -370,6 +370,12 @@ impl RigidBody { self.apply_impulse(impulse, wake_up); self.apply_torque_impulse(torque_impulse, wake_up); } + + /// The velocity of the given world-space point on this rigid-body. + pub fn velocity_at_point(&self, point: &Point<f32>) -> Vector<f32> { + let dpt = point - self.world_com; + self.linvel + self.angvel.gcross(dpt) + } } /// A builder for rigid-bodies. diff --git a/src/geometry/shape.rs b/src/geometry/shape.rs index ec43bf7..5c96f68 100644 --- a/src/geometry/shape.rs +++ b/src/geometry/shape.rs @@ -64,6 +64,8 @@ pub trait Shape: RayCast<f32> + PointQuery<f32> + DowncastSync { None } + // TODO: add a compute_local_aabb method? + /// Computes the AABB of this shape. fn compute_aabb(&self, position: &Isometry<f32>) -> AABB<f32>; |
