org.ogre4j
Class Vector3

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.Vector3
All Implemented Interfaces:
IVector3, INativeObject

public class Vector3
extends NativeObject
implements IVector3


Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  Vector3()
           
  Vector3(float fX, float fY, float fZ)
           
  Vector3(FloatPointer r)
           
  Vector3(InstancePointer p)
          This constructor is public for internal useage only!
protected Vector3(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  Vector3(int afCoordinate)
           
  Vector3(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 float absDotProduct(IVector3 vec)
          Calculates the absolute dot (scalar) product of this vector with another.
 void angleBetween(IRadian returnValue, IVector3 dest)
          Gets the angle between 2 vectors.
 void crossProduct(IVector3 returnValue, IVector3 rkVector)
          Calculates the cross-product of 2 vectors, i.e. the vector that lies perpendicular to them both.
 void delete()
          Deletes the corresponding C++ object.
 boolean directionEquals(IVector3 rhs, IRadian tolerance)
          Returns whether this vector is within a directional tolerance of another vector.
 float distance(IVector3 rhs)
          Returns the distance to another vector.
 float dotProduct(IVector3 vec)
          Calculates the dot (scalar) product of this vector with another.
 void finalize()
           
static IVector3 getNEGATIVE_UNIT_X()
           
static IVector3 getNEGATIVE_UNIT_Y()
           
static IVector3 getNEGATIVE_UNIT_Z()
           
 void getRotationTo(IQuaternion returnValue, IVector3 dest, IVector3 fallbackAxis)
          Gets the shortest arc quaternion to rotate this vector to the destination vector.
static IVector3 getUNIT_SCALE()
           
static IVector3 getUNIT_X()
           
static IVector3 getUNIT_Y()
           
static IVector3 getUNIT_Z()
           
 float getx()
           
 float gety()
           
 float getz()
           
static IVector3 getZERO()
           
 boolean isZeroLength()
          Returns true if this vector is zero length.
 float length()
          Returns the length (magnitude) of the vector.
 void makeCeil(IVector3 cmp)
          Sets this vector's components to the maximum of its own and the ones of the passed in vector.
 void makeFloor(IVector3 cmp)
          Sets this vector's components to the minimum of its own and the ones of the passed in vector.
 void midPoint(IVector3 returnValue, IVector3 vec)
          Returns a vector at a point half way between this and the passed in vector.
 float normalise()
          Normalises the vector.
 void normalisedCopy(IVector3 returnValue)
          As normalise, except that this vector is unaffected and the normalised vector is returned as a copy.
 IVector3 operatorAddition()
           
 void operatorAddition(IVector3 returnValue, IVector3 rkVector)
           
 IVector3 operatorAssignment(float fScaler)
           
 IVector3 operatorAssignment(IVector3 rkVector)
          Assigns the value of the other vector.
 IVector3 operatorDecrementAndAssign(float fScalar)
           
 IVector3 operatorDecrementAndAssign(IVector3 rkVector)
           
 IVector3 operatorDivideAndAssign(float fScalar)
           
 IVector3 operatorDivideAndAssign(IVector3 rkVector)
           
 void operatorDivision(IVector3 returnValue, float fScalar)
           
 void operatorDivision(IVector3 returnValue, IVector3 rhs)
           
 boolean operatorEqual(IVector3 rkVector)
           
 boolean operatorGreaterThan(IVector3 rhs)
          Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.
 IVector3 operatorIncrementAndAssign(float fScalar)
           
 IVector3 operatorIncrementAndAssign(IVector3 rkVector)
           
 float operatorIndex_const(int i)
           
 FloatPointer operatorIndex(int i)
           
 boolean operatorLessThan(IVector3 rhs)
          Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.
 void operatorMultiplication(IVector3 returnValue, float fScalar)
           
 void operatorMultiplication(IVector3 returnValue, IVector3 rhs)
           
 IVector3 operatorMultiplyAndAssign(float fScalar)
           
 IVector3 operatorMultiplyAndAssign(IVector3 rkVector)
           
 boolean operatorNotEqual(IVector3 rkVector)
           
 void operatorSubtraction(IVector3 returnValue)
           
 void operatorSubtraction(IVector3 returnValue, IVector3 rkVector)
           
 void perpendicular(IVector3 returnValue)
          Generates a vector perpendicular to this vector (eg an 'up' vector).
 boolean positionCloses(IVector3 rhs, float tolerance)
          Returns whether this vector is within a positional tolerance of another vector, also take scale of the vectors into account.
 boolean positionEquals(IVector3 rhs, float tolerance)
          Returns whether this vector is within a positional tolerance of another vector.
 FloatPointer ptr_const()
           
 FloatPointer ptr()
           
 void randomDeviant(IVector3 returnValue, IRadian angle, IVector3 up)
          Generates a new random vector which deviates from this vector by a given angle in a random direction.
 void reflect(IVector3 returnValue, IVector3 normal)
          Calculates a reflection vector to the plane with the given normal .
 void setx(float _jni_value_)
           
 void sety(float _jni_value_)
           
 void setz(float _jni_value_)
           
 float squaredDistance(IVector3 rhs)
          Returns the square of the distance to another vector.
 float squaredLength()
          Returns the square of the length(magnitude) of the vector.
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

Vector3

public Vector3(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


Vector3

protected Vector3(InstancePointer p,
                  boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


Vector3

public Vector3(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

Vector3

public Vector3()

Vector3

public Vector3(float fX,
               float fY,
               float fZ)

Vector3

public Vector3(int afCoordinate)

Vector3

public Vector3(FloatPointer r)
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

operatorIndex_const

public float operatorIndex_const(int i)
Specified by:
operatorIndex_const in interface IVector3

operatorIndex

public FloatPointer operatorIndex(int i)
Specified by:
operatorIndex in interface IVector3

ptr

public FloatPointer ptr()
Specified by:
ptr in interface IVector3

ptr_const

public FloatPointer ptr_const()
Specified by:
ptr_const in interface IVector3

operatorAssignment

public IVector3 operatorAssignment(IVector3 rkVector)
Assigns the value of the other vector.

Specified by:
operatorAssignment in interface IVector3

operatorAssignment

public IVector3 operatorAssignment(float fScaler)
Specified by:
operatorAssignment in interface IVector3

operatorEqual

public boolean operatorEqual(IVector3 rkVector)
Specified by:
operatorEqual in interface IVector3

operatorNotEqual

public boolean operatorNotEqual(IVector3 rkVector)
Specified by:
operatorNotEqual in interface IVector3

operatorAddition

public void operatorAddition(IVector3 returnValue,
                             IVector3 rkVector)
Specified by:
operatorAddition in interface IVector3

operatorSubtraction

public void operatorSubtraction(IVector3 returnValue,
                                IVector3 rkVector)
Specified by:
operatorSubtraction in interface IVector3

operatorMultiplication

public void operatorMultiplication(IVector3 returnValue,
                                   float fScalar)
Specified by:
operatorMultiplication in interface IVector3

operatorMultiplication

public void operatorMultiplication(IVector3 returnValue,
                                   IVector3 rhs)
Specified by:
operatorMultiplication in interface IVector3

operatorDivision

public void operatorDivision(IVector3 returnValue,
                             float fScalar)
Specified by:
operatorDivision in interface IVector3

operatorDivision

public void operatorDivision(IVector3 returnValue,
                             IVector3 rhs)
Specified by:
operatorDivision in interface IVector3

operatorAddition

public IVector3 operatorAddition()
Specified by:
operatorAddition in interface IVector3

operatorSubtraction

public void operatorSubtraction(IVector3 returnValue)
Specified by:
operatorSubtraction in interface IVector3

operatorIncrementAndAssign

public IVector3 operatorIncrementAndAssign(IVector3 rkVector)
Specified by:
operatorIncrementAndAssign in interface IVector3

operatorIncrementAndAssign

public IVector3 operatorIncrementAndAssign(float fScalar)
Specified by:
operatorIncrementAndAssign in interface IVector3

operatorDecrementAndAssign

public IVector3 operatorDecrementAndAssign(IVector3 rkVector)
Specified by:
operatorDecrementAndAssign in interface IVector3

operatorDecrementAndAssign

public IVector3 operatorDecrementAndAssign(float fScalar)
Specified by:
operatorDecrementAndAssign in interface IVector3

operatorMultiplyAndAssign

public IVector3 operatorMultiplyAndAssign(float fScalar)
Specified by:
operatorMultiplyAndAssign in interface IVector3

operatorMultiplyAndAssign

public IVector3 operatorMultiplyAndAssign(IVector3 rkVector)
Specified by:
operatorMultiplyAndAssign in interface IVector3

operatorDivideAndAssign

public IVector3 operatorDivideAndAssign(float fScalar)
Specified by:
operatorDivideAndAssign in interface IVector3

operatorDivideAndAssign

public IVector3 operatorDivideAndAssign(IVector3 rkVector)
Specified by:
operatorDivideAndAssign in interface IVector3

length

public float length()
Returns the length (magnitude) of the vector.

Specified by:
length in interface IVector3

squaredLength

public float squaredLength()
Returns the square of the length(magnitude) of the vector.

Specified by:
squaredLength in interface IVector3

distance

public float distance(IVector3 rhs)
Returns the distance to another vector.

Specified by:
distance in interface IVector3

squaredDistance

public float squaredDistance(IVector3 rhs)
Returns the square of the distance to another vector.

Specified by:
squaredDistance in interface IVector3

dotProduct

public float dotProduct(IVector3 vec)
Calculates the dot (scalar) product of this vector with another.

Specified by:
dotProduct in interface IVector3

absDotProduct

public float absDotProduct(IVector3 vec)
Calculates the absolute dot (scalar) product of this vector with another.

Specified by:
absDotProduct in interface IVector3

normalise

public float normalise()
Normalises the vector.

Specified by:
normalise in interface IVector3

crossProduct

public void crossProduct(IVector3 returnValue,
                         IVector3 rkVector)
Calculates the cross-product of 2 vectors, i.e. the vector that lies perpendicular to them both.

Specified by:
crossProduct in interface IVector3

midPoint

public void midPoint(IVector3 returnValue,
                     IVector3 vec)
Returns a vector at a point half way between this and the passed in vector.

Specified by:
midPoint in interface IVector3

operatorLessThan

public boolean operatorLessThan(IVector3 rhs)
Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.

Specified by:
operatorLessThan in interface IVector3

operatorGreaterThan

public boolean operatorGreaterThan(IVector3 rhs)
Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.

Specified by:
operatorGreaterThan in interface IVector3

makeFloor

public void makeFloor(IVector3 cmp)
Sets this vector's components to the minimum of its own and the ones of the passed in vector.

Specified by:
makeFloor in interface IVector3

makeCeil

public void makeCeil(IVector3 cmp)
Sets this vector's components to the maximum of its own and the ones of the passed in vector.

Specified by:
makeCeil in interface IVector3

perpendicular

public void perpendicular(IVector3 returnValue)
Generates a vector perpendicular to this vector (eg an 'up' vector).

Specified by:
perpendicular in interface IVector3

randomDeviant

public void randomDeviant(IVector3 returnValue,
                          IRadian angle,
                          IVector3 up)
Generates a new random vector which deviates from this vector by a given angle in a random direction.

Specified by:
randomDeviant in interface IVector3

angleBetween

public void angleBetween(IRadian returnValue,
                         IVector3 dest)
Gets the angle between 2 vectors.

Specified by:
angleBetween in interface IVector3

getRotationTo

public void getRotationTo(IQuaternion returnValue,
                          IVector3 dest,
                          IVector3 fallbackAxis)
Gets the shortest arc quaternion to rotate this vector to the destination vector.

Specified by:
getRotationTo in interface IVector3

isZeroLength

public boolean isZeroLength()
Returns true if this vector is zero length.

Specified by:
isZeroLength in interface IVector3

normalisedCopy

public void normalisedCopy(IVector3 returnValue)
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy.

Specified by:
normalisedCopy in interface IVector3

reflect

public void reflect(IVector3 returnValue,
                    IVector3 normal)
Calculates a reflection vector to the plane with the given normal .

Specified by:
reflect in interface IVector3

positionEquals

public boolean positionEquals(IVector3 rhs,
                              float tolerance)
Returns whether this vector is within a positional tolerance of another vector.

Specified by:
positionEquals in interface IVector3

positionCloses

public boolean positionCloses(IVector3 rhs,
                              float tolerance)
Returns whether this vector is within a positional tolerance of another vector, also take scale of the vectors into account.

Specified by:
positionCloses in interface IVector3

directionEquals

public boolean directionEquals(IVector3 rhs,
                               IRadian tolerance)
Returns whether this vector is within a directional tolerance of another vector.

Specified by:
directionEquals in interface IVector3

getx

public float getx()
Specified by:
getx in interface IVector3

setx

public void setx(float _jni_value_)
Specified by:
setx in interface IVector3

gety

public float gety()
Specified by:
gety in interface IVector3

sety

public void sety(float _jni_value_)
Specified by:
sety in interface IVector3

getz

public float getz()
Specified by:
getz in interface IVector3

setz

public void setz(float _jni_value_)
Specified by:
setz in interface IVector3

getZERO

public static IVector3 getZERO()

getUNIT_X

public static IVector3 getUNIT_X()

getUNIT_Y

public static IVector3 getUNIT_Y()

getUNIT_Z

public static IVector3 getUNIT_Z()

getNEGATIVE_UNIT_X

public static IVector3 getNEGATIVE_UNIT_X()

getNEGATIVE_UNIT_Y

public static IVector3 getNEGATIVE_UNIT_Y()

getNEGATIVE_UNIT_Z

public static IVector3 getNEGATIVE_UNIT_Z()

getUNIT_SCALE

public static IVector3 getUNIT_SCALE()


Copyright © 2007 netAllied GmbH. All Rights Reserved.