Class Ray
- java.lang.Object
-
- com.google.ar.sceneform.collision.Ray
-
public class Ray extends java.lang.Object
Mathematical representation of a ray. Used to perform intersection and collision tests.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector3
getDirection()
Get the direction of the ray.Vector3
getOrigin()
Get the origin of the ray.Vector3
getPoint(float distance)
Get a point at a distance along the ray.void
setDirection(Vector3 direction)
Set the direction of the ray.void
setOrigin(Vector3 origin)
Set the origin of the ray in world coordinates.java.lang.String
toString()
-
-
-
Method Detail
-
setOrigin
public void setOrigin(Vector3 origin)
Set the origin of the ray in world coordinates.- Parameters:
origin
- the new origin of the ray.
-
getOrigin
public Vector3 getOrigin()
Get the origin of the ray.- Returns:
- a new vector that represents the ray's origin
-
setDirection
public void setDirection(Vector3 direction)
Set the direction of the ray. The direction will automatically be normalized.- Parameters:
direction
- the new direction of the ray
-
getDirection
public Vector3 getDirection()
Get the direction of the ray.- Returns:
- a new vector that represents the ray's direction
-
getPoint
public Vector3 getPoint(float distance)
Get a point at a distance along the ray.- Parameters:
distance
- distance along the ray of the point- Returns:
- a new vector that represents a point at a distance along the ray.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-