VR-Link JAVA API Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
List of all members | Public Member Functions | Static Public Attributes | Private Attributes
com.mak.vrlj.math.Vector3f Class Reference

Represents a 3D vector using three floats. More...

+ Inheritance diagram for com.mak.vrlj.math.Vector3f:
+ Collaboration diagram for com.mak.vrlj.math.Vector3f:

Public Member Functions

 Vector3f ()
 No-arg constructor. More...
 
 Vector3f (ConstVector3d other)
 Copy constructor from Vector3d. More...
 
 Vector3f (ConstVector3f other)
 Copy constructor. More...
 
 Vector3f (float x, float y, float z)
 Initializing constructor. More...
 
void add (ConstVector3f offset)
 Add another vector to this and store the result in this. More...
 
float angle (ConstVector3f other)
 Compute the angle between 2 vectors. More...
 
void assignFrom (ConstVector3d other)
 Assign new values to this vector from a Vector3d. More...
 
void assignFrom (ConstVector3f other)
 Assign new values to this vector from another. More...
 
ConstMatrix3d createFromAxisAngle (float angle)
 Build a rotation matrix from the axis specified by this vector, and an angle rotation. More...
 
ConstVector3f cross (ConstVector3f other)
 Cross product of 2 vectors. More...
 
ConstVector3f directedRotRateFromVec (double theta)
 Build a rotation rate vector. More...
 
float distance (ConstVector3f p)
 Get the distance between 2 3d points. More...
 
float dot (ConstVector3f other)
 Dot product of 2 vectors. More...
 
boolean equals (Object obj)
 
float get (int i)
 Get vector component by index number, where i=0 for x, i=1 for y and i=2 for z. More...
 
float getLength ()
 Get the scalar length of this vector. More...
 
float getX ()
 Get the x component. More...
 
float getY ()
 Get the y component. More...
 
float getZ ()
 Get the z component. More...
 
int hashCode ()
 
void multiply (float scalar)
 Multiply this vector by a scalar and store the result in this. More...
 
void normalize ()
 Adjust this vector so that the length is 1, but the direction is unchanged. More...
 
void set (int i, float v)
 Set a vector component by index number, where i=0 for x, i=1 for y and i=2 for z. More...
 
void setX (float x)
 
void setXYZ (float x, float y, float z)
 Set all vector components. More...
 
void setY (float y)
 
void setZ (float z)
 
void subtract (ConstVector3f offset)
 Subtract another vector from this and store the result in this. More...
 
String toString ()
 
ConstVector3d toVector3d ()
 

Static Public Attributes

static final ConstVector3f zero = new Vector3f(0.0f, 0.0f, 0.0f)
 A vector with all components 0. More...
 
static final ConstVector3f unitX = new Vector3f(1.0f, 0.0f, 0.0f)
 A unit vector along the x axis. More...
 
static final ConstVector3f unitY = new Vector3f(0.0f, 1.0f, 0.0f)
 A unit vector along the y axis. More...
 
static final ConstVector3f unitZ = new Vector3f(0.0f, 0.0f, 1.0f)
 A unit vector along the z axis. More...
 

Private Attributes

float myX
 
float myY
 
float myZ
 

Detailed Description

Represents a 3D vector using three floats.

Constructor & Destructor Documentation

com.mak.vrlj.math.Vector3f.Vector3f ( )
inline
com.mak.vrlj.math.Vector3f.Vector3f ( ConstVector3d  other)
inline
com.mak.vrlj.math.Vector3f.Vector3f ( ConstVector3f  other)
inline

Copy constructor.

Parameters
othersource for copy.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, and com.mak.vrlj.math.Vector3f.myZ.

com.mak.vrlj.math.Vector3f.Vector3f ( float  x,
float  y,
float  z 
)
inline

Initializing constructor.

Parameters
xcomponent.
ycomponent.
zcomponent.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, and com.mak.vrlj.math.Vector3f.myZ.

Member Function Documentation

void com.mak.vrlj.math.Vector3f.add ( ConstVector3f  offset)
inline

Add another vector to this and store the result in this.

Parameters
offsetthe value to add to this vector.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, and com.mak.vrlj.math.Vector3f.myZ.

float com.mak.vrlj.math.Vector3f.angle ( ConstVector3f  other)
inlinevirtual

Compute the angle between 2 vectors.

Parameters
othervector.
Returns
the angle between the vectors, in radians.

Implements com.mak.vrlj.math.ConstVector3f.

References com.mak.vrlj.math.Vector3f.dot(), and com.mak.vrlj.math.Vector3f.getLength().

void com.mak.vrlj.math.Vector3f.assignFrom ( ConstVector3d  other)
inline
void com.mak.vrlj.math.Vector3f.assignFrom ( ConstVector3f  other)
inline
ConstMatrix3d com.mak.vrlj.math.Vector3f.createFromAxisAngle ( float  angle)
inlinevirtual

Build a rotation matrix from the axis specified by this vector, and an angle rotation.

Parameters
angleAngle in radians to rotate counter-clockwise (looking in the direction of the given axis).
Returns
a new matrix instance.

Implements com.mak.vrlj.math.ConstVector3f.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, com.mak.vrlj.math.Vector3f.myZ, and com.mak.vrlj.math.Vector3f.normalize().

ConstVector3f com.mak.vrlj.math.Vector3f.cross ( ConstVector3f  other)
inlinevirtual
ConstVector3f com.mak.vrlj.math.Vector3f.directedRotRateFromVec ( double  theta)
inlinevirtual

Build a rotation rate vector.

Parameters
thetarotation rate
Returns
the rotation rate vector.

Implements com.mak.vrlj.math.ConstVector3f.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, com.mak.vrlj.math.Vector3f.myZ, and com.mak.vrlj.math.Vector3f.Vector3f().

float com.mak.vrlj.math.Vector3f.distance ( ConstVector3f  other)
inlinevirtual

Get the distance between 2 3d points.

Parameters
otherthe other position for the difference.
Returns
the scalar distance between 2 3d points.

Implements com.mak.vrlj.math.ConstVector3f.

References com.mak.vrlj.math.Vector3f.getX(), com.mak.vrlj.math.Vector3f.getY(), and com.mak.vrlj.math.Vector3f.getZ().

float com.mak.vrlj.math.Vector3f.dot ( ConstVector3f  other)
inlinevirtual
boolean com.mak.vrlj.math.Vector3f.equals ( Object  obj)
inline
float com.mak.vrlj.math.Vector3f.get ( int  i)
inlinevirtual

Get vector component by index number, where i=0 for x, i=1 for y and i=2 for z.

Parameters
iindex of which vector component to set.
Returns
the value of the indexed component.

Implements com.mak.vrlj.math.ConstVector3f.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, and com.mak.vrlj.math.Vector3f.myZ.

Referenced by com.mak.vrlj.coord.Smoother.initSmootherParams().

float com.mak.vrlj.math.Vector3f.getLength ( )
inlinevirtual

Get the scalar length of this vector.

Returns
the scalar length of this vector.

Implements com.mak.vrlj.math.ConstVector3f.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, and com.mak.vrlj.math.Vector3f.myZ.

Referenced by com.mak.vrlj.math.Vector3f.angle(), and com.mak.vrlj.math.Vector3f.normalize().

float com.mak.vrlj.math.Vector3f.getX ( )
inlinevirtual
float com.mak.vrlj.math.Vector3f.getY ( )
inlinevirtual
float com.mak.vrlj.math.Vector3f.getZ ( )
inlinevirtual
int com.mak.vrlj.math.Vector3f.hashCode ( )
inline
void com.mak.vrlj.math.Vector3f.multiply ( float  scalar)
inline

Multiply this vector by a scalar and store the result in this.

Parameters
scalarthe value to add to this vector.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, and com.mak.vrlj.math.Vector3f.myZ.

void com.mak.vrlj.math.Vector3f.normalize ( )
inline
void com.mak.vrlj.math.Vector3f.set ( int  i,
float  v 
)
inline

Set a vector component by index number, where i=0 for x, i=1 for y and i=2 for z.

Parameters
iindex of which vector component to set.
vthe new value for the indexed component.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, and com.mak.vrlj.math.Vector3f.myZ.

void com.mak.vrlj.math.Vector3f.setX ( float  x)
inline
Parameters
xnew value for x component.

References com.mak.vrlj.math.Vector3f.myX.

Referenced by com.mak.vrlj.math.Vector3f.assignFrom().

void com.mak.vrlj.math.Vector3f.setXYZ ( float  x,
float  y,
float  z 
)
inline

Set all vector components.

Parameters
xnew value for x component.
ynew value for y component.
znew value for z component.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, and com.mak.vrlj.math.Vector3f.myZ.

void com.mak.vrlj.math.Vector3f.setY ( float  y)
inline
Parameters
ynew value for y component.

References com.mak.vrlj.math.Vector3f.myY.

Referenced by com.mak.vrlj.math.Vector3f.assignFrom().

void com.mak.vrlj.math.Vector3f.setZ ( float  z)
inline
Parameters
znew value for z component.

References com.mak.vrlj.math.Vector3f.myZ.

Referenced by com.mak.vrlj.math.Vector3f.assignFrom().

void com.mak.vrlj.math.Vector3f.subtract ( ConstVector3f  offset)
inline

Subtract another vector from this and store the result in this.

Parameters
offsetthe value to subtract from this vector.

References com.mak.vrlj.math.Vector3f.myX, com.mak.vrlj.math.Vector3f.myY, and com.mak.vrlj.math.Vector3f.myZ.

String com.mak.vrlj.math.Vector3f.toString ( )
inline
ConstVector3d com.mak.vrlj.math.Vector3f.toVector3d ( )
inlinevirtual
Returns
a Vector3d equal to this vector.

Implements com.mak.vrlj.math.ConstVector3f.

Member Data Documentation

float com.mak.vrlj.math.Vector3f.myX
private
float com.mak.vrlj.math.Vector3f.myY
private
float com.mak.vrlj.math.Vector3f.myZ
private
final ConstVector3f com.mak.vrlj.math.Vector3f.unitX = new Vector3f(1.0f, 0.0f, 0.0f)
static

A unit vector along the x axis.

final ConstVector3f com.mak.vrlj.math.Vector3f.unitY = new Vector3f(0.0f, 1.0f, 0.0f)
static

A unit vector along the y axis.

final ConstVector3f com.mak.vrlj.math.Vector3f.unitZ = new Vector3f(0.0f, 0.0f, 1.0f)
static

A unit vector along the z axis.

final ConstVector3f com.mak.vrlj.math.Vector3f.zero = new Vector3f(0.0f, 0.0f, 0.0f)
static

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Sep 19 02:12:35 EDT 2024 from SVN revision 269601
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)