Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzu_bounding_volume.h File Reference

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

Data Structures

struct  KzuTransformedBoundingVolume
 Bounding volume in world coordinates. More...
 

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...
 

Enumerations

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

Functions

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...
 
kzsError kzuBoundingVolumeDelete (struct KzuBoundingVolume *boundingVolume)
 Deletes a bounding volume. More...
 
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...
 
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...
 
void kzuBoundingVolumeSetVolume (struct KzuBoundingVolume *boundingVolume, const struct KzcVolume *volume)
 Sets bounding volume from volume. More...
 
struct
KzuBoundingVolumeAxisAlignedBox
kzuBoundingVolumeGetAxisAlignedBox (struct KzuBoundingVolume *boundingVolume)
 Gets axis aligned box from bounding volume. More...
 
struct KzuBoundingVolumeSpherekzuBoundingVolumeGetSphere (struct KzuBoundingVolume *boundingVolume)
 Gets sphere from bounding volume. More...
 
struct KzcVector3 kzuBoundingVolumeAxisAlignedBoxGetMinimumCorner (const struct KzuBoundingVolumeAxisAlignedBox *boundingVolume)
 Gets minimum corner from axis aligned box. More...
 
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-2019 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.

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

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.

kzsError kzuBoundingVolumeDelete ( struct KzuBoundingVolume boundingVolume)

Deletes a bounding volume.

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.

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.

void kzuBoundingVolumeSetVolume ( struct KzuBoundingVolume boundingVolume,
const struct KzcVolume volume 
)

Sets bounding volume from volume.

struct KzuBoundingVolumeAxisAlignedBox* kzuBoundingVolumeGetAxisAlignedBox ( struct KzuBoundingVolume boundingVolume)

Gets axis aligned box from bounding volume.

struct KzuBoundingVolumeSphere* kzuBoundingVolumeGetSphere ( struct KzuBoundingVolume boundingVolume)

Gets sphere from bounding volume.

struct KzcVector3 kzuBoundingVolumeAxisAlignedBoxGetMinimumCorner ( const struct KzuBoundingVolumeAxisAlignedBox boundingVolume)

Gets minimum corner from axis aligned box.

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.