simvx.core.nodes_3d.mesh

MeshInstance3D – visible 3D mesh node.

Module Contents

Classes

MeshInstance3D

Visible 3D object. Holds a Mesh and Material for the renderer.

API

class simvx.core.nodes_3d.mesh.MeshInstance3D(mesh=None, material=None, skin=None, **kwargs)[source]

Bases: simvx.core.nodes_3d.node3d.Node3D

Visible 3D object. Holds a Mesh and Material for the renderer.

Set skin to a :class:~simvx.core.skeleton.Skeleton node to enable skeletal animation. The renderer reads skin.joint_matrices each frame to upload bone transforms for vertex skinning.

The pivot Property controls where the mesh’s local origin sits relative to its bounding box. "center" (default) treats the mesh-local origin as the geometric centre: convenient for free- floating objects. "bottom" lifts the mesh by half its height along local +Y, so foot-aligned entities (characters, props, obstacles) place naturally on a ground plane at local_position.y = 0. The shift is applied at draw time via the model matrix; the mesh data itself is untouched.

Usage: from simvx.core.graphics.mesh import Mesh from simvx.core.graphics.material import Material mi = MeshInstance3D(mesh=Mesh.cube(), material=Material(colour=(1, 0, 0)))

# Foot-aligned cube: position.y = 0 puts the bottom on the floor:
mi = MeshInstance3D(mesh=Mesh.cube(), pivot="bottom")

# Skeletal mesh:
mi.skin = skeleton_node

Initialization

lod_bias

‘Property(…)’

pivot

‘Property(…)’

property skin[source]

Skeleton node providing joint matrices for vertex skinning.

Accepts a :class:~simvx.core.skeleton.Skeleton instance (or None to disable skinning). Assigning a skeleton does not reparent it; the skeleton should already be part of the scene tree.

property model_matrix: numpy.ndarray[source]

Model transform matrix from global position/rotation/scale.

When pivot == "bottom", the mesh is pre-translated along its local +Y by half its bounding-box height so the bottom of the mesh sits at local_position.y. The shift is applied in the node’s local frame so it rotates / scales with the node.

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_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__()