com.jme3.bounding
クラス BoundingBox

java.lang.Object
  上位を拡張 com.jme3.bounding.BoundingVolume
      上位を拡張 com.jme3.bounding.BoundingBox
すべての実装されたインタフェース:
Collidable, Savable, java.lang.Cloneable

public class BoundingBox
extends BoundingVolume

BoundingBox defines an axis-aligned cube that defines a container for a group of vertices of a particular piece of geometry. This box defines a center and extents from that center along the x, y and z axis.

A typical usage is to allow the class define the center and radius by calling either containAABB or averagePoints. A call to computeFramePoint in turn calls containAABB.


入れ子のクラスの概要
 
クラス com.jme3.bounding.BoundingVolume から継承された入れ子のクラス/インタフェース
BoundingVolume.Type
 
コンストラクタの概要
BoundingBox()
          Default constructor instantiates a new BoundingBox object.
BoundingBox(BoundingBox source)
           
BoundingBox(Vector3f c, float x, float y, float z)
          Contstructor instantiates a new BoundingBox object with given specs.
BoundingBox(Vector3f min, Vector3f max)
           
 
メソッドの概要
static void checkMinMax(Vector3f min, Vector3f max, Vector3f point)
           
 BoundingVolume clone(BoundingVolume store)
          clone creates a new BoundingBox object containing the same data as this one.
 int collideWith(Collidable other, CollisionResults results)
          Check collision with another Collidable.
 void computeFromPoints(java.nio.FloatBuffer points)
          computeFromPoints creates a new Bounding Box from a given set of points.
 void computeFromTris(int[] indices, Mesh mesh, int start, int end)
           
 void computeFromTris(Triangle[] tris, int start, int end)
          computeFromTris creates a new Bounding Box from a given set of triangles.
 void containAABB(java.nio.FloatBuffer points)
          containAABB creates a minimum-volume axis-aligned bounding box of the points, then selects the smallest enclosing sphere of the box with the sphere centered at the boxes center.
 boolean contains(Vector3f point)
          determines if a given point is contained within this bounding volume.
 float distanceToEdge(Vector3f point)
          Find the distance from the nearest edge of this Bounding Volume to the given point.
 Vector3f getExtent(Vector3f store)
          Query extent.
 Vector3f getMax(Vector3f store)
           
 Vector3f getMin(Vector3f store)
           
 BoundingVolume.Type getType()
          getType returns the type of bounding volume this is.
 float getVolume()
           
 float getXExtent()
           
 float getYExtent()
           
 float getZExtent()
           
 boolean intersects(BoundingVolume bv)
          intersects determines if this Bounding Box intersects with another given bounding volume.
 boolean intersects(Ray ray)
          determines if this bounding box intersects with a given ray object.
 boolean intersects(Vector3f point)
          Determines if a given point intersects (touches or is inside) this bounding volume.
 boolean intersects(Vector3f v1, Vector3f v2, Vector3f v3)
          C code ported from http://www.cs.lth.se/home/Tomas_Akenine_Moller/code/tribox3.txt
 boolean intersectsBoundingBox(BoundingBox bb)
          determines if this bounding box intersects a given bounding box.
 boolean intersectsSphere(BoundingSphere bs)
          determines if this bounding box intersects a given bounding sphere.
 BoundingVolume merge(BoundingVolume volume)
          merge combines this sphere with a second bounding sphere.
 BoundingVolume mergeLocal(BoundingVolume volume)
          mergeLocal combines this sphere with a second bounding sphere locally.
 void read(JmeImporter e)
           
 void setMinMax(Vector3f min, Vector3f max)
           
 void setXExtent(float xExtent)
           
 void setYExtent(float yExtent)
           
 void setZExtent(float zExtent)
           
 java.lang.String toString()
          toString returns the string representation of this object.
 BoundingVolume transform(Matrix4f trans, BoundingVolume store)
           
 BoundingVolume transform(Transform trans, BoundingVolume store)
          transform modifies the center of the box to reflect the change made via a rotation, translation and scale.
 Plane.Side whichSide(Plane plane)
          whichSide takes a plane (typically provided by a view frustum) to determine which side this bound is on.
 void write(JmeExporter e)
           
 
クラス com.jme3.bounding.BoundingVolume から継承されたメソッド
clone, distanceSquaredTo, distanceTo, getCenter, getCenter, getCheckPlane, setCenter, setCheckPlane, transform
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

BoundingBox

public BoundingBox()
Default constructor instantiates a new BoundingBox object.


BoundingBox

public BoundingBox(Vector3f c,
                   float x,
                   float y,
                   float z)
Contstructor instantiates a new BoundingBox object with given specs.


BoundingBox

public BoundingBox(BoundingBox source)

BoundingBox

public BoundingBox(Vector3f min,
                   Vector3f max)
メソッドの詳細

getType

public BoundingVolume.Type getType()
クラス BoundingVolume の記述:
getType returns the type of bounding volume this is.

定義:
クラス BoundingVolume 内の getType

computeFromPoints

public void computeFromPoints(java.nio.FloatBuffer points)
computeFromPoints creates a new Bounding Box from a given set of points. It uses the containAABB method as default.

定義:
クラス BoundingVolume 内の computeFromPoints
パラメータ:
points - the points to contain.

computeFromTris

public void computeFromTris(Triangle[] tris,
                            int start,
                            int end)
computeFromTris creates a new Bounding Box from a given set of triangles. It is used in OBBTree calculations.

パラメータ:
tris -
start -
end -

computeFromTris

public void computeFromTris(int[] indices,
                            Mesh mesh,
                            int start,
                            int end)

checkMinMax

public static final void checkMinMax(Vector3f min,
                                     Vector3f max,
                                     Vector3f point)

containAABB

public void containAABB(java.nio.FloatBuffer points)
containAABB creates a minimum-volume axis-aligned bounding box of the points, then selects the smallest enclosing sphere of the box with the sphere centered at the boxes center.

パラメータ:
points - the list of points.

transform

public BoundingVolume transform(Transform trans,
                                BoundingVolume store)
transform modifies the center of the box to reflect the change made via a rotation, translation and scale.

定義:
クラス BoundingVolume 内の transform
パラメータ:
trans - the transform to apply
store - box to store result in
戻り値:
the new bounding volume.

transform

public BoundingVolume transform(Matrix4f trans,
                                BoundingVolume store)
定義:
クラス BoundingVolume 内の transform

whichSide

public Plane.Side whichSide(Plane plane)
whichSide takes a plane (typically provided by a view frustum) to determine which side this bound is on.

定義:
クラス BoundingVolume 内の whichSide
パラメータ:
plane - the plane to check against.
戻り値:
the side on which this bounding volume lies.

merge

public BoundingVolume merge(BoundingVolume volume)
merge combines this sphere with a second bounding sphere. This new sphere contains both bounding spheres and is returned.

定義:
クラス BoundingVolume 内の merge
パラメータ:
volume - the sphere to combine with this sphere.
戻り値:
the new sphere

mergeLocal

public BoundingVolume mergeLocal(BoundingVolume volume)
mergeLocal combines this sphere with a second bounding sphere locally. Altering this sphere to contain both the original and the additional sphere volumes;

定義:
クラス BoundingVolume 内の mergeLocal
パラメータ:
volume - the sphere to combine with this sphere.
戻り値:
this

clone

public BoundingVolume clone(BoundingVolume store)
clone creates a new BoundingBox object containing the same data as this one.

定義:
クラス BoundingVolume 内の clone
パラメータ:
store - where to store the cloned information. if null or wrong class, a new store is created.
戻り値:
the new BoundingBox

toString

public java.lang.String toString()
toString returns the string representation of this object. The form is: "Radius: RRR.SSSS Center: ".

オーバーライド:
クラス java.lang.Object 内の toString
戻り値:
the string representation of this.

intersects

public boolean intersects(BoundingVolume bv)
intersects determines if this Bounding Box intersects with another given bounding volume. If so, true is returned, otherwise, false is returned.

定義:
クラス BoundingVolume 内の intersects
パラメータ:
bv - the second volume to test against.
戻り値:
true if this volume intersects the given volume.
関連項目:
BoundingVolume.intersects(com.jme3.bounding.BoundingVolume)

intersectsSphere

public boolean intersectsSphere(BoundingSphere bs)
determines if this bounding box intersects a given bounding sphere.

定義:
クラス BoundingVolume 内の intersectsSphere
パラメータ:
bs - the bounding sphere to test against.
戻り値:
true if this volume intersects the given bounding sphere.
関連項目:
BoundingVolume.intersectsSphere(com.jme3.bounding.BoundingSphere)

intersectsBoundingBox

public boolean intersectsBoundingBox(BoundingBox bb)
determines if this bounding box intersects a given bounding box. If the two boxes intersect in any way, true is returned. Otherwise, false is returned.

定義:
クラス BoundingVolume 内の intersectsBoundingBox
パラメータ:
bb - the bounding box to test against.
戻り値:
true if this volume intersects the given bounding box.
関連項目:
BoundingVolume.intersectsBoundingBox(com.jme3.bounding.BoundingBox)

intersects

public boolean intersects(Ray ray)
determines if this bounding box intersects with a given ray object. If an intersection has occurred, true is returned, otherwise false is returned.

定義:
クラス BoundingVolume 内の intersects
パラメータ:
ray - the ray to test.
戻り値:
true if this volume is intersected by a given ray.
関連項目:
BoundingVolume.intersects(com.jme3.math.Ray)

collideWith

public int collideWith(Collidable other,
                       CollisionResults results)
インタフェース Collidable の記述:
Check collision with another Collidable.

パラメータ:
other - The object to check collision against
results - Will contain the list of CollisionResults.
戻り値:
how many collisions were found between this and other

intersects

public boolean intersects(Vector3f v1,
                          Vector3f v2,
                          Vector3f v3)
C code ported from http://www.cs.lth.se/home/Tomas_Akenine_Moller/code/tribox3.txt

パラメータ:
v1 - The first point in the triangle
v2 - The second point in the triangle
v3 - The third point in the triangle
戻り値:
True if the bounding box intersects the triangle, false otherwise.

contains

public boolean contains(Vector3f point)
クラス BoundingVolume の記述:
determines if a given point is contained within this bounding volume. If the point is on the edge of the bounding volume, this method will return false. Use intersects(Vector3f) to check for edge intersection.

定義:
クラス BoundingVolume 内の contains
パラメータ:
point - the point to check
戻り値:
true if the point lies within this bounding volume.

intersects

public boolean intersects(Vector3f point)
クラス BoundingVolume の記述:
Determines if a given point intersects (touches or is inside) this bounding volume.

定義:
クラス BoundingVolume 内の intersects
パラメータ:
point - the point to check
戻り値:
true if the point lies within this bounding volume.

distanceToEdge

public float distanceToEdge(Vector3f point)
クラス BoundingVolume の記述:
Find the distance from the nearest edge of this Bounding Volume to the given point.

定義:
クラス BoundingVolume 内の distanceToEdge
パラメータ:
point - The point to get the distance to
戻り値:
distance

getExtent

public Vector3f getExtent(Vector3f store)
Query extent.

パラメータ:
store - where extent gets stored - null to return a new vector
戻り値:
store / new vector

getXExtent

public float getXExtent()

getYExtent

public float getYExtent()

getZExtent

public float getZExtent()

setXExtent

public void setXExtent(float xExtent)

setYExtent

public void setYExtent(float yExtent)

setZExtent

public void setZExtent(float zExtent)

getMin

public Vector3f getMin(Vector3f store)

getMax

public Vector3f getMax(Vector3f store)

setMinMax

public void setMinMax(Vector3f min,
                      Vector3f max)

write

public void write(JmeExporter e)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
オーバーライド:
クラス BoundingVolume 内の write
例外:
java.io.IOException

read

public void read(JmeImporter e)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
オーバーライド:
クラス BoundingVolume 内の read
例外:
java.io.IOException

getVolume

public float getVolume()
定義:
クラス BoundingVolume 内の getVolume