|
@@ -107,8 +107,11 @@ public:
|
|
|
/// Set world space angular velocity of the center of mass, will make sure the value is clamped against the maximum angular velocity
|
|
|
void SetAngularVelocityClamped(Vec3Arg inAngularVelocity) { JPH_ASSERT(!IsStatic()); mMotionProperties->SetAngularVelocityClamped(inAngularVelocity); }
|
|
|
|
|
|
+ /// Velocity of point inPoint (in center of mass space, e.g. on the surface of the body) of the body (unit: m/s)
|
|
|
+ inline const Vec3 GetPointVelocityCOM(Vec3Arg inPointRelativeToCOM) const { return !IsStatic()? mMotionProperties->GetLinearVelocity() + mMotionProperties->GetAngularVelocity().Cross(inPointRelativeToCOM) : Vec3::sZero(); }
|
|
|
+
|
|
|
/// Velocity of point inPoint (in world space, e.g. on the surface of the body) of the body (unit: m/s)
|
|
|
- inline const Vec3 GetPointVelocity(Vec3Arg inPoint) const { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); return !IsStatic()? mMotionProperties->GetLinearVelocity() + mMotionProperties->GetAngularVelocity().Cross(inPoint - mPosition) : Vec3::sZero(); }
|
|
|
+ inline const Vec3 GetPointVelocity(Vec3Arg inPoint) const { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); return GetPointVelocityCOM(inPoint - mPosition); }
|
|
|
|
|
|
/// Add force (unit: N) for the next time step, will be reset after the next call to PhysicsSimulation::Update
|
|
|
inline void AddForce(Vec3Arg inForce) { JPH_ASSERT(IsDynamic()); (Vec3::sLoadFloat3Unsafe(mMotionProperties->mForce) + inForce).StoreFloat3(&mMotionProperties->mForce); }
|