Class LinCompf
- java.lang.Object
-
- WildMagic.LibFoundation.Mathematics.LinCompf
-
- All Implemented Interfaces:
java.io.Serializable
public abstract class LinCompf extends java.lang.Object implements java.io.Serializable
The linear component is represented as P+t*D where P is the component origin and D is a unit-length direction vector. The user must ensure that the direction vector satisfies this condition. The t-intervals for lines, rays, segments, points, or the empty set are described later.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LinCompf.ComponentType
component type
-
Field Summary
Fields Modifier and Type Field Description protected float
m_fMax
the interval of restriction for tprotected float
m_fMin
the interval of restriction for tprotected LinCompf.ComponentType
m_iType
component typeprivate static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protected
LinCompf()
Constructs an new LinComf object: default is CT_NONE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
Contains(float fParam)
Determine if the specified parameter is in the interval.float
GetMax()
access the interval [min,max]float
GetMin()
access the interval [min,max]LinCompf.ComponentType
GetType()
Gets the type of linear componentstatic LinCompf.ComponentType
GetTypeFromInterval(float fMin, float fMax)
Determine the type of an interval without having to create an instance of a LinComp object.boolean
IsCanonical()
The canonical intervals are [-MAX_REAL,MAX_REAL] for a line; [0,MAX_REAL] for a ray; [-e,e] for a segment, where e > 0; [0,0] for a point, and [MAX_REAL,-MAX_REAL] for the empty set.abstract void
MakeCanonical()
The canonical intervals are [-MAX_REAL,MAX_REAL] for a line; [0,MAX_REAL] for a ray; [-e,e] for a segment, where e > 0; [0,0] for a point, and [MAX_REAL,-MAX_REAL] for the empty set.void
SetInterval(float fMin, float fMax)
The interval of restriction for t, as defined above.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_iType
protected LinCompf.ComponentType m_iType
component type
-
m_fMin
protected float m_fMin
the interval of restriction for t
-
m_fMax
protected float m_fMax
the interval of restriction for t
-
-
Method Detail
-
GetTypeFromInterval
public static LinCompf.ComponentType GetTypeFromInterval(float fMin, float fMax)
Determine the type of an interval without having to create an instance of a LinComp object.- Parameters:
fMin
- minfMax
- max
-
Contains
public boolean Contains(float fParam)
Determine if the specified parameter is in the interval.- Parameters:
fParam
- value to test- Returns:
- true if in the interval
-
GetMax
public final float GetMax()
access the interval [min,max]- Returns:
- interval max-value
-
GetMin
public final float GetMin()
access the interval [min,max]- Returns:
- interval min-value
-
GetType
public final LinCompf.ComponentType GetType()
Gets the type of linear component- Returns:
- component type.
-
IsCanonical
public boolean IsCanonical()
The canonical intervals are [-MAX_REAL,MAX_REAL] for a line; [0,MAX_REAL] for a ray; [-e,e] for a segment, where e > 0; [0,0] for a point, and [MAX_REAL,-MAX_REAL] for the empty set. If the interval is [min,max], the adjustments are as follows. CT_RAY: If max is MAX_REAL and if min is not zero, then P is modified to P' = P+min*D so that the ray is represented by P'+t*D for t >= 0. If min is -MAX_REAL and max is finite, then the origin and direction are modified to P' = P+max*D and D' = -D. CT_SEGMENT: If min is not -max, then P is modified to P' = P + ((min+max)/2)*D and the extent is e' = (max-min)/2. CT_POINT: If min is not zero, the P is modified to P' = P+min*D. CT_EMPTY: Set max to -MAX_REAL and min to MAX_REAL. The first function is virtual since the updates are dependent on the dimension of the vector space.- Returns:
- true if this is a canonical interval
-
MakeCanonical
public abstract void MakeCanonical()
The canonical intervals are [-MAX_REAL,MAX_REAL] for a line; [0,MAX_REAL] for a ray; [-e,e] for a segment, where e > 0; [0,0] for a point, and [MAX_REAL,-MAX_REAL] for the empty set. If the interval is [min,max], the adjustments are as follows. CT_RAY: If max is MAX_REAL and if min is not zero, then P is modified to P' = P+min*D so that the ray is represented by P'+t*D for t >= 0. If min is -MAX_REAL and max is finite, then the origin and direction are modified to P' = P+max*D and D' = -D. CT_SEGMENT: If min is not -max, then P is modified to P' = P + ((min+max)/2)*D and the extent is e' = (max-min)/2. CT_POINT: If min is not zero, the P is modified to P' = P+min*D. CT_EMPTY: Set max to -MAX_REAL and min to MAX_REAL. The first function is virtual since the updates are dependent on the dimension of the vector space.
-
SetInterval
public void SetInterval(float fMin, float fMax)
The interval of restriction for t, as defined above. The function SetInterval(min,max) sets the t-interval; it handles all possible inputs according to the following scheme: CT_LINE: [-MAX_REAL,MAX_REAL] CT_RAY: [min,MAX_REAL], where min is finite [-MAX_REAL,max], where max is finite CT_SEGMENT: [min,max], where min and max are finite with min < max CT_POINT: [min,max], where min and max are finite with min = max CT_EMPTY: [min,max], where min > max or min = max = MAX_REAL or min = max = -MAX_REAL- Parameters:
fMin
- minfMax
- max
-
-