Stored as minimum and maximum extent corners. Alternate representation would be center and dimensions. May be empty or nonempty. For nonempty bounds, minimum <= maximum has to hold for all axes. Empty bounds have to be represented as minimum = PX_MAX_BOUNDS_EXTENTS and maximum = -PX_MAX_BOUNDS_EXTENTS for all axes. All other representations are invalid and the behavior is undefined.
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxBounds3arrayGet(long baseAddress, int index) booleanindicates if these bounds contain v.static PxBounds3createAt(long address) static PxBounds3static <T> PxBounds3createAt(T allocator, NativeObject.Allocator<T> allocate) static <T> PxBounds3createAt(T allocator, NativeObject.Allocator<T> allocate, PxVec3 minimum, PxVec3 maximum) voiddestroy()voidfattenFast(float distance) fattens the AABB in all 3 dimensions by the given distance.voidfattenSafe(float distance) fattens the AABB in all 3 dimensions by the given distance.returns the center of this axis aligned box.returns the dimensions (width/height/depth) of this axis aligned box.returns the extents, which are half of the width/height/depth.voidexpands the volume to include v \param v Point to expand to.booleanindicates whether the intersection of this and b is empty or not.booleanintersects1D(PxBounds3 b, int axis) computes the 1D-intersection between two AABBs, on a given axis.booleanisEmpty()booleanisFinite()checks that the AABB values are not NaNbooleanchecks a box is inside another box.booleanisValid()checks that the AABB values describe a valid configuration.voidscaleFast(float scale) scales the AABB.voidscaleSafe(float scale) scales the AABB.voidsetEmpty()Sets empty to truevoidSets the bounds to maximum size [-PX_MAX_BOUNDS_EXTENTS, PX_MAX_BOUNDS_EXTENTS].voidsetMaximum(PxVec3 value) voidsetMinimum(PxVec3 value) static PxBounds3wrapPointer(long address) Methods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxBounds3
protected PxBounds3(long address) -
PxBounds3
public PxBounds3()Default constructor, not performing any initialization for performance reason. \remark Use empty() function below to construct empty bounds. -
PxBounds3
Construct from two bounding points
-
-
Method Details
-
wrapPointer
-
arrayGet
-
createAt
- Parameters:
address- Pre-allocated memory, where the object is created.- Returns:
- Stack allocated object of PxBounds3
-
createAt
- Type Parameters:
T- Allocator class, e.g. LWJGL's MemoryStack.- Parameters:
allocator- Object to use for allocation, e.g. an instance of LWJGL's MemoryStack.allocate- Method to call on allocator to obtain the target address, e.g. MemoryStack::nmalloc.- Returns:
- Stack allocated object of PxBounds3
-
createAt
-
createAt
public static <T> PxBounds3 createAt(T allocator, NativeObject.Allocator<T> allocate, PxVec3 minimum, PxVec3 maximum) - Type Parameters:
T- Allocator class, e.g. LWJGL's MemoryStack.- Parameters:
allocator- Object to use for allocation, e.g. an instance of LWJGL's MemoryStack.allocate- Method to call on allocator to obtain the target address, e.g. MemoryStack::nmalloc.minimum- WebIDL type:PxVec3[Const, Ref]maximum- WebIDL type:PxVec3[Const, Ref]- Returns:
- Stack allocated object of PxBounds3
-
destroy
public void destroy() -
getMinimum
- Returns:
- WebIDL type:
PxVec3[Value]
-
setMinimum
- Parameters:
value- WebIDL type:PxVec3[Value]
-
getMaximum
-
setMaximum
-
setEmpty
public void setEmpty()Sets empty to true -
setMaximal
public void setMaximal()Sets the bounds to maximum size [-PX_MAX_BOUNDS_EXTENTS, PX_MAX_BOUNDS_EXTENTS]. -
include
expands the volume to include v \param v Point to expand to. -
isEmpty
public boolean isEmpty()- Returns:
- WebIDL type: boolean
-
intersects
indicates whether the intersection of this and b is empty or not. \param b Bounds to test for intersection. -
intersects1D
computes the 1D-intersection between two AABBs, on a given axis. \param axis the axis (0, 1, 2) -
contains
indicates if these bounds contain v. \param v Point to test against bounds. -
isInside
checks a box is inside another box. \param box the other AABB -
getCenter
returns the center of this axis aligned box. -
getDimensions
returns the dimensions (width/height/depth) of this axis aligned box. -
getExtents
returns the extents, which are half of the width/height/depth. -
scaleSafe
public void scaleSafe(float scale) scales the AABB.This version is safe to call for empty bounds.
\param scale Factor to scale AABB by.
-
scaleFast
public void scaleFast(float scale) scales the AABB.Calling this method for empty bounds leads to undefined behavior. Use #scaleSafe() instead.
\param scale Factor to scale AABB by.
-
fattenSafe
public void fattenSafe(float distance) fattens the AABB in all 3 dimensions by the given distance.This version is safe to call for empty bounds.
-
fattenFast
public void fattenFast(float distance) fattens the AABB in all 3 dimensions by the given distance.Calling this method for empty bounds leads to undefined behavior. Use #fattenSafe() instead.
-
isFinite
public boolean isFinite()checks that the AABB values are not NaN -
isValid
public boolean isValid()checks that the AABB values describe a valid configuration.
-