mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
PhysicsShape applyTorque function
This commit is contained in:
parent
f42c9bd9b7
commit
55e9af9786
7 changed files with 42 additions and 2 deletions
|
|
@ -857,6 +857,12 @@ void PhysicsShape::applyImpulse( const Point3F &pos, const VectorF &vec )
|
|||
mPhysicsRep->applyImpulse( pos, vec );
|
||||
}
|
||||
|
||||
void PhysicsShape::applyTorque( const Point3F &torque )
|
||||
{
|
||||
if (mPhysicsRep && mPhysicsRep->isDynamic())
|
||||
mPhysicsRep->applyTorque( torque );
|
||||
}
|
||||
|
||||
void PhysicsShape::applyRadialImpulse( const Point3F &origin, F32 radius, F32 magnitude )
|
||||
{
|
||||
if ( !mPhysicsRep || !mPhysicsRep->isDynamic() )
|
||||
|
|
@ -1179,4 +1185,12 @@ DefineEngineMethod( PhysicsShape, restore, void, (),,
|
|||
"Has no effect if the shape is not destroyed.\n\n")
|
||||
{
|
||||
object->restore();
|
||||
}
|
||||
|
||||
DefineEngineMethod( PhysicsShape, applyTorque, void, (Point3F torque), ,
|
||||
"@brief Add a torque to a dynamic physics shape.\n\n"
|
||||
"@param torque to apply to the dynamic physics shape\n"
|
||||
"@note This value is ignored on physics shapes that are not dynamic. Wakes up the dynamic physics shape if it is sleeping.\n")
|
||||
{
|
||||
object->applyTorque( torque );
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue