Transforms
node.transform(kind, params) moves a body or an assembly. It changes the node’s placement, not its shape.
Translate, rotate and scale add to the current placement. Place sets it.
getPlacement() returns { origin, xDirection, normal, scale } relative to the parent. getWorldPlacement() returns it in the world.
Do not set position, rotation or scale on a body. The kernel puts the placement back and sends a PlacementOverwritten warning.
A negative scale throws InvalidTransform. Use mirror.
Assemblies
ASystemAssembly groups nodes. Its children follow its placement.
- Pass
parentin the options, or calladdChild(children, { keepWorld? }). removeChild(child, { keepWorld? })takes a node out. WithkeepWorld: truethe node keeps its world position; otherwise it keeps its local placement.getChildren()returns the children’sogIdvalues.getParent()returns the parent’sogId, ornull.- Bodies have the same tree methods, so a body can be the parent of another body.
- A
SystemAssemblyis not a Three.js object. Add its bodies to the scene yourself. assembly.dispose()disposes the assembly.
Copies and instances
{ instances: 'all' }, or makeUnique() on the body that should change alone.
