simvx.core.shapecast¶
ShapeCast2D and ShapeCast3D — Swept shape query nodes.
Module Contents¶
Classes¶
Swept shape query node for 2D. Like a thick raycast. |
|
Swept shape query node for 3D. Like a thick raycast. |
API¶
- class simvx.core.shapecast.ShapeCast2D(shape: simvx.core.collision.CollisionShape | None = None, **kwargs)[source]¶
Bases:
simvx.core.nodes_2d.node2d.Node2DSwept shape query node for 2D. Like a thick raycast.
Sweeps a collision shape from this node’s global position to world_position + target_position, reporting all bodies intersected.
Initialization
- target_position¶
‘Property(…)’
- collision_mask¶
‘Property(…)’
- max_results¶
‘Property(…)’
- enabled¶
‘Property(…)’
- exclude_parent¶
‘Property(…)’
- margin¶
‘Property(…)’
- gizmo_colour¶
‘Property(…)’
- collision_detected¶
‘Signal(…)’
- get_gizmo_lines() list[tuple[simvx.core.math.types.Vec2, simvx.core.math.types.Vec2]][source]¶
Return arrow line from position to target_position in world space.
- property shape: simvx.core.collision.CollisionShape¶
- property is_colliding: bool¶
- property collision_count: int¶
- get_collision_point(index: int = 0) simvx.core.math.types.Vec2[source]¶
- get_collision_normal(index: int = 0) simvx.core.math.types.Vec2[source]¶
- z_index¶
‘Property(…)’
- z_as_relative¶
‘Property(…)’
- render_layer¶
‘Property(…)’
- set_render_layer(index: int, enabled: bool = True) None¶
- is_on_render_layer(index: int) bool¶
- property absolute_z_index: int¶
- property position: simvx.core.math.types.Vec2¶
- property rotation: float¶
- property rotation_degrees: float¶
- property scale: simvx.core.math.types.Vec2¶
- property world_position: simvx.core.math.types.Vec2¶
- property world_rotation: float¶
- property world_scale: simvx.core.math.types.Vec2¶
- property forward: simvx.core.math.types.Vec2¶
- property right: simvx.core.math.types.Vec2¶
- translate(offset: tuple[float, float] | numpy.ndarray)¶
- rotate(radians: float)¶
- rotate_deg(degrees: float)¶
- look_at(target: tuple[float, float] | numpy.ndarray)¶
- transform_points(points: list[simvx.core.math.types.Vec2]) list[simvx.core.math.types.Vec2]¶
- draw_polygon(renderer, points: list[simvx.core.math.types.Vec2], closed=True, colour=None)¶
- wrap_screen(margin: float = 20)¶
- 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¶
- property path: str¶
- add_to_group(group: str)¶
- remove_from_group(group: str)¶
- is_in_group(group: str) bool¶
- ready() 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__()¶
- class simvx.core.shapecast.ShapeCast3D(shape: simvx.core.collision.CollisionShape | None = None, **kwargs)[source]¶
Bases:
simvx.core.nodes_3d.node3d.Node3DSwept shape query node for 3D. Like a thick raycast.
Sweeps a collision shape from this node’s global position to world_position + target_position, reporting all bodies intersected.
Initialization
- target_position¶
‘Property(…)’
- collision_mask¶
‘Property(…)’
- max_results¶
‘Property(…)’
- enabled¶
‘Property(…)’
- exclude_parent¶
‘Property(…)’
- margin¶
‘Property(…)’
- gizmo_colour¶
‘Property(…)’
- collision_detected¶
‘Signal(…)’
- get_gizmo_lines() list[tuple[simvx.core.math.types.Vec3, simvx.core.math.types.Vec3]][source]¶
Return arrow line from position to target_position in world space.
- property shape: simvx.core.collision.CollisionShape¶
- property is_colliding: bool¶
- property collision_count: int¶
- get_collision_point(index: int = 0) simvx.core.math.types.Vec3[source]¶
- get_collision_normal(index: int = 0) simvx.core.math.types.Vec3[source]¶
- 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¶
- property path: str¶
- add_to_group(group: str)¶
- remove_from_group(group: str)¶
- is_in_group(group: str) bool¶
- ready() 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__()¶