simvx.core.nodes_3d.camera

Camera3D, OrbitCamera3D – 3D camera nodes.

Module Contents

Classes

Camera3D

3D perspective camera providing view and projection matrices.

OrbitCamera3D

General-purpose orbit camera with pan and zoom controls.

API

class simvx.core.nodes_3d.camera.Camera3D(look_at=None, up=None, **kwargs)[source]

Bases: simvx.core.nodes_3d.node3d.Node3D

3D perspective camera providing view and projection matrices.

The first Camera3D found in the scene tree is used by the renderer. Position and orientation are inherited from Node3D; the camera adds projection parameters (field of view, clip planes).

Conventions (full reference: docs/graphics/cameras.md):

  • Right-handed, Y-up.

  • Forward = local -Z. camera.forward is world_rotation * (0, 0, -1). Matches Godot / glTF / OpenGL; clashes with Unity / Unreal (+Z forward): assets ported from those engines must negate the forward vector once at import.

  • look_at(target) and :meth:~Node3D.face_along both align the local -Z axis with the supplied direction.

  • Internal angles in radians; fov is stored in degrees only as an inspector convenience.

  • Matrices are row-major; the renderer transposes at the GPU boundary and applies a Vulkan-only Y-flip in

    meth:

    projection_matrix.

Attributes: fov: Vertical field of view in degrees (1 – 179). near: Near clip plane distance. far: Far clip plane distance.

Example::

camera = Camera3D(position=(0, 5, 10), look_at=(0, 0, 0), fov=75.0)

Initialization

fov

‘Property(…)’

near

‘Property(…)’

far

‘Property(…)’

exposure

‘Property(…)’

cull_mask

‘Bitmask(…)’

gizmo_colour

‘Colour(…)’

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

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

is_cull_mask_layer_enabled(index: int) bool[source]

Check if a specific cull mask layer is enabled (0-31).

get_gizmo_lines() list[tuple[simvx.core.math.types.Vec3, simvx.core.math.types.Vec3]][source]

Return frustum wireframe lines based on fov, near, far.

property view_matrix: numpy.ndarray[source]

View matrix computed from this node’s global transform.

Returns: 4x4 view matrix as numpy array (row-major)

projection_matrix(aspect: float = 16 / 9) numpy.ndarray[source]

Perspective projection matrix for given aspect ratio (Vulkan clip space).

Args: aspect: Aspect ratio (width / height)

Returns: 4x4 projection matrix as numpy array (row-major) Includes Y-flip for Vulkan rendering

position

‘_SpatialVecProperty(…)’

rotation

‘Property(…)’

scale

‘_SpatialVecProperty(…)’

render_layer

‘Property(…)’

property rotation_degrees: simvx.core.math.types.Vec3
property world_position: simvx.core.math.types.Vec3
property world_rotation: simvx.core.math.types.Quat
property world_scale: simvx.core.math.types.Vec3
property forward: simvx.core.math.types.Vec3
property right: simvx.core.math.types.Vec3
property up: simvx.core.math.types.Vec3
translate(offset: tuple[float, float, float] | numpy.ndarray)
translate_global(offset: tuple[float, float, float] | numpy.ndarray)
rotate(axis: tuple[float, float, float] | numpy.ndarray, angle: float)
rotate_x(angle: float)
rotate_y(angle: float)
rotate_z(angle: float)
look_at(target: tuple[float, float, float] | numpy.ndarray, up=None)
face_along(forward: tuple[float, float, float] | numpy.ndarray, up: tuple[float, float, float] | numpy.ndarray | None = None) None
set_render_layer(index: int, enabled: bool = True) None
is_on_render_layer(index: int) bool
wrap_bounds(bounds: tuple[float, float, float] | numpy.ndarray, margin: float = 1.0)
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_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__()
class simvx.core.nodes_3d.camera.OrbitCamera3D(**kwargs)[source]

Bases: simvx.core.nodes_3d.camera.Camera3D

General-purpose orbit camera with pan and zoom controls.

Initialization

pivot

‘Property(…)’

distance

‘Property(…)’

yaw

‘Property(…)’

pitch

‘Property(…)’

orbit(dyaw: float, dpitch: float)[source]

Orbit the camera around its pivot point by yaw and pitch deltas (radians).

pan(dx: float, dz: float)[source]

Pan the camera pivot horizontally in the XZ plane.

zoom(delta: float)[source]

Zoom the camera by adjusting its distance to the pivot.

update_transform()[source]

Recompute :attr:position and look-at orientation from the orbit parameters (:attr:pivot, :attr:distance, :attr:yaw, :attr:pitch).

Call this after assigning orbit parameters directly so the world-space transform reflects the new values immediately. :meth:orbit,

Meth:

pan, and :meth:zoom invoke it for you.

fov

‘Property(…)’

near

‘Property(…)’

far

‘Property(…)’

exposure

‘Property(…)’

cull_mask

‘Bitmask(…)’

gizmo_colour

‘Colour(…)’

on_enter_tree()
set_cull_mask_layer(index: int, enabled: bool = True) None
is_cull_mask_layer_enabled(index: int) bool
get_gizmo_lines() list[tuple[simvx.core.math.types.Vec3, simvx.core.math.types.Vec3]]
property view_matrix: numpy.ndarray
projection_matrix(aspect: float = 16 / 9) numpy.ndarray
position

‘_SpatialVecProperty(…)’

rotation

‘Property(…)’

scale

‘_SpatialVecProperty(…)’

render_layer

‘Property(…)’

property rotation_degrees: simvx.core.math.types.Vec3
property world_position: simvx.core.math.types.Vec3
property world_rotation: simvx.core.math.types.Quat
property world_scale: simvx.core.math.types.Vec3
property forward: simvx.core.math.types.Vec3
property right: simvx.core.math.types.Vec3
property up: simvx.core.math.types.Vec3
translate(offset: tuple[float, float, float] | numpy.ndarray)
translate_global(offset: tuple[float, float, float] | numpy.ndarray)
rotate(axis: tuple[float, float, float] | numpy.ndarray, angle: float)
rotate_x(angle: float)
rotate_y(angle: float)
rotate_z(angle: float)
look_at(target: tuple[float, float, float] | numpy.ndarray, up=None)
face_along(forward: tuple[float, float, float] | numpy.ndarray, up: tuple[float, float, float] | numpy.ndarray | None = None) None
set_render_layer(index: int, enabled: bool = True) None
is_on_render_layer(index: int) bool
wrap_bounds(bounds: tuple[float, float, float] | numpy.ndarray, margin: float = 1.0)
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_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__()