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[source]

‘getLogger(…)’

class simvx.core.decal.Decal3D(position=None, rotation=None, scale=None, **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 defines the half-extents of the projection box in local space (width, height, depth). Only geometry within this box and matching the cull_mask receives the projected texture.

Properties: size: Half-extents of the projection box (Vec3). 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(1, 0.5, 1)
decal.albedo_mix = 0.8

Initialization

size

‘Property(…)’

texture

‘Property(…)’

normal_texture

‘Property(…)’

albedo_mix

‘Property(…)’

normal_mix

‘Property(…)’

modulate

‘Property(…)’

distance_fade_begin

‘Property(…)’

distance_fade_length

‘Property(…)’

cull_mask

‘Property(…)’

upper_fade

‘Property(…)’

lower_fade

‘Property(…)’

gizmo_colour

‘Property(…)’

property projection_direction: simvx.core.math.types.Vec3

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, with half-extents given by size. An additional arrow along the projection direction (-Y) is included.

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