Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.renderer.common.input.dis
Class Vector3dVariable

java.lang.Object
  extended by org.web3d.vrml.renderer.common.input.dis.Vector3dVariable
All Implemented Interfaces:
SolverTarget

public class Vector3dVariable
extends java.lang.Object
implements SolverTarget

A variable for solving translation convergence.

Version:
$Revision: 1.4 $
Author:
Andrzej Kapolka, Alan Hudson

Constructor Summary
Vector3dVariable(int order, Solver pSolver)
          Constructor.
 
Method Summary
 void decodeState(double[] state)
          Decodes the state of this variable from the format used by the differential equation solver.
 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.
 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(Vector3dVariable pVariable)
          Sets the state of this variable to that of another variable.
 void set(javax.vecmath.Vector3d pValue, javax.vecmath.Vector3d[] pDerivatives, long pReferenceTime)
          Sets the state of this variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vector3dVariable

public Vector3dVariable(int order,
                        Solver pSolver)
Constructor.

Parameters:
order - the order of the converger
pSolver - The solver to use, or null to generate one locally
Method Detail

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 variable
pDerivatives - the value of the variable's derivatives
pReferenceTime - the reference time at which the values were valid

set

public void set(Vector3dVariable pVariable)
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 variable
v2 - the ending variable
alpha - the interpolation parameter
newReferenceTime - 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 - a Vector3d 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 interface SolverTarget
Parameters:
values - the values at which to evaluate the rates of change
time - the time at which to evaluate the rates of change
results - an array to hold the calculated rates

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium