simvx.core.nodes_3d.node3d

Node3D – base 3D spatial node.

Module Contents

Classes

Node3D

3D spatial node with position, rotation, and scale.

API

class simvx.core.nodes_3d.node3d.Node3D(**kwargs)[source]

Bases: simvx.core.node.Node

3D spatial node with position, rotation, and scale.

Extends Node with a 3D transform and cached global-transform propagation through the hierarchy. All 3D objects – meshes, cameras, lights – inherit from this.

Attributes: position: Local position as Vec3. rotation: Local rotation as Quat (quaternion). scale: Local scale as Vec3 (default (1, 1, 1)).

Example::

cube = Node3D(position=(0, 2, -5), name="Cube")
cube.rotate_y(math.radians(45))
print(cube.forward)  # unit vector along the local -Z axis

Initialization

position

‘_SpatialVecProperty(…)’

rotation

‘Property(…)’

scale

‘_SpatialVecProperty(…)’

render_layer

‘Property(…)’

property rotation_degrees: simvx.core.math.types.Vec3[source]

Euler angles in degrees (convenience for editor display).

property world_position: simvx.core.math.types.Vec3[source]
property world_rotation: simvx.core.math.types.Quat[source]
property world_scale: simvx.core.math.types.Vec3[source]
property forward: simvx.core.math.types.Vec3[source]
property right: simvx.core.math.types.Vec3[source]
property up: simvx.core.math.types.Vec3[source]
translate(offset: tuple[float, float, float] | numpy.ndarray)[source]

Move by offset in local space.

translate_global(offset: tuple[float, float, float] | numpy.ndarray)[source]

Move by offset in world space.

rotate(axis: tuple[float, float, float] | numpy.ndarray, angle: float)[source]

Rotate around an axis by the given angle in radians.

rotate_x(angle: float)[source]
rotate_y(angle: float)[source]
rotate_z(angle: float)[source]
look_at(target: tuple[float, float, float] | numpy.ndarray, up=None)[source]

Rotate to face a target position in world space.

face_along(forward: tuple[float, float, float] | numpy.ndarray, up: tuple[float, float, float] | numpy.ndarray | None = None) None[source]

Rotate so the local -Z axis aligns with the given world-space direction.

Convenience for setting orientation from a velocity / heading vector without first computing a target point. Wraps :meth:Quat.look_at, which already negates forward to match the engine’s -Z convention.

Args: forward: World-space direction the front of the node should face. up: World-space up hint (defaults to (0, 1, 0)).

Raises: ValueError: If forward is zero-length (no well-defined facing).

set_render_layer(index: int, enabled: bool = True) None[source]

Enable or disable a specific render layer (0-31).

is_on_render_layer(index: int) bool[source]

Check if this node is on a specific render layer (0-31).

wrap_bounds(bounds: tuple[float, float, float] | numpy.ndarray, margin: float = 1.0)[source]

Wrap position within a 3D volume centered at origin.

strict_errors: ClassVar[bool]

True

script_error_raised

‘Signal(…)’

classmethod __init_subclass__(**kwargs)
property name: str
property process_mode: simvx.core.descriptors.ProcessMode
property visible: bool
reset_error() None
add_child(node: simvx.core.node.Node) simvx.core.node.Node
remove_child(node: simvx.core.node.Node)
reparent(new_parent: simvx.core.node.Node)
get_node(path: str) simvx.core.node.Node
find_child(name: str, recursive: bool = False) simvx.core.node.Node | None
find(target: type | str, recursive: bool = True) simvx.core.node.Node | None
find_all(node_type: type, recursive: bool = True) list
walk(*, include_self: bool = True) collections.abc.Iterator[simvx.core.node.Node]
property path: str
add_to_group(group: str)
remove_from_group(group: str)
is_in_group(group: str) bool
on_ready() None
on_enter_tree() None
on_exit_tree() None
on_process(dt: float) None
on_physics_process(dt: float) None
on_draw(renderer) None
on_picked(event: simvx.core.events.InputEvent) None
on_unhandled_input(event: simvx.core.events.TreeInputEvent) None
start_coroutine(gen: simvx.core.descriptors.Coroutine) simvx.core.descriptors.CoroutineHandle
stop_coroutine(gen_or_handle)
clear_children()
destroy()
property app
property tree: simvx.core.scene_tree.SceneTree
__getitem__(key: str)
classmethod get_properties() dict[str, simvx.core.descriptors.Property]
__repr__()