|
|
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:
| v | translation Vector |
| void scale (const Vector3& v)
| scale |
Scale the box.
Parameters:
| v | scaling Vector v |
| void rotate (const Matrix& rotationMatrix)
| rotate |
Rotate the box.
Parameters:
| rotationMatrix | Matrix which describes the rotation |
| void transformate (const Transformatable &t)
| transformate |
Transformate the box the same way as the given Transformatable.
Parameters:
| t | the Transformatable |
| DBL intersect (const Ray &r)
| intersect |
[const]
Intersect Box with Ray.
Parameters:
| r | the 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:
| r | the Ray |
| tmax | Maximum 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:
| a | the 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