Package com.ardor3d.math
Class Line3
java.lang.Object
com.ardor3d.math.Line3Base
com.ardor3d.math.Line3
- All Implemented Interfaces:
Poolable
,ReadOnlyLine3
,ReadOnlyLine3Base
,Savable
,Externalizable
,Serializable
- See Also:
-
Field Summary
Fields inherited from class com.ardor3d.math.Line3Base
_direction, _origin
-
Constructor Summary
ConstructorDescriptionLine3()
Constructs a new line with an origin at (0,0,0) and a direction of (0,0,1).Line3
(ReadOnlyLine3 source) Constructs a new line using the supplied source lineLine3
(ReadOnlyVector3 origin, ReadOnlyVector3 direction) Constructs a new line using the supplied origin point and unit length direction vector -
Method Summary
Modifier and TypeMethodDescriptionclone()
double
distanceSquared
(ReadOnlyVector3 point, Vector3 store) boolean
static final Line3
static boolean
isValid
(ReadOnlyLine3 line) Check a line... if it is null or the values of its origin or direction are NaN or infinite, return false.static final void
releaseTempInstance
(Line3 line) Releases a Line3 back to be used by a future call to fetchTempInstance.set
(ReadOnlyLine3 source) Copies the values of the given source line into this line.toString()
Methods inherited from class com.ardor3d.math.Line3Base
getClassTag, getDirection, getOrigin, hashCode, read, readExternal, setDirection, setOrigin, write, writeExternal
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.ardor3d.math.type.ReadOnlyLine3Base
getDirection, getOrigin
-
Constructor Details
-
Line3
public Line3()Constructs a new line with an origin at (0,0,0) and a direction of (0,0,1). -
Line3
Constructs a new line using the supplied origin point and unit length direction vector- Parameters:
origin
- the origin of the line.direction
- the direction of the line. Should be of unit length.
-
Line3
Constructs a new line using the supplied source line- Parameters:
source
- the source line
-
-
Method Details
-
set
Copies the values of the given source line into this line.- Parameters:
source
- the source line- Returns:
- this line for chaining
- Throws:
NullPointerException
- if source is null.
-
distanceSquared
- Specified by:
distanceSquared
in interfaceReadOnlyLine3Base
- Parameters:
point
- the pointstore
- if not null, the closest point is stored in this param- Returns:
- the squared distance from this line to the given point.
- Throws:
NullPointerException
- if the point is null.
-
isValid
Check a line... if it is null or the values of its origin or direction are NaN or infinite, return false. Else return true.- Parameters:
line
- the line to check- Returns:
- true or false as stated above.
-
toString
-
equals
-
clone
- Specified by:
clone
in interfaceReadOnlyLine3
- Overrides:
clone
in classObject
-
fetchTempInstance
- Returns:
- An instance of Line3 that is intended for temporary use in calculations and so forth. Multiple calls to the method should return instances of this class that are not currently in use.
-
releaseTempInstance
Releases a Line3 back to be used by a future call to fetchTempInstance. TAKE CARE: this Line3 object should no longer have other classes referencing it or "Bad Things" will happen.- Parameters:
line
- the Line3 to release.
-