org.ogre4j
Class Vector2

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

public class Vector2
extends NativeObject
implements IVector2


Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  Vector2()
           
  Vector2(float fX, float fY)
           
  Vector2(FloatPointer r)
           
  Vector2(InstancePointer p)
          This constructor is public for internal useage only!
protected Vector2(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  Vector2(int afCoordinate)
           
  Vector2(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 float crossProduct(IVector2 rkVector)
          Calculates the 2 dimensional cross-product of 2 vectors, which results in a single floating point value which is 2 times the area of the triangle.
 void delete()
          Deletes the corresponding C++ object.
 float dotProduct(IVector2 vec)
          Calculates the dot (scalar) product of this vector with another.
 void finalize()
           
static IVector2 getNEGATIVE_UNIT_X()
           
static IVector2 getNEGATIVE_UNIT_Y()
           
static IVector2 getUNIT_SCALE()
           
static IVector2 getUNIT_X()
           
static IVector2 getUNIT_Y()
           
 float getx()
           
 float gety()
           
static IVector2 getZERO()
           
 boolean isZeroLength()
          Returns true if this vector is zero length.
 float length()
          Returns the length (magnitude) of the vector.
 void makeCeil(IVector2 cmp)
          Sets this vector's components to the maximum of its own and the ones of the passed in vector.
 void makeFloor(IVector2 cmp)
          Sets this vector's components to the minimum of its own and the ones of the passed in vector.
 void midPoint(IVector2 returnValue, IVector2 vec)
          Returns a vector at a point half way between this and the passed in vector.
 float normalise()
          Normalises the vector.
 void normalisedCopy(IVector2 returnValue)
          As normalise, except that this vector is unaffected and the normalised vector is returned as a copy.
 IVector2 operatorAddition()
           
 void operatorAddition(IVector2 returnValue, IVector2 rkVector)
           
 IVector2 operatorAssignment(float fScalar)
           
 IVector2 operatorAssignment(IVector2 rkVector)
          Assigns the value of the other vector.
 IVector2 operatorDecrementAndAssign(float fScaler)
           
 IVector2 operatorDecrementAndAssign(IVector2 rkVector)
           
 IVector2 operatorDivideAndAssign(float fScalar)
           
 IVector2 operatorDivideAndAssign(IVector2 rkVector)
           
 void operatorDivision(IVector2 returnValue, float fScalar)
           
 void operatorDivision(IVector2 returnValue, IVector2 rhs)
           
 boolean operatorEqual(IVector2 rkVector)
           
 boolean operatorGreaterThan(IVector2 rhs)
          Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.
 IVector2 operatorIncrementAndAssign(float fScaler)
           
 IVector2 operatorIncrementAndAssign(IVector2 rkVector)
           
 float operatorIndex_const(int i)
           
 FloatPointer operatorIndex(int i)
           
 boolean operatorLessThan(IVector2 rhs)
          Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.
 void operatorMultiplication(IVector2 returnValue, float fScalar)
           
 void operatorMultiplication(IVector2 returnValue, IVector2 rhs)
           
 IVector2 operatorMultiplyAndAssign(float fScalar)
           
 IVector2 operatorMultiplyAndAssign(IVector2 rkVector)
           
 boolean operatorNotEqual(IVector2 rkVector)
           
 void operatorSubtraction(IVector2 returnValue)
           
 void operatorSubtraction(IVector2 returnValue, IVector2 rkVector)
           
 void perpendicular(IVector2 returnValue)
          Generates a vector perpendicular to this vector (eg an 'up' vector).
 FloatPointer ptr_const()
           
 FloatPointer ptr()
           
 void randomDeviant(IVector2 returnValue, float angle)
          Generates a new random vector which deviates from this vector by a given angle in a random direction.
 void reflect(IVector2 returnValue, IVector2 normal)
          Calculates a reflection vector to the plane with the given normal .
 void setx(float _jni_value_)
           
 void sety(float _jni_value_)
           
 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

Vector2

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


Vector2

protected Vector2(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.


Vector2

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

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

Vector2

public Vector2()

Vector2

public Vector2(float fX,
               float fY)

Vector2

public Vector2(int afCoordinate)

Vector2

public Vector2(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 IVector2

operatorIndex

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

ptr

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

ptr_const

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

operatorAssignment

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

Specified by:
operatorAssignment in interface IVector2

operatorAssignment

public IVector2 operatorAssignment(float fScalar)
Specified by:
operatorAssignment in interface IVector2

operatorEqual

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

operatorNotEqual

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

operatorAddition

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

operatorSubtraction

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

operatorMultiplication

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

operatorMultiplication

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

operatorDivision

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

operatorDivision

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

operatorAddition

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

operatorSubtraction

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

operatorIncrementAndAssign

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

operatorIncrementAndAssign

public IVector2 operatorIncrementAndAssign(float fScaler)
Specified by:
operatorIncrementAndAssign in interface IVector2

operatorDecrementAndAssign

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

operatorDecrementAndAssign

public IVector2 operatorDecrementAndAssign(float fScaler)
Specified by:
operatorDecrementAndAssign in interface IVector2

operatorMultiplyAndAssign

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

operatorMultiplyAndAssign

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

operatorDivideAndAssign

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

operatorDivideAndAssign

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

length

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

Specified by:
length in interface IVector2

squaredLength

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

Specified by:
squaredLength in interface IVector2

dotProduct

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

Specified by:
dotProduct in interface IVector2

normalise

public float normalise()
Normalises the vector.

Specified by:
normalise in interface IVector2

midPoint

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

Specified by:
midPoint in interface IVector2

operatorLessThan

public boolean operatorLessThan(IVector2 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 IVector2

operatorGreaterThan

public boolean operatorGreaterThan(IVector2 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 IVector2

makeFloor

public void makeFloor(IVector2 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 IVector2

makeCeil

public void makeCeil(IVector2 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 IVector2

perpendicular

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

Specified by:
perpendicular in interface IVector2

crossProduct

public float crossProduct(IVector2 rkVector)
Calculates the 2 dimensional cross-product of 2 vectors, which results in a single floating point value which is 2 times the area of the triangle.

Specified by:
crossProduct in interface IVector2

randomDeviant

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

Specified by:
randomDeviant in interface IVector2

isZeroLength

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

Specified by:
isZeroLength in interface IVector2

normalisedCopy

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

Specified by:
normalisedCopy in interface IVector2

reflect

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

Specified by:
reflect in interface IVector2

getx

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

setx

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

gety

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

sety

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

getZERO

public static IVector2 getZERO()

getUNIT_X

public static IVector2 getUNIT_X()

getUNIT_Y

public static IVector2 getUNIT_Y()

getNEGATIVE_UNIT_X

public static IVector2 getNEGATIVE_UNIT_X()

getNEGATIVE_UNIT_Y

public static IVector2 getNEGATIVE_UNIT_Y()

getUNIT_SCALE

public static IVector2 getUNIT_SCALE()


Copyright © 2007 netAllied GmbH. All Rights Reserved.