Browsing StarfallEx's section
โ† Back to ACE
Back to StarfallEx

SFEX.PhysObj:calculateForceOffset

S๐Ÿท๏ธ PhysObj

Part of StarfallEx namespace

๐Ÿ”— External
PhysObj:calculateForceOffset(impulse, position)
View on GitHub|lua/starfall/libs_sh/physobj.lua:595
๐Ÿ“‹ Has LDoc๐Ÿ‘๏ธ 0 viewsUpdated 2 months ago

Description

Calculates the linear and angular impulse on the object's center of mass for an offset impulse. The outputs can be used with PhysObj:applyForceCenter and PhysObj:applyTorque, respectively. Be careful to convert the angular impulse to world frame (PhysObj:localToWorldVector) if you are going to use it with applyTorque.

Parameters

NameTypeDescription
impulseVectorThe impulse acting on the object in world coordinates (kg*source_unit/s)
positionVectorThe location of the impulse in world coordinates

Returns

TypeDescription
VectorThe calculated linear impulse on the physics object's center of mass in kg*source_unit/s. (World frame)
VectorThe calculated angular impulse on the physics object's center of mass in kg*m^2*degrees/s. (Local frame)

Examples

No examples available.

Used In

No usages found in the codebase.