RaycastColliderComponent class

Marks an entity as participating in ray-cast queries and defines its circular collision shape.

Add this component to any entity that should be hittable by rays.

entity.addComponent(RaycastColliderComponent(radius: 14.0, tag: 'enemy'));
Inheritance

Constructors

RaycastColliderComponent({double radius = 0, double width = 0, double height = 0, String? tag, bool isBlocker = true, bool isReflective = false, double reflectivity = 0.8})

Properties

componentType → Type
Type identifier for this component
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
height ↔ double
Height for AABB colliders (0 = use radius as circle).
getter/setter pair
isBlocker ↔ bool
When true the ray terminates on this surface. When false the hit is recorded but the ray continues through.
getter/setter pair
isReflective ↔ bool
Whether rays can bounce off this surface.
getter/setter pair
radius ↔ double
Collision radius in world units (used for circle colliders).
getter/setter pair
reflectivity ↔ double
Energy coefficient applied to the reflected ray's distance (0–1).
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tag ↔ String?
Optional semantic tag used for filtering ray queries (e.g. 'enemy').
getter/setter pair
width ↔ double
Width for AABB colliders (0 = use radius as circle).
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAttach(EntityId entityId) → void
Called when this component is added to an entity.
inherited
onDetach(EntityId entityId) → void
Called when this component is removed from an entity.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited