RaycastResult<T extends Hitbox<T>> class

The result of a raycasting operation.

Note that the members of this class is heavily re-used. If you want to keep the result in an object, clone the parts you want, or the whole RaycastResult with clone.

NOTE: This class might be subject to breaking changes in an upcoming version, to make it possible to calculate the values lazily.

Constructors

RaycastResult({T? hitbox, Ray2? reflectionRay, Vector2? normal, double? distance, bool isInsideHitbox = false})

Properties

distance double?
no setter
hashCode int
The hash code for this object.
no setterinherited
hitbox → T?
no setter
intersectionPoint Vector2?
no setter
isActive bool
Whether this result has active results in it.
no setter
isInsideHitbox bool
Whether the origin of the ray was inside the hitbox.
no setter
normal Vector2?
no setter
reflectionRay Ray2?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clone() RaycastResult<T>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
setFrom(RaycastResult<T> other) → void
Sets this RaycastResult's objects to the values stored in other.
setWith({T? hitbox, Ray2? reflectionRay, Vector2? normal, double? distance, bool isInsideHitbox = false}) → void
Sets the values of the result from the specified arguments.
toString() String
A string representation of this object.
inherited

Operators

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