class BoundingBox

A boundingbox encloses the object's surface. More...

Definition#include <raytracer/boundingbox.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Private Methods

Private Members


Detailed Description

A boundingbox encloses the object's surface. The whole surface is inside the box between boxmin and boxmax. Each finit object should have a boundingbox to allow creation of a BB hirarchy. Boundingboxes are in upper-level space and always axes-aligned.

 BoundingBox (Vector3 edgemin, Vector3 edgemax)

BoundingBox

Generates a bounding box from two edge points. All components of edgemin have to be smaller than the corresponding components of edgemax.

Vector3  getBoxMin ()

getBoxMin

[const]

Returns: Minimum edge point of the box.

Vector3  getBoxMax ()

getBoxMax

[const]

Returns: Maximum edge point of the box.

void  translate (const Vector3& v)

translate

Translate the box.

Parameters:
vtranslation Vector

void  scale (const Vector3& v)

scale

Scale the box.

Parameters:
vscaling Vector v

void  rotate (const Matrix& rotationMatrix)

rotate

Rotate the box.

Parameters:
rotationMatrixMatrix which describes the rotation

void  transformate (const Transformatable &t)

transformate

Transformate the box the same way as the given Transformatable.

Parameters:
tthe Transformatable

DBL  intersect (const Ray &r)

intersect

[const]

Intersect Box with Ray.

Parameters:
rthe Ray

Returns: -1 if no intersection, INTERSECTION_TIME_EPSILON if Ray's origin is inside the box.

DBL  intersect (const Ray &r, DBL tmax)

intersect

[const]

Intersect Box with Ray limited to maximum time.

Parameters:
rthe Ray
tmaxMaximum intersection time.

Returns: -1 if no intersection, INTERSECTION_TIME_EPSILON if Ray's origin is inside the box.

bool  isInsideAt (const Vector3& a)

isInsideAt

[const]

Test point for box insidness.

Parameters:
athe point

Returns: true if the point is inside the box else false

static HitStatistics stat

stat

[private]

Vector3 boxmin

boxmin

[private]

Vector3 boxmax

boxmax

[private]

void  updateBoundingBoxPoints (Vector3& min, Vector3& max, const Matrix& rot, Vector3 test)

updateBoundingBoxPoints

[private]

stores maximal edge