kzu_bounding_volume.hpp File Reference

Bounding volume structure, that is, volume that bounds some area, typically geometry. More...

Classes

struct  KzuBoundingVolumeAxisAlignedBox
 Axis aligned bounding box, inherited from KzuBoundingVolume. More...
 
struct  KzuBoundingVolumeSphere
 Sphere volume, inherited from KzuBoundingVolume. More...
 
struct  KzuBoundingVolume
 Base structure for bounding volume. More...
 
struct  KzuTransformedBoundingVolume
 Bounding volume in world coordinates. More...
 

Namespaces

 kanzi
 

Macros

#define KZU_BOUNDING_BOX_CORNER_BACK_BOTTOM_LEFT
 Bounding box corners. More...
 
#define KZU_BOUNDING_BOX_CORNER_BACK_TOP_LEFT
 Top left. More...
 
#define KZU_BOUNDING_BOX_CORNER_BACK_TOP_RIGHT
 Top right. More...
 
#define KZU_BOUNDING_BOX_CORNER_BACK_BOTTOM_RIGHT
 Bottom right. More...
 
#define KZU_BOUNDING_BOX_CORNER_FRONT_BOTTOM_LEFT
 Bottom left. More...
 
#define KZU_BOUNDING_BOX_CORNER_FRONT_TOP_LEFT
 Top left. More...
 
#define KZU_BOUNDING_BOX_CORNER_FRONT_TOP_RIGHT
 Top right. More...
 
#define KZU_BOUNDING_BOX_CORNER_FRONT_BOTTOM_RIGHT
 Bottom right. More...
 

Typedefs

typedef kanzi::shared_ptr< KzuBoundingVolumeKzuBoundingVolumeSharedPtr
 

Enumerations

enum  KzuBoundingVolumeType { KZU_BOUNDING_VOLUME_TYPE_AXIS_ALIGNED_BOX, KZU_BOUNDING_VOLUME_TYPE_SPHERE }
 Type of bounding volume. More...
 

Functions

void kzuBoundingVolumeAssign (KzuBoundingVolume *first, const KzuBoundingVolume *second)
 
KANZI_API kzsError kzuBoundingVolumeCreate (const struct KzcMemoryManager *memoryManager, struct KzuBoundingVolume **out_boundingVolume)
 Creates an empty bounding volume. More...
 
kzsError kzuBoundingVolumeCopy (const struct KzcMemoryManager *memoryManager, const struct KzuBoundingVolume *sourceBoundingVolume, struct KzuBoundingVolume **out_targetBoundingVolume)
 Creates copy of bounding volume. More...
 
KANZI_API kzsError kzuBoundingVolumeDelete (struct KzuBoundingVolume *boundingVolume)
 Deletes a bounding volume. More...
 
KANZI_API void kzuBoundingVolumeCalculateTransformedBoundingVolume (const struct KzuBoundingVolume *boundingVolume, const struct KzcMatrix4x4 *worldTransformation, struct KzuTransformedBoundingVolume *out_transformedBoundingVolume)
 Calculates world transformed bounding volume from bounding volume and world transformation. More...
 
void kzuAxisAlignedBoundingBoxFromTransformedAABB (const struct KzcVector3 *aabbMin, const struct KzcVector3 *aabbMax, const struct KzcMatrix4x4 *transform, struct KzcVector3 *out_aabbMin, struct KzcVector3 *out_aabbMax)
 Transforms an AABB and calculates a new AABB. More...
 
void kzuTransformedBoundingVolumeCreateFromAABB (const struct KzcVector3 *aabbMin, const struct KzcVector3 *aabbMax, const struct KzcMatrix4x4 *worldTransformation, struct KzuTransformedBoundingVolume *out_transformedBoundingVolume)
 Creates a transformed bounding volume from an axis aligned bounding box. More...
 
void kzuTransformedBoundingVolumeGetAABB (const struct KzuTransformedBoundingVolume *transformedBoundingVolume, struct KzcVector3 *out_minimum, struct KzcVector3 *out_maximum)
 Gets axis-aligned bounding box values (minimum & maximum) from transformed bounding volume. More...
 
kzBool kzuTransformedBoundingVolumeIsAbovePlane (const struct KzuTransformedBoundingVolume *transformedBoundingVolume, const struct KzcPlane *plane)
 Checks if transformed bounding volume is above plane. More...
 
KANZI_API struct KzcVector3 kzuTransformedBoundingVolumeBoxGetCornerPoint (const struct KzuTransformedBoundingVolume *boundingVolume, kzUint cornerIndex)
 Gets corner point from transformed bounding box. More...
 
void kzuTransformedBoundingVolumeSetMargin (struct KzuTransformedBoundingVolume *transformedBoundingVolume, kzFloat margin)
 Sets margin to transformed bounding volume. More...
 
kzFloat kzuTransformedBoundingVolumeGetMargin (const struct KzuTransformedBoundingVolume *transformedBoundingVolume)
 Gets margin from transformed bounding volume. More...
 
KANZI_API void kzuBoundingVolumeSetVolume (struct KzuBoundingVolume *boundingVolume, const kanzi::Box &volume)
 Sets bounding volume from volume. More...
 
KANZI_API const struct KzuBoundingVolumeAxisAlignedBoxkzuBoundingVolumeGetAxisAlignedBox (const struct KzuBoundingVolume *boundingVolume)
 Gets axis aligned box from bounding volume. More...
 
const struct KzuBoundingVolumeSpherekzuBoundingVolumeGetSphere (const struct KzuBoundingVolume *boundingVolume)
 Gets sphere from bounding volume. More...
 
KANZI_API struct KzcVector3 kzuBoundingVolumeAxisAlignedBoxGetMinimumCorner (const struct KzuBoundingVolumeAxisAlignedBox *boundingVolume)
 Gets minimum corner from axis aligned box. More...
 
KANZI_API struct KzcVector3 kzuBoundingVolumeAxisAlignedBoxGetMaximumCorner (const struct KzuBoundingVolumeAxisAlignedBox *boundingVolume)
 Gets maximum corner from axis aligned box. More...
 
kzFloat kzuBoundingVolumeSphereGetRadius (const struct KzuBoundingVolumeSphere *boundingVolume)
 Gets radius of bounding volume sphere. More...
 

Detailed Description

Bounding volume structure, that is, volume that bounds some area, typically geometry.

Copyright 2008-2017 by Rightware. All rights reserved.

Macro Definition Documentation

#define KZU_BOUNDING_BOX_CORNER_BACK_BOTTOM_LEFT

Bounding box corners.

Bottom left.

#define KZU_BOUNDING_BOX_CORNER_BACK_TOP_LEFT

Top left.

#define KZU_BOUNDING_BOX_CORNER_BACK_TOP_RIGHT

Top right.

#define KZU_BOUNDING_BOX_CORNER_BACK_BOTTOM_RIGHT

Bottom right.

#define KZU_BOUNDING_BOX_CORNER_FRONT_BOTTOM_LEFT

Bottom left.

#define KZU_BOUNDING_BOX_CORNER_FRONT_TOP_LEFT

Top left.

#define KZU_BOUNDING_BOX_CORNER_FRONT_TOP_RIGHT

Top right.

#define KZU_BOUNDING_BOX_CORNER_FRONT_BOTTOM_RIGHT

Bottom right.

Typedef Documentation

typedef kanzi::shared_ptr<KzuBoundingVolume> KzuBoundingVolumeSharedPtr

Enumeration Type Documentation

Type of bounding volume.

Enumerator
KZU_BOUNDING_VOLUME_TYPE_AXIS_ALIGNED_BOX 

Axis aligned bounding box.

KZU_BOUNDING_VOLUME_TYPE_SPHERE 

Sphere bounding volume.

Function Documentation

void kzuBoundingVolumeAssign ( KzuBoundingVolume first,
const KzuBoundingVolume second 
)
KANZI_API kzsError kzuBoundingVolumeCreate ( const struct KzcMemoryManager memoryManager,
struct KzuBoundingVolume **  out_boundingVolume 
)

Creates an empty bounding volume.

kzsError kzuBoundingVolumeCopy ( const struct KzcMemoryManager memoryManager,
const struct KzuBoundingVolume sourceBoundingVolume,
struct KzuBoundingVolume **  out_targetBoundingVolume 
)

Creates copy of bounding volume.

KANZI_API kzsError kzuBoundingVolumeDelete ( struct KzuBoundingVolume boundingVolume)

Deletes a bounding volume.

KANZI_API void kzuBoundingVolumeCalculateTransformedBoundingVolume ( const struct KzuBoundingVolume boundingVolume,
const struct KzcMatrix4x4 worldTransformation,
struct KzuTransformedBoundingVolume out_transformedBoundingVolume 
)

Calculates world transformed bounding volume from bounding volume and world transformation.

void kzuAxisAlignedBoundingBoxFromTransformedAABB ( const struct KzcVector3 aabbMin,
const struct KzcVector3 aabbMax,
const struct KzcMatrix4x4 transform,
struct KzcVector3 out_aabbMin,
struct KzcVector3 out_aabbMax 
)

Transforms an AABB and calculates a new AABB.

void kzuTransformedBoundingVolumeCreateFromAABB ( const struct KzcVector3 aabbMin,
const struct KzcVector3 aabbMax,
const struct KzcMatrix4x4 worldTransformation,
struct KzuTransformedBoundingVolume out_transformedBoundingVolume 
)

Creates a transformed bounding volume from an axis aligned bounding box.

void kzuTransformedBoundingVolumeGetAABB ( const struct KzuTransformedBoundingVolume transformedBoundingVolume,
struct KzcVector3 out_minimum,
struct KzcVector3 out_maximum 
)

Gets axis-aligned bounding box values (minimum & maximum) from transformed bounding volume.

kzBool kzuTransformedBoundingVolumeIsAbovePlane ( const struct KzuTransformedBoundingVolume transformedBoundingVolume,
const struct KzcPlane plane 
)

Checks if transformed bounding volume is above plane.

Used in frustum culling.

KANZI_API struct KzcVector3 kzuTransformedBoundingVolumeBoxGetCornerPoint ( const struct KzuTransformedBoundingVolume boundingVolume,
kzUint  cornerIndex 
)

Gets corner point from transformed bounding box.

void kzuTransformedBoundingVolumeSetMargin ( struct KzuTransformedBoundingVolume transformedBoundingVolume,
kzFloat  margin 
)

Sets margin to transformed bounding volume.

kzFloat kzuTransformedBoundingVolumeGetMargin ( const struct KzuTransformedBoundingVolume transformedBoundingVolume)

Gets margin from transformed bounding volume.

KANZI_API void kzuBoundingVolumeSetVolume ( struct KzuBoundingVolume boundingVolume,
const kanzi::Box volume 
)

Sets bounding volume from volume.

KANZI_API const struct KzuBoundingVolumeAxisAlignedBox* kzuBoundingVolumeGetAxisAlignedBox ( const struct KzuBoundingVolume boundingVolume)

Gets axis aligned box from bounding volume.

const struct KzuBoundingVolumeSphere* kzuBoundingVolumeGetSphere ( const struct KzuBoundingVolume boundingVolume)

Gets sphere from bounding volume.

KANZI_API struct KzcVector3 kzuBoundingVolumeAxisAlignedBoxGetMinimumCorner ( const struct KzuBoundingVolumeAxisAlignedBox boundingVolume)

Gets minimum corner from axis aligned box.

KANZI_API struct KzcVector3 kzuBoundingVolumeAxisAlignedBoxGetMaximumCorner ( const struct KzuBoundingVolumeAxisAlignedBox boundingVolume)

Gets maximum corner from axis aligned box.

kzFloat kzuBoundingVolumeSphereGetRadius ( const struct KzuBoundingVolumeSphere boundingVolume)

Gets radius of bounding volume sphere.