AnyCAD Rapid API 2024
Help you to create a better world!
载入中...
搜索中...
未找到
AABox类 参考

class  CornerEnum
 
class  Extent
 

Public 成员函数

 AABox (AABox rkBox)
 
 AABox (Vector3d min, Vector3d max)
 
 AABox (double mx, double my, double mz, double Mx, double My, double Mz)
 
Vector3d getMinimum ()
 
Vector3d getMaximum ()
 
void setMinimum (Vector3d vec)
 
void setMinimum (double x, double y, double z)
 
void setMinimumX (double x)
 
void setMinimumY (double y)
 
void setMinimumZ (double z)
 
void setMaximum (Vector3d vec)
 
void setMaximum (double x, double y, double z)
 
void setMaximumX (double x)
 
void setMaximumY (double y)
 
void setMaximumZ (double z)
 
void setExtents (Vector3d min, Vector3d max)
 
void setExtents (double mx, double my, double mz, double Mx, double My, double Mz)
 
Double3List getAllCorners ()
 
Vector3d getCorner (AABox.CornerEnum cornerToGet)
 
void merge (AABox rhs)
 
void merge (Vector3d point)
 
Vector3d matPlusVec3 (Matrix4 m, Vector3d v)
 
void transform (Matrix4 matrix)
 
Double3List transformedCorners (Matrix4 matrix)
 
void setNull ()
 
boolean isNull ()
 
boolean isFinite ()
 
void setInfinite ()
 
boolean isInfinite ()
 
boolean intersects (AABox b2)
 
AABox intersection (AABox b2)
 
double volume ()
 
void scale (Vector3d s)
 
boolean intersects (Sphere s)
 
boolean intersects (Plane p)
 
boolean intersects (Vector3d v)
 
Vector3d getCenter ()
 
Vector3d getSize ()
 
Vector3d getHalfSize ()
 
boolean contains (Vector3d v)
 
double squaredDistance (Vector3d v)
 
double distance (Vector3d v)
 
boolean contains (AABox other)
 

详细描述

A 3D box aligned with the x/y/z axes.
Remarks:
This class represents a simple box which is aligned with the
axes. Internally it only stores 2 points as the extremeties of
the box, one which is the minima of all 3 axes, and the other
which is the maxima of all 3 axes. This class is typically used
for an axis-aligned bounding box (AABB) for collision and
visibility determination.

成员函数说明

◆ contains() [1/2]

boolean AABox.contains ( AABox other)

Tests whether another box contained by this box.

◆ contains() [2/2]

boolean AABox.contains ( Vector3d v)

Tests whether the given point contained by this box.

◆ distance()

double AABox.distance ( Vector3d v)

Returns the minimum distance between a given point and any part of the box.

◆ getAllCorners()

Double3List AABox.getAllCorners ( )

Returns a pointer to an array of 8 corner points, useful for
collision vs. non-aligned objects.
Remarks:
If the order of these corners is important, they are as
follows: The 4 points of the minimum Z face (note that
because Ogre uses right-handed coordinates, the minimum Z is
at the 'back' of the box) starting with the minimum point of
all, then anticlockwise around this face (if you are looking
onto the face from outside the box). Then the 4 points of the
maximum Z face, starting with maximum point of all, then
anticlockwise around this face (looking onto the face from
outside the box). Like this:


1-------2
| /|
| / |
5-------4 |
| 0----|--3
| / | /
|/ |/
6-------7

◆ getCenter()

Vector3d AABox.getCenter ( )

Gets the centre of the box

◆ getCorner()

Vector3d AABox.getCorner ( AABox.CornerEnum cornerToGet)

Gets the position of one of the corners

◆ getHalfSize()

Vector3d AABox.getHalfSize ( )

Gets the half-size of the box

◆ getMaximum()

Vector3d AABox.getMaximum ( )

Gets the maximum corner of the box.

◆ getMinimum()

Vector3d AABox.getMinimum ( )

Gets the minimum corner of the box.

◆ getSize()

Vector3d AABox.getSize ( )

Gets the size of the box

◆ intersection()

AABox AABox.intersection ( AABox b2)

Calculate the area of intersection of this box and another

◆ intersects() [1/4]

boolean AABox.intersects ( AABox b2)

Returns whether or not this box intersects another.

◆ intersects() [2/4]

boolean AABox.intersects ( Plane p)

Tests whether this box intersects a plane.

◆ intersects() [3/4]

boolean AABox.intersects ( Sphere s)

Tests whether this box intersects a sphere.

◆ intersects() [4/4]

boolean AABox.intersects ( Vector3d v)

Tests whether the vector point is within this box.

◆ isFinite()

boolean AABox.isFinite ( )

Returns true if the box is finite.

◆ isInfinite()

boolean AABox.isInfinite ( )

Returns true if the box is infinite.

◆ isNull()

boolean AABox.isNull ( )

Returns true if the box is null i.e. empty.

◆ matPlusVec3()

Vector3d AABox.matPlusVec3 ( Matrix4 m,
Vector3d v )

Transforms the box according to the matrix supplied.
Remarks:
By calling this method you get the axis-aligned box which
surrounds the transformed version of this box. Therefore each
corner of the box is transformed by the matrix, then the
extents are mapped back onto the axes to produce another
AABB. Useful when you have a local AABB for an object which
is then transformed.

◆ merge() [1/2]

void AABox.merge ( AABox rhs)

Merges the passed in box into the current box. The result is the
box which encompasses both.

◆ merge() [2/2]

void AABox.merge ( Vector3d point)

Extends the box to encompass the specified point (if needed).

◆ scale()

void AABox.scale ( Vector3d s)

Scales the AABB by the vector given.

◆ setExtents()

void AABox.setExtents ( Vector3d min,
Vector3d max )

Sets both minimum and maximum extents at once.

◆ setInfinite()

void AABox.setInfinite ( )

Sets the box to 'infinite'

◆ setMaximum()

void AABox.setMaximum ( Vector3d vec)

Sets the maximum corner of the box.

◆ setMaximumX()

void AABox.setMaximumX ( double x)

Changes one of the components of the maximum corner of the box
used to resize only one dimension of the box

◆ setMinimum()

void AABox.setMinimum ( Vector3d vec)

Sets the minimum corner of the box.

◆ setMinimumX()

void AABox.setMinimumX ( double x)

Changes one of the components of the minimum corner of the box
used to resize only one dimension of the box

◆ setNull()

void AABox.setNull ( )

Sets the box to a 'null' value i.e. not a box.

◆ squaredDistance()

double AABox.squaredDistance ( Vector3d v)

Returns the squared minimum distance between a given point and any part of the box.
This is faster than distance since avoiding a squareroot, so use if you can.

◆ transformedCorners()

Double3List AABox.transformedCorners ( Matrix4 matrix)

Get all corners which transformed by given matrix

参数
matrix

◆ volume()

double AABox.volume ( )

Calculate the volume of this box