A Ray can be represented by its origin in space, direction vector and time traveled:

r(t) = o + td
Inheritance
  • Object
  • Ray
  • Ray

Constructors

Ray(Point3 origin, Vector3 direction)

Creates a Ray from a given origin and direction vector.

Properties

direction → Vector3

The direction of the ray.

read-only, inherited
hashCode → int

Get a hash code for this object.

read-only, inherited
origin → Vector3

The origin of the ray.

read-only, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

at(double t) → Vector3

Returns the position on this with a distance of t from origin.

inherited
copyAt(Vector3 other, double t) → void

Copy the position on this with a distance of t from origin into other.

inherited
copyFrom(Ray other) → void

Copy the origin and direction from other into this.

inherited
getPoint3(double distance) → Point3

Returns the point in space after this ray has traveled a given distance from its origin.

intersectsWithAabb3(Aabb3 other) → double

Return the distance from the origin of this to the intersection with other if this intersects with other, or null if the don't intersect.

inherited
intersectsWithQuad(Quad other) → double

Return the distance from the origin of this to the intersection with other if this intersects with other, or null if the don't intersect.

inherited
intersectsWithSphere(Sphere other) → double

Return the distance from the origin of this to the intersection with other if this intersects with other, or null if the don't intersect.

inherited
intersectsWithTriangle(Triangle other) → double

Return the distance from the origin of this to the intersection with other if this intersects with other, or null if the don't intersect.

inherited
noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() → String

Returns a string representation of this object.