Class
Torque3D
View sourceExtendsVector3
Stores an entity’s accumulated angular input in 3D as an ECS component. Its
coordinates represent angular contributions around the corresponding axes,
in radians. A new component starts at (0, 0, 0). Use it with
Rotation3D for an entity’s angular motion.
Examples
import { Query, World } from '@wimaengine/ecs'
import { Rotation3D, Torque3D } from '@wimaengine/movable'
const world = new World()
world.spawn([new Rotation3D(), new Torque3D()])
new Query(world, [Rotation3D, Torque3D]).each(([rotation, torque]) => {
torque.y += 1
// Accumulate angular input around the y axis.
console.log(rotation, torque)
})