Skip to main content

Class: BabylonTransformPort

Defined in: babylon-interactions/src/transform-port.ts:48

The transform/effect surface of ONE interactable's scene object. Behaviours write through this; the adapter owns how writes land (Object3D fields, ECS components, …).

Offsets/rotations are FROM REST: the adapter captures the rest pose at registration and applies these relative to it, so behaviours compose with anything else animating the same object (the pale-signal non-destructive-offset rule).

Implements

Constructors

Constructor

new BabylonTransformPort(node: BabylonTransformNodeLike, options?: BabylonTransformPortOptions): BabylonTransformPort;

Defined in: babylon-interactions/src/transform-port.ts:55

Parameters

ParameterType
nodeBabylonTransformNodeLike
optionsBabylonTransformPortOptions

Returns

BabylonTransformPort

Methods

getLocalOffset()

getLocalOffset(): Vec3Tuple;

Defined in: babylon-interactions/src/transform-port.ts:81

Local-space pose relative to the captured rest (dragged observation).

Returns

Vec3Tuple

Implementation of

TransformPort.getLocalOffset


getWorldPose()

getWorldPose(): PoseTuple;

Defined in: babylon-interactions/src/transform-port.ts:76

The node's LIVE world pose, from its absolute position and rotation.

This differs from the three.js port, which reports the rest pose in world space. Babylon computes absolutes for its own render anyway, so reading them costs nothing and a grab starts from where the object actually is rather than from where it was registered.

Returns

PoseTuple

Implementation of

TransformPort.getWorldPose


recaptureRest()

recaptureRest(): void;

Defined in: babylon-interactions/src/transform-port.ts:62

Re-read the node's current local transform as the new rest.

Returns

void


setEffect()

setEffect(effect: {
emissive?: number;
scale?: number;
}): void;

Defined in: babylon-interactions/src/transform-port.ts:121

Uniform scale about the rest scale. The emissive part of the intent is not applied: reaching a material's emissive colour means knowing which Babylon material the node carries, and this package holds no Babylon types. Apps that want the glow subscribe to the core's feedback intents.

Parameters

ParameterType
effect{ emissive?: number; scale?: number; }
effect.emissive?number
effect.scale?number

Returns

void

Implementation of

TransformPort.setEffect


setLocalOffset()

setLocalOffset(offset: Vec3Tuple): void;

Defined in: babylon-interactions/src/transform-port.ts:86

Additive local-space offset from rest (driven press / slide).

Parameters

ParameterType
offsetVec3Tuple

Returns

void

Implementation of

TransformPort.setLocalOffset


setLocalRotation()

setLocalRotation(quaternion: QuatTuple): void;

Defined in: babylon-interactions/src/transform-port.ts:90

Local rotation about the rest orientation (hinge / dial output).

Parameters

ParameterType
quaternionQuatTuple

Returns

void

Implementation of

TransformPort.setLocalRotation


setWorldPose()

setWorldPose(pose: PoseTuple): void;

Defined in: babylon-interactions/src/transform-port.ts:102

Follow a world pose while grabbed. With a parent, the pose is resolved into the parent's frame through its absolute position and rotation.

Simplification: parent SCALE is ignored. A grabbed object under a scaled parent tracks the hand at the wrong distance. Grabbables are expected to sit under an unscaled parent, which is how the demos build them.

Parameters

ParameterType
posePoseTuple

Returns

void

Implementation of

TransformPort.setWorldPose