Skip to main content

LaserCasting

class LaserCasting

LaserCasting is a beam with distance, position and direction in the scene, they are mainly used to create advanced shooting systems among other systems.


public class LaserCasting extends Component

— Constructors (1) —

ConstructorDescription
LaserCasting()Creates a new instance of LaserCasting.

— Methods (8) —

NameDescription
float getDistance()Returns the current LaserCasting distance.
Vector3 getHitFaceNormal()Returns a Vector3 with the positions of the normals of the face of the object that LaserCasting collided.
SpatialObject getHitObject()Returns the object that the LaserCasting collided with.
Vector3 getHitPoint()Returns a Vector3 with the position of the contact point of the object with which the LaserCasting collided.
Vector2 getHitUVCoord()Returns a Vector2 with the UV coordinates of the object the LaserCasting collided with.
boolean isInfinity()Returns true if LaserCasting has the "Infinity" option enabled, returns false if not.
void setDistance(float value)Sets the current LaserCasting distance.
void setInfinity(boolean value)Defines if the LaserCasting will be "Infinite" or not.