Package org.sunflow.math
Class MovingMatrix4
- java.lang.Object
-
- org.sunflow.math.MovingMatrix4
-
public final class MovingMatrix4 extends java.lang.Object
This class describes a transformation matrix that changes over time. Note that while unlimited motion segments are supported, it is assumed that these segments represent equidistant samples within a given time range.
-
-
Field Summary
Fields Modifier and Type Field Description private float
inv
private float
t0
private float
t1
private Matrix4[]
transforms
-
Constructor Summary
Constructors Modifier Constructor Description private
MovingMatrix4(int n, float t0, float t1, float inv)
MovingMatrix4(Matrix4 m)
Constructs a simple static matrix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Matrix4
getData(int i)
Get the matrix for the given time step.MovingMatrix4
inverse()
int
numSegments()
Get the number of matrix segmentsMatrix4
sample(float time)
void
setSteps(int n)
Redefines the number of steps in the matrix.void
updateData(int i, Matrix4 m)
Updates the matrix for the given time step.void
updateTimes(float t0, float t1)
Update the time extents over which the matrix data is changing.
-
-
-
Field Detail
-
transforms
private Matrix4[] transforms
-
t0
private float t0
-
t1
private float t1
-
inv
private float inv
-
-
Constructor Detail
-
MovingMatrix4
public MovingMatrix4(Matrix4 m)
Constructs a simple static matrix.- Parameters:
m
- matrix value at all times
-
MovingMatrix4
private MovingMatrix4(int n, float t0, float t1, float inv)
-
-
Method Detail
-
setSteps
public void setSteps(int n)
Redefines the number of steps in the matrix. The contents are only re-allocated if the number of steps changes. This is to allow the matrix to be incrementally specified.- Parameters:
n
-
-
updateData
public void updateData(int i, Matrix4 m)
Updates the matrix for the given time step.- Parameters:
i
- time step to updatem
- new value for the matrix at this time step
-
getData
public Matrix4 getData(int i)
Get the matrix for the given time step.- Parameters:
i
- time step to get- Returns:
- matrix for the specfied time step
-
numSegments
public int numSegments()
Get the number of matrix segments- Returns:
- number of segments
-
updateTimes
public void updateTimes(float t0, float t1)
Update the time extents over which the matrix data is changing. If the interval is empty, no motion will be produced, even if multiple values have been specified.- Parameters:
t0
-t1
-
-
inverse
public MovingMatrix4 inverse()
-
sample
public Matrix4 sample(float time)
-
-