Class Vector3dVariable
java.lang.Object
org.web3d.vrml.renderer.common.input.dis.Vector3dVariable
- All Implemented Interfaces:
SolverTarget
A variable for solving translation convergence.
- Version:
- $Revision: 1.5 $
- Author:
- Andrzej Kapolka, Alan Hudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
decodeState
(double[] state) Decodes the state of this variable from the format used by the differential equation solver.void
Encodes the state of this variable (its value and the values of its derivatives) into a format suitable for use by the differential equation solver.void
getDerivatives
(javax.vecmath.Vector3d[] result) Retrieves the values of the derivatives of this variable.void
getRatesOfChange
(double[] values, double time, double[] results) Returns the rates of change corresponding to the given values and time.void
getValue
(javax.vecmath.Vector3d result) Retrieves the current value of this variable.void
interpolate
(Vector3dVariable v1, Vector3dVariable v2, double alpha, long newReferenceTime) Sets the state of this variable to an interpolated state between the two specified variables.void
makeCurrent
(long newReferenceTime) Makes the values of this variable current by integrating over time.void
set
(javax.vecmath.Vector3d pValue, javax.vecmath.Vector3d[] pDerivatives, long pReferenceTime) Sets the state of this variable.void
set
(Vector3dVariable pVariable) Sets the state of this variable to that of another variable.
-
Constructor Details
-
Vector3dVariable
Constructor.- Parameters:
order
- the order of the convergerpSolver
- The solver to use, or null to generate one locally
-
-
Method Details
-
set
public void set(javax.vecmath.Vector3d pValue, javax.vecmath.Vector3d[] pDerivatives, long pReferenceTime) Sets the state of this variable.- Parameters:
pValue
- the value of the variablepDerivatives
- the value of the variable's derivativespReferenceTime
- the reference time at which the values were valid
-
set
Sets the state of this variable to that of another variable.- Parameters:
pVariable
- the variable to copy
-
interpolate
public void interpolate(Vector3dVariable v1, Vector3dVariable v2, double alpha, long newReferenceTime) Sets the state of this variable to an interpolated state between the two specified variables.- Parameters:
v1
- the starting variablev2
- the ending variablealpha
- the interpolation parameternewReferenceTime
- the new reference time
-
makeCurrent
public void makeCurrent(long newReferenceTime) Makes the values of this variable current by integrating over time.- Parameters:
newReferenceTime
- the new reference time
-
encodeState
public void encodeState()Encodes the state of this variable (its value and the values of its derivatives) into a format suitable for use by the differential equation solver. -
decodeState
public void decodeState(double[] state) Decodes the state of this variable from the format used by the differential equation solver.- Parameters:
state
- the state vector to decode
-
getValue
public void getValue(javax.vecmath.Vector3d result) Retrieves the current value of this variable.- Parameters:
result
- aVector3d
to hold the result
-
getDerivatives
public void getDerivatives(javax.vecmath.Vector3d[] result) Retrieves the values of the derivatives of this variable.- Parameters:
result
- an array to hold the result
-
getRatesOfChange
public void getRatesOfChange(double[] values, double time, double[] results) Returns the rates of change corresponding to the given values and time.- Specified by:
getRatesOfChange
in interfaceSolverTarget
- Parameters:
values
- the values at which to evaluate the rates of changetime
- the time at which to evaluate the rates of changeresults
- an array to hold the calculated rates
-