Zum Hauptinhalt springen

applyTorque()

ecs.physics.applyTorque(world, eid, torqueX, torqueY, torqueZ)

Description

You can directly apply forces (linear and angular) to any entity with a physics collider. These forces are applied in the next physics simulation update, which takes place at regular intervals. The function accepts a 3D vector to define the force direction and magnitude.

Note: This is dependent on the frequency of calls to requestAnimationFrame() or your devices refresh rate.

Parameters

ParameterTypeDescription
worldnumberWorld
eidEidEntity id
torqueXnumbertorqueX
torqueYnumbertorqueY
torqueZnumbertorqueZ

Returns

None.