GearBlocks
The GearBlocks Lua scripting API
Public Member Functions | List of all members
SmashHammer.Scripting.IPhysical Interface Reference

A physical entity. More...

Inheritance diagram for SmashHammer.Scripting.IPhysical:
SmashHammer.GearBlocks.Construction.PartDescriptor SmashHammer.GearBlocks.Construction.PartDescriptorProcedural

Public Member Functions

void ApplyForce (Vector3Proxy force, Vector3Proxy position, ForceMode mode=ForceMode.Force)
 Apply a force to a physical object.
 

Detailed Description

A physical entity.

Member Function Documentation

◆ ApplyForce()

void SmashHammer.Scripting.IPhysical.ApplyForce ( Vector3Proxy  force,
Vector3Proxy  position,
ForceMode  mode = ForceMode.Force 
)

Apply a force to a physical object.

Parameters
forceDirection and magniture of the force, in world coordinates.
positionPostion at which to apply the force, in world coordinates.
modeType of force to apply.

ForceMode enum:

Force Apply a continuous force to the rigidbody, using its mass. Available in Lua as forceMode_Force.
Acceleration Apply a continuous acceleration to the rigidbody, ignoring its mass. Available in Lua as forceMode_Acceleration.
Impulse Apply an instant force impulse to the rigidbody, using its mass. Available in Lua as forceMode_Impulse.
VelocityChange Apply an instant velocity change to the rigidbody, ignoring its mass. Available in Lua as forceMode_VelocityChange.