mil.navy.nps.dis
Class EulerAngle

java.lang.Object
  extended bymil.navy.nps.dis.PduElement
      extended bymil.navy.nps.dis.EulerAngle
All Implemented Interfaces:
java.lang.Cloneable, SerializationInterface

public class EulerAngle
extends PduElement

Representation of an entity's orientation.

Version:
1.0
Author:
Don McGregor (http://www.npsnet.org/~mcgredo)
Location:
Web: http://www.web3d.org/WorkingGroups/vrtp/mil/navy/nps/dis/EulerAngle.java
or locally: ~/mil/navy/nps/dis/EulerAngle.java
Hierarchy Diagram:
Summary:
Orientation of a simulated entity shall be specified by the Euler Angles Record. This record shall specify three angles which are specifed with respect to the entities coordinate system. The three angles shall be represented in radians. See the DisCoordinateSystemGimbals.wrl demo to experiment with Euler angles.
Explanation:
Describes the orientation of an object, in psi, theta, phi 32 bit floating point terms. There are a number of classes that use the same basic layout of 3 32-bit numbers (velocity, angular velocity, EntityPosition, etc.) but they're split out into separate classes in the interests of type safety fascism.

"Don't ask, don't tell" does NOT apply here. We can ask any entity about its orientation.

History:
06Mar97 /Don McGregor /New
16Apr97 /Don McGregor /PrintStream passed to printValues
12Aug97 /Don McGregor /elaborated printValues
8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
11Dec97 /Ronan Fauglas /changes access methods names from "variable()" to "getVariable()"
References:
DIS Data Dictionary :Euler Angles Record
DIS specification : IEEE 1278.1, Section 5.3.17,1.3.2
See Also:
PduElement, SerializationInterface

Field Summary
protected  float phi
          The third angle of rotation (around the local "Z" axis) in radians.
protected  float psi
          The first angle of rotation (around the local "X" axis) in radians.
 int sizeOf
          Constant value--size of an EulerAngle record when written out; here :sizeOf = 12 bytes.
protected  float theta
          The second angle of rotation (around the local "Y" axis) in radians.
 
Constructor Summary
EulerAngle()
          Constructs an new Entity Identifier, with initial values initiated to 0.
EulerAngle(float pPsi, float pTheta, float pPhi)
          Constructs an new EulerAngle Record, with variables values passed by parameters.
 
Method Summary
 java.lang.Object clone()
          Makes deep copies of all the instance variables, so we don't have two objects pointing to the same data.
 void deSerialize(java.io.DataInputStream pInputStream)
          Deserialize our data from the input stream.
 float getPhi()
           
 float getPsi()
           
 float getTheta()
           
 int length()
          Returns the length of the object when serialized in a stream.
 void printValues(int indentLevel, java.io.PrintStream printStream)
          Prints the generated serialized object for debugging.
 void serialize(java.io.DataOutputStream outputStream)
          Serialize our data out to the stream.
 void setPhi(float pPhi)
           
 void setPsi(float pPsi)
           
 void setTheta(float pTheta)
           
 void setValues(float pPsi, float pTheta, float pPhi)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

psi

protected float psi
The first angle of rotation (around the local "X" axis) in radians.


theta

protected float theta
The second angle of rotation (around the local "Y" axis) in radians.


phi

protected float phi
The third angle of rotation (around the local "Z" axis) in radians.


sizeOf

public final int sizeOf
Constant value--size of an EulerAngle record when written out; here :sizeOf = 12 bytes.

See Also:
Constant Field Values
Constructor Detail

EulerAngle

public EulerAngle()
Constructs an new Entity Identifier, with initial values initiated to 0.


EulerAngle

public EulerAngle(float pPsi,
                  float pTheta,
                  float pPhi)
Constructs an new EulerAngle Record, with variables values passed by parameters.

Parameters:
pPsi - the rotation about z by angle
pTheta - the rotation about y by angle
pPhi - the rotation about x by angle
Method Detail

clone

public java.lang.Object clone()
Description copied from class: PduElement
Makes deep copies of all the instance variables, so we don't have two objects pointing to the same data. The accessor methods make copies of the objects, rather than returning the objects themselves. The runtime provides the right object type with the call to super.clone(), and we cast it to our type. Subclasses should do the same thing, and all these ivars will be taken care of automatically.

Overrides:
clone in class PduElement
Returns:
a clone of this instance
See Also:
Object

serialize

public void serialize(java.io.DataOutputStream outputStream)
Description copied from class: PduElement
Serialize our data out to the stream. Subclasses of us should call super.Serialize() to make sure the superclasse's data is serialized out. The order in which instance variables are serialized is significant. They must be serialized in the same order they appear in the DIS spec. Prints out some information during execution if debugging flag is set.

Specified by:
serialize in interface SerializationInterface
Specified by:
serialize in class PduElement
Parameters:
outputStream - the stream to which this object is serialized

deSerialize

public void deSerialize(java.io.DataInputStream pInputStream)
Description copied from class: PduElement
Deserialize our data from the input stream. Subclasses of us should call super.deSerialize to make sure the superclass's data are properly affected. The order in which instance variables are serialized is significant. They must be deSerialized in the same order as they have been serialized as specified by the DIS spec.

Specified by:
deSerialize in interface SerializationInterface
Specified by:
deSerialize in class PduElement
Parameters:
pInputStream - the stream from which this object is initialized

length

public int length()
Description copied from class: PduElement
Returns the length of the object when serialized in a stream.

Specified by:
length in class PduElement
Returns:
the length of the object when serialized in a stream

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream)
Description copied from class: PduElement
Prints the generated serialized object for debugging.

Specified by:
printValues in class PduElement
Parameters:
indentLevel - number of spaces to indent for visibility

setValues

public void setValues(float pPsi,
                      float pTheta,
                      float pPhi)

getPsi

public float getPsi()

setPsi

public void setPsi(float pPsi)

getTheta

public float getTheta()

setTheta

public void setTheta(float pTheta)

getPhi

public float getPhi()

setPhi

public void setPhi(float pPhi)