simvx.core.nodes_3d.spring_arm

SpringArm3D – camera collision avoidance arm for 3rd-person games.

Module Contents

Classes

SpringArm3D

Camera collision avoidance arm for 3rd-person games.

API

class simvx.core.nodes_3d.spring_arm.SpringArm3D(**kwargs)[source]

Bases: simvx.core.nodes_3d.node3d.Node3D

Camera collision avoidance arm for 3rd-person games.

Casts a ray from its position along its forward (-Z) axis. If geometry is hit, shortens the arm so children (typically a Camera3D) avoid clipping through walls.

Usage::

pivot = Node3D(name="Pivot")
arm = SpringArm3D(spring_length=5.0)
camera = Camera3D()
pivot.add_child(arm)
arm.add_child(camera)
# Camera auto-positions at arm tip, shortened if blocked

Initialization

spring_length

‘Property(…)’

margin

‘Property(…)’

collision_mask

‘Property(…)’

shape_radius

‘Property(…)’

gizmo_colour

‘Property(…)’

get_hit_length() float[source]

Return the current computed arm length after collision check.

add_excluded_object(obj) None[source]

Exclude a specific body from the springarm raycast.

remove_excluded_object(obj) None[source]

Remove an exclusion so the body is considered again.

physics_process(dt: float) None[source]
get_gizmo_lines() list[tuple[simvx.core.math.types.Vec3, simvx.core.math.types.Vec3]][source]

Return a line from pivot to arm tip, plus a cross at the tip.

render_layer

‘Property(…)’

property position
property rotation: simvx.core.math.types.Quat
property scale
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)
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
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(node_type: type, recursive: bool = True) simvx.core.node.Node | None
find_all(node_type: type, recursive: bool = True) list
property path: str
add_to_group(group: str)
remove_from_group(group: str)
is_in_group(group: str) bool
ready() None
enter_tree() None
exit_tree() None
process(dt: float) None
draw(renderer) None
input_event(event: simvx.core.events.InputEvent) None
input(event: simvx.core.events.TreeInputEvent) None
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
get_tree() simvx.core.scene_tree.SceneTree
__getitem__(key: str)
classmethod get_properties() dict[str, simvx.core.descriptors.Property]
__repr__()