Package com.io7m.jspatial.api
Class Ray3D
- java.lang.Object
-
- com.io7m.jspatial.api.Ray3D
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRay3D.BuilderBuilds instances of typeRay3D.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Ray3D.Builderbuilder()Creates a builder forRay3D.static Ray3DcopyOf(Ray3DType instance)Creates an immutable copy of aRay3DTypevalue.com.io7m.jtensors.core.unparameterized.vectors.Vector3Ddirection()com.io7m.jtensors.core.unparameterized.vectors.Vector3DdirectionInverse()booleanequals(java.lang.Object another)This instance is equal to all instances ofRay3Dthat have equal attribute values.inthashCode()Computes a hash code from attributes:origin,direction.static Ray3Dof(com.io7m.jtensors.core.unparameterized.vectors.Vector3D origin, com.io7m.jtensors.core.unparameterized.vectors.Vector3D direction)Construct a new immutableRay3Dinstance.com.io7m.jtensors.core.unparameterized.vectors.Vector3Dorigin()java.lang.StringtoString()Prints the immutable valueRay3Dwith attribute values.Ray3DwithDirection(com.io7m.jtensors.core.unparameterized.vectors.Vector3D value)Copy the current immutable object by setting a value for thedirectionattribute.Ray3DwithOrigin(com.io7m.jtensors.core.unparameterized.vectors.Vector3D value)Copy the current immutable object by setting a value for theoriginattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.io7m.jspatial.api.Ray3DType
intersectsVolume
-
-
-
-
Method Detail
-
origin
public com.io7m.jtensors.core.unparameterized.vectors.Vector3D origin()
-
direction
public com.io7m.jtensors.core.unparameterized.vectors.Vector3D direction()
-
directionInverse
public com.io7m.jtensors.core.unparameterized.vectors.Vector3D directionInverse()
- Specified by:
directionInversein interfaceRay3DType- Returns:
- The inverted direction of this ray
-
withOrigin
public final Ray3D withOrigin(com.io7m.jtensors.core.unparameterized.vectors.Vector3D value)
Copy the current immutable object by setting a value for theoriginattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for origin- Returns:
- A modified copy of the
thisobject
-
withDirection
public final Ray3D withDirection(com.io7m.jtensors.core.unparameterized.vectors.Vector3D value)
Copy the current immutable object by setting a value for thedirectionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for direction- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofRay3Dthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:origin,direction.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueRay3Dwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static Ray3D of(com.io7m.jtensors.core.unparameterized.vectors.Vector3D origin, com.io7m.jtensors.core.unparameterized.vectors.Vector3D direction)
Construct a new immutableRay3Dinstance.- Parameters:
origin- The value for theoriginattributedirection- The value for thedirectionattribute- Returns:
- An immutable Ray3D instance
-
copyOf
public static Ray3D copyOf(Ray3DType instance)
Creates an immutable copy of aRay3DTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Ray3D instance
-
builder
public static Ray3D.Builder builder()
Creates a builder forRay3D.- Returns:
- A new Ray3D builder
-
-