Skip to content

@modoki/engine / index / setBodyTranslation3D

Function: setBodyTranslation3D()

setBodyTranslation3D(world, entity, x, y, z, wakeUp?): boolean

Teleport a body to a WORLD position (world units) — the direct pose control for LATE_UPDATE correction (e.g. the sling puck's post-physics surface snap). Sets the body's WORLD pose, preserving velocity; the post-step writeback converts it back to LOCAL for a PARENTED body, so callers pass WORLD coords (for a root body world == local). Mirrors setLinvel3D's unit handling. Also set the entity's Transform trait if this frame's render must reflect the move (propagation reads the trait, not the body).

Parameters

world

World

entity

Entity

x

number

y

number

z

number

wakeUp?

boolean = true

Returns

boolean

Built with Modoki.