simvx.core.decal

Decal3D: projects textures onto surfaces within a box volume.

Module Contents

Classes

Decal3D

Projects a texture onto nearby geometry within a box-shaped volume.

Data

log

API

simvx.core.decal.log

‘getLogger(…)’

class simvx.core.decal.Decal3D(**kwargs)[source]

Bases: simvx.core.nodes_3d.node3d.Node3D

Projects a texture onto nearby geometry within a box-shaped volume.

The decal projects along the node’s local -Y axis. The size property is the FULL extent of the projection box in local space (width, height, depth): a decal of size = Vec3(2, 1, 2) covers two units across and one unit deep, centred on the node. Only geometry within this box and matching the cull_mask receives the projected texture.

Properties: size: Full extents of the projection box (Vec3), centred on the node. texture: Path to the albedo/colour texture to project. normal_texture: Path to the normal-map texture to project. albedo_mix: Blend factor for the albedo texture (0 = invisible, 1 = full). normal_mix: Blend factor for the normal-map texture (0 = none, 1 = full). modulate: Colour tint applied to the projected texture (RGBA tuple). distance_fade_begin: Distance from camera at which the decal starts fading. distance_fade_length: Fade range: the decal is fully invisible at distance_fade_begin + distance_fade_length. cull_mask: Bitmask selecting which render layers receive the projection. upper_fade: Fade at the top (+Y) edge of the projection box (0 = hard, 1 = full fade). lower_fade: Fade at the bottom (-Y) edge of the projection box (0 = hard, 1 = full fade).

Example::

decal = Decal3D(position=(0, 2, 0), name="BloodSplat")
decal.texture = "res://textures/blood.png"
decal.size = Vec3(2, 1, 2)
decal.albedo_mix = 0.8

Initialization

size

‘Property(…)’

texture

‘Property(…)’

normal_texture

‘Property(…)’

albedo_mix

‘Property(…)’

normal_mix

‘Property(…)’

modulate

‘Colour(…)’

distance_fade_begin

‘Property(…)’

distance_fade_length

‘Property(…)’

cull_mask

‘Bitmask(…)’

upper_fade

‘Property(…)’

lower_fade

‘Property(…)’

gizmo_colour

‘Colour(…)’

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

World-space projection direction (local -Y axis).

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 wireframe edges of the projection box in world space.

The box is centred at the node’s global position, oriented by the node’s global rotation, and spans the full extents given by size. An additional arrow along the projection direction (-Y) is included.

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

dev_checks: ClassVar[bool]

None

dev_warnings: ClassVar[bool]

None

freeze_check_interval: ClassVar[float]

1.0

dynamic: bool

False

visible

‘Property(…)’

update_mode

‘Property(…)’

focus_mode

‘Property(…)’

drag_threshold

‘Property(…)’

focus_entered

‘Signal(…)’

focus_exited

‘Signal(…)’

__properties__: ClassVar[dict[str, simvx.core.descriptors.Property]]

None

classmethod __init_subclass__(**kwargs)
property name: str
property visible_in_tree: bool
property input_player: simvx.core.input.players.InputPlayer
property input_context: simvx.core.input.contexts.InputContext | None
reset_error() → None
add_child(node: simvx.core.node.T) → simvx.core.node.T
remove_child(node: simvx.core.node.Node) → None
reparent(new_parent: simvx.core.node.Node)
node_at(path, default=_NO_DEFAULT)
find(target, *, direct: bool = False)
find_all(target, *, direct: bool = False)
expect(target, *, direct: bool = False)
ancestor(target)
walk(*, include_self: bool = True) → collections.abc.Iterator[simvx.core.node.Node]
property path: str
property is_scene_root: bool
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_update(dt: float) → None
on_fixed_update(dt: float) → None
on_draw(canvas) → None
on_draw_3d(gizmos) → None
on_picked(event: simvx.core.input.events.PickEvent) → bool | None
on_gui_input(event: simvx.core.input.events.GuiInputEvent) → bool | None
start_coroutine(gen: simvx.core.descriptors.Coroutine) → simvx.core.descriptors.CoroutineHandle
stop_coroutine(gen_or_handle)
property focused: bool
property focus_rect: tuple[float, float, float, float] | None
drag_threshold_for(pointer_type: simvx.core.input.enums.PointerType | str) → float
grab_focus() → None
release_focus() → None
capture_pointer(pointer_id: int | None = None) → None
release_pointer(pointer_id: int | None = None) → None
queue_redraw() → None
property render_dirty: bool
clear_children()
destroy()
property destroying: bool
property destroyed: bool
call_deferred(method: collections.abc.Callable[..., Any], *args: Any) → None
property app
property tree: simvx.core.scene_tree.SceneTree
property viewport_size: simvx.core.math.types.Vec2
property viewport_insets: tuple[float, float, float, float]
property physics
property physics_2d
__getitem__(key: str)
classmethod get_properties() → dict[str, simvx.core.descriptors.Property]
__repr__()