API 参考 / NatsumeNode
Class: NatsumeNode
Defined in: packages/natsume/src/runtime/runtime.ts:146
A node of an effect instance. Views are cached per instance.
Constructors
Constructor
new NatsumeNode(
effect,node):NatsumeNode
Defined in: packages/natsume/src/runtime/runtime.ts:147
Parameters
effect
node
SceneNode
Returns
NatsumeNode
Accessors
active
Get Signature
get active():
boolean
Defined in: packages/natsume/src/runtime/runtime.ts:160
Own active flag.
Returns
boolean
activeInHierarchy
Get Signature
get activeInHierarchy():
boolean
Defined in: packages/natsume/src/runtime/runtime.ts:164
True when this node and all its ancestors are active.
Returns
boolean
containerPosition
Get Signature
get containerPosition():
RenderOffset
Defined in: packages/natsume/src/runtime/runtime.ts:172
Origin of the world transform in effect.container local coordinates; excludes render offsets.
Returns
id
Get Signature
get id():
number
Defined in: packages/natsume/src/runtime/runtime.ts:152
Node ID from the package.
Returns
number
name
Get Signature
get name():
string
Defined in: packages/natsume/src/runtime/runtime.ts:156
Node name from the package.
Returns
string
parent
Get Signature
get parent():
NatsumeNode|undefined
Defined in: packages/natsume/src/runtime/runtime.ts:177
Parent within this instance; undefined for an entry root.
Returns
NatsumeNode | undefined
renderOffset
Get Signature
get renderOffset():
RenderOffset
Defined in: packages/natsume/src/runtime/runtime.ts:181
Own render offset as a copy, excluding ancestor offsets.
Returns
worldMatrix
Get Signature
get worldMatrix():
Float32Array
Defined in: packages/natsume/src/runtime/runtime.ts:168
Unity-space world transform as a copy; excludes render offsets.
Returns
Float32Array
Methods
setActive()
setActive(
active):void
Defined in: packages/natsume/src/runtime/runtime.ts:194
Sets the node active flag immediately; a playing animation may overwrite it on the next fixed step.
Parameters
active
boolean
Returns
void
setRenderOffset()
setRenderOffset(
offset):void
Defined in: packages/natsume/src/runtime/runtime.ts:190
Translates this node's renderers and descendants; ancestor offsets add. Applies immediately, survives restart, and leaves simulation and depth unchanged.
Parameters
offset
RenderOffset | null
Finite effect-local coordinates, or null to clear this node's offset.
Returns
void
Throws
NatsumeError after destruction completes or if coordinates are not finite.