org.ogre4j
Class AxisAlignedBox

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

public class AxisAlignedBox
extends NativeObject
implements IAxisAlignedBox


Nested Class Summary
static class AxisAlignedBox.CornerEnum
           
static class AxisAlignedBox.Extent
           
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  AxisAlignedBox()
           
  AxisAlignedBox(AxisAlignedBox.Extent e)
           
  AxisAlignedBox(float mx, float my, float mz, float Mx, float My, float Mz)
           
  AxisAlignedBox(IAxisAlignedBox rkBox)
           
  AxisAlignedBox(InstancePointer p)
          This constructor is public for internal useage only!
protected AxisAlignedBox(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  AxisAlignedBox(IVector3 _min, IVector3 _max)
           
  AxisAlignedBox(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 boolean contains(IAxisAlignedBox other)
          Tests whether another box contained by this box.
 boolean contains(IVector3 v)
          Tests whether the given point contained by this box.
 void delete()
          Deletes the corresponding C++ object.
 void finalize()
           
 IVector3 getAllCorners()
          Returns a pointer to an array of 8 corner points, useful for collision vs. non-aligned objects.
static IAxisAlignedBox getBOX_INFINITE()
           
static IAxisAlignedBox getBOX_NULL()
           
 void getCenter(IVector3 returnValue)
           
 void getCorner(IVector3 returnValue, AxisAlignedBox.CornerEnum cornerToGet)
          gets the position of one of the corners
 void getHalfSize(IVector3 returnValue)
           
 IVector3 getMaximum_const()
           
 IVector3 getMaximum()
          Gets a modifiable version of the maximum corner of the box.
 IVector3 getMinimum_const()
           
 IVector3 getMinimum()
          Gets a modifiable version of the minimum corner of the box.
 void getSize(IVector3 returnValue)
           
 void intersection(IAxisAlignedBox returnValue, IAxisAlignedBox b2)
           
 boolean intersects(IAxisAlignedBox b2)
          Returns whether or not this box intersects another.
 boolean intersects(IPlane p)
          Tests whether this box intersects a plane.
 boolean intersects(ISphere s)
          Tests whether this box intersects a sphere.
 boolean intersects(IVector3 v)
          Tests whether the vector point is within this box.
 boolean isFinite()
          Returns true if the box is finite.
 boolean isInfinite()
          Returns true if the box is infinite.
 boolean isNull()
          Returns true if the box is null i.e. empty.
 void merge(IAxisAlignedBox rhs)
          Merges the passed in box into the current box.
 void merge(IVector3 point)
          Extends the box to encompass the specified point (if needed).
 IAxisAlignedBox operatorAssignment(IAxisAlignedBox rhs)
           
 boolean operatorEqual(IAxisAlignedBox rhs)
          Tests 2 boxes for equality.
 boolean operatorNotEqual(IAxisAlignedBox rhs)
          Tests 2 boxes for inequality.
 void scale(IVector3 s)
          Scales the AABB by the vector given.
 void setExtents(float mx, float my, float mz, float Mx, float My, float Mz)
           
 void setExtents(IVector3 _min, IVector3 _max)
          Sets both minimum and maximum extents at once.
 void setInfinite()
          Sets the box to 'infinite'
 void setMaximum(float x, float y, float z)
           
 void setMaximum(IVector3 vec)
          Sets the maximum corner of the box.
 void setMaximumX(float x)
          Changes one of the components of the maximum corner of the box used to resize only one dimension of the box
 void setMaximumY(float y)
           
 void setMaximumZ(float z)
           
 void setMinimum(float x, float y, float z)
           
 void setMinimum(IVector3 vec)
          Sets the minimum corner of the box.
 void setMinimumX(float x)
          Changes one of the components of the minimum corner of the box used to resize only one dimension of the box
 void setMinimumY(float y)
           
 void setMinimumZ(float z)
           
 void setNull()
          Sets the box to a 'null' value i.e. not a box.
 void transform(IMatrix4 matrix)
          Transforms the box according to the matrix supplied.
 void transformAffine(IMatrix4 m)
          Transforms the box according to the affine matrix supplied.
 float volume()
           
 
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

AxisAlignedBox

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


AxisAlignedBox

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


AxisAlignedBox

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

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

AxisAlignedBox

public AxisAlignedBox()

AxisAlignedBox

public AxisAlignedBox(AxisAlignedBox.Extent e)

AxisAlignedBox

public AxisAlignedBox(IAxisAlignedBox rkBox)

AxisAlignedBox

public AxisAlignedBox(IVector3 _min,
                      IVector3 _max)

AxisAlignedBox

public AxisAlignedBox(float mx,
                      float my,
                      float mz,
                      float Mx,
                      float My,
                      float Mz)
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

operatorAssignment

public IAxisAlignedBox operatorAssignment(IAxisAlignedBox rhs)
Specified by:
operatorAssignment in interface IAxisAlignedBox

getMinimum_const

public IVector3 getMinimum_const()
Specified by:
getMinimum_const in interface IAxisAlignedBox

getMinimum

public IVector3 getMinimum()
Gets a modifiable version of the minimum corner of the box.

Specified by:
getMinimum in interface IAxisAlignedBox

getMaximum_const

public IVector3 getMaximum_const()
Specified by:
getMaximum_const in interface IAxisAlignedBox

getMaximum

public IVector3 getMaximum()
Gets a modifiable version of the maximum corner of the box.

Specified by:
getMaximum in interface IAxisAlignedBox

setMinimum

public void setMinimum(IVector3 vec)
Sets the minimum corner of the box.

Specified by:
setMinimum in interface IAxisAlignedBox

setMinimum

public void setMinimum(float x,
                       float y,
                       float z)
Specified by:
setMinimum in interface IAxisAlignedBox

setMinimumX

public void setMinimumX(float x)
Changes one of the components of the minimum corner of the box used to resize only one dimension of the box

Specified by:
setMinimumX in interface IAxisAlignedBox

setMinimumY

public void setMinimumY(float y)
Specified by:
setMinimumY in interface IAxisAlignedBox

setMinimumZ

public void setMinimumZ(float z)
Specified by:
setMinimumZ in interface IAxisAlignedBox

setMaximum

public void setMaximum(IVector3 vec)
Sets the maximum corner of the box.

Specified by:
setMaximum in interface IAxisAlignedBox

setMaximum

public void setMaximum(float x,
                       float y,
                       float z)
Specified by:
setMaximum in interface IAxisAlignedBox

setMaximumX

public void setMaximumX(float x)
Changes one of the components of the maximum corner of the box used to resize only one dimension of the box

Specified by:
setMaximumX in interface IAxisAlignedBox

setMaximumY

public void setMaximumY(float y)
Specified by:
setMaximumY in interface IAxisAlignedBox

setMaximumZ

public void setMaximumZ(float z)
Specified by:
setMaximumZ in interface IAxisAlignedBox

setExtents

public void setExtents(IVector3 _min,
                       IVector3 _max)
Sets both minimum and maximum extents at once.

Specified by:
setExtents in interface IAxisAlignedBox

setExtents

public void setExtents(float mx,
                       float my,
                       float mz,
                       float Mx,
                       float My,
                       float Mz)
Specified by:
setExtents in interface IAxisAlignedBox

getAllCorners

public IVector3 getAllCorners()
Returns a pointer to an array of 8 corner points, useful for collision vs. non-aligned objects.

Specified by:
getAllCorners in interface IAxisAlignedBox

getCorner

public void getCorner(IVector3 returnValue,
                      AxisAlignedBox.CornerEnum cornerToGet)
gets the position of one of the corners

Specified by:
getCorner in interface IAxisAlignedBox

merge

public void merge(IAxisAlignedBox rhs)
Merges the passed in box into the current box. The result is the box which encompasses both.

Specified by:
merge in interface IAxisAlignedBox

merge

public void merge(IVector3 point)
Extends the box to encompass the specified point (if needed).

Specified by:
merge in interface IAxisAlignedBox

transform

public void transform(IMatrix4 matrix)
Transforms the box according to the matrix supplied.

Specified by:
transform in interface IAxisAlignedBox

transformAffine

public void transformAffine(IMatrix4 m)
Transforms the box according to the affine matrix supplied.

Specified by:
transformAffine in interface IAxisAlignedBox

setNull

public void setNull()
Sets the box to a 'null' value i.e. not a box.

Specified by:
setNull in interface IAxisAlignedBox

isNull

public boolean isNull()
Returns true if the box is null i.e. empty.

Specified by:
isNull in interface IAxisAlignedBox

isFinite

public boolean isFinite()
Returns true if the box is finite.

Specified by:
isFinite in interface IAxisAlignedBox

setInfinite

public void setInfinite()
Sets the box to 'infinite'

Specified by:
setInfinite in interface IAxisAlignedBox

isInfinite

public boolean isInfinite()
Returns true if the box is infinite.

Specified by:
isInfinite in interface IAxisAlignedBox

intersects

public boolean intersects(IAxisAlignedBox b2)
Returns whether or not this box intersects another.

Specified by:
intersects in interface IAxisAlignedBox

intersection

public void intersection(IAxisAlignedBox returnValue,
                         IAxisAlignedBox b2)
Specified by:
intersection in interface IAxisAlignedBox

volume

public float volume()
Specified by:
volume in interface IAxisAlignedBox

scale

public void scale(IVector3 s)
Scales the AABB by the vector given.

Specified by:
scale in interface IAxisAlignedBox

intersects

public boolean intersects(ISphere s)
Tests whether this box intersects a sphere.

Specified by:
intersects in interface IAxisAlignedBox

intersects

public boolean intersects(IPlane p)
Tests whether this box intersects a plane.

Specified by:
intersects in interface IAxisAlignedBox

intersects

public boolean intersects(IVector3 v)
Tests whether the vector point is within this box.

Specified by:
intersects in interface IAxisAlignedBox

getCenter

public void getCenter(IVector3 returnValue)
Specified by:
getCenter in interface IAxisAlignedBox

getSize

public void getSize(IVector3 returnValue)
Specified by:
getSize in interface IAxisAlignedBox

getHalfSize

public void getHalfSize(IVector3 returnValue)
Specified by:
getHalfSize in interface IAxisAlignedBox

contains

public boolean contains(IVector3 v)
Tests whether the given point contained by this box.

Specified by:
contains in interface IAxisAlignedBox

contains

public boolean contains(IAxisAlignedBox other)
Tests whether another box contained by this box.

Specified by:
contains in interface IAxisAlignedBox

operatorEqual

public boolean operatorEqual(IAxisAlignedBox rhs)
Tests 2 boxes for equality.

Specified by:
operatorEqual in interface IAxisAlignedBox

operatorNotEqual

public boolean operatorNotEqual(IAxisAlignedBox rhs)
Tests 2 boxes for inequality.

Specified by:
operatorNotEqual in interface IAxisAlignedBox

getBOX_NULL

public static IAxisAlignedBox getBOX_NULL()

getBOX_INFINITE

public static IAxisAlignedBox getBOX_INFINITE()


Copyright © 2007 netAllied GmbH. All Rights Reserved.