Source code for simvx.core.nodes_3d.marker

"""Marker3D -- lightweight 3D position marker."""

from __future__ import annotations

from ..descriptors import Property
from ..math.types import Vec3
from .node3d import Node3D


[docs] class Marker3D(Node3D): """Position marker for spawn points, waypoints, and reference positions in 3D. Invisible at runtime. The editor renders a coloured axis cross via get_gizmo_lines(). """ gizmo_colour = Property((1.0, 0.4, 0.7, 0.8), hint="Editor gizmo colour") gizmo_size = Property(0.5, range=(0.01, 10), hint="Cross size in world units")
[docs] def get_gizmo_lines(self) -> list[tuple[Vec3, Vec3]]: """Return 3 axis-aligned line segments centred at global position.""" p = self.world_position s = float(self.gizmo_size) return [ (Vec3(p.x - s, p.y, p.z), Vec3(p.x + s, p.y, p.z)), (Vec3(p.x, p.y - s, p.z), Vec3(p.x, p.y + s, p.z)), (Vec3(p.x, p.y, p.z - s), Vec3(p.x, p.y, p.z + s)), ]