#include "smlbound.h"
SMLBoxBound is a derivative class, inherits SMLBound class. The SMLBoxBound class represents an axis aligned bounding box enclosing a set of other bounds or points. This object can be extended, transformed, checked to see if a point is inside, checked to see if a vector intersects it, and checked to see if it is outside or inside a set of culling planes.
|
|
SMLVec3f side;
Box side.
SMLVec3f min;
Corner of box with minimum values of x, y, z.
SMLVec3f max;
Corner of box with maximum values of x, y, z.
SMLVec3f corners[8];
8 corners of this box.
min, max and corners are computed by function ComputeMinMax.
[top]
SMLLIBENTRY SMLBoxBound(const SMLVec3f& center, const SMLVec3f& side);
SMLBoxBound object constructor. This constructor sets component data of the class center and side equal to input objects data center and side correspondingly.
center - reference to SMLVec3f constant object
side - reference to SMLVec3f constant object
[top]
SMLLIBENTRY SMLBoxBound (const SMLBoxBound& bound);
SMLBoxBound object copy-constructor. Makes copy of the object bound of the same class.
bound - reference to SMLBoxBound constant object.
[top]
SMLLIBENTRY SMLBoxBound();
Default SMLBoxBound object constructor. This constructor sets parameters center and side of the class equal to zero.
No.
[top]
SMLLIBENTRY virtual SMLBound* Clone();
SMLLIBENTRY virtual const SMLBound* Clone() const;
These two virtual methods create the copy of the SMLBoxBound-type object for which they are called.
No.
Methods return SMLBound-type pointer or const SMLBound-type pointer to new created object.
[top]
SMLLIBENTRY void ComputeMinMax();
Method defines variables min, max, and coordinates of corners of parallelepiped, i.e. defines component array corners. Sides of the parallelepiped are equal to 2*side.x, 2*side.y, and 2*side.z.
No.
[top]
SMLLIBENTRY virtual bool Cull(const SMLPlane* planes, int nplane) const;
Method checks if the bound lies within frustum created by specified planes.
planes - defines array of planes used for culling of current box (frustum). Box is culled if it is not intersected with intersection of all positive half-spaces defined by planes.
numPlane - number of planes.
Returns true if box is culled, false otherwise.
[top]
SMLLIBENTRY const SMLBoxBound& operator=(const SMLBoxBound& bound);
Method is an overloaded operator-function. It sets parameters of this box to be equal to those of object bound.
bound - object of SMLBoxBound type.
Returns reference to the SMLBoxBound-type object to which it nominates new box center coordinates and side.
[top]
SMLLIBENTRY virtual void around(const SMLVec3f* pts, int npoints);
Method sets parameters (center coordinates and side) of this parallelepiped to contain all the points defined by parameter pts. Minimum object with such properties is created by the method.
pts - pointer to array of constant objects of SMLVes3f type.
npoints - number of points. Variable should be a positive value.
[top]
SMLLIBENTRY virtual void around(const SMLSphereBound** spheres, int nspheres);
Method sets parameters of this parallelepiped to include all spheres specified by parameter spheres. Minimum object with such properties is created by the method.
spheres - pointer to array of constant objects of SMLSphereBound type.
nspheres - number of spheres. Variable should be a positive value or zero.
[top]
SMLLIBENTRY virtual void around(const SMLBoxBound** boxes, int nboxes);
Method sets parameters of this parallelepiped to include all the parallelepipeds specified by parameter boxes. Minimum object with such properties is created by the method.
boxes - pointer to array of constant objects of SMLSphereBound type.
nboxes - number of boxes. Variable should be a positive value or zero.
[top]
SMLLIBENTRY virtual void around(const SMLSphereBound* sphere);
Method sets parameters of this parallelepiped to include sphere. Minimum object with such properties is created by the method.
sphere - pointer to constant object of SMLSphereBound type.
[top]
SMLLIBENTRY virtual void around(const SMLBoxBound* box);
Method sets parameters of this parallelepiped to be equal to parameters of box.
box - pointer to constant object of SMLBoxBound type.
[top]
SMLLIBENTRY virtual void around(const SMLBound* bound);
Method sets parameters of this parallelepiped to include object bound.
bound - pointer to constant object of SMLBound type.
[top]
SMLLIBENTRY virtual void around(const SMLBound** bounds, int nbounds);
Method sets parameters of this parallelepiped to include all objects defined by bounds.
bounds - pointer to an array of constant objects of SMLBound type.
nbounds - number of bounds. Variable should be a positive value.
[top]
SMLLIBENTRY virtual void extendBy(const SMLVec3f& point);
Method extends parallelepiped (changes its center coordinates and side) to include given point.
point - reference to constant object of SMLVec3f type.
[top]
SMLLIBENTRY virtual void extendBy(const SMLBoxBound* box);
Method extends parallelepiped to include given box.
box - pointer to a constant object of SMLBoxBound type.
[top]
SMLLIBENTRY virtual void extendBy(const SMLSphereBound* sphere);
Method extends parallelepiped to include given sphere.
sphere - pointer to a constant object of SMLSphereBound type.
[top]
SMLLIBENTRY virtual void extendBy(const SMLBound* bound);
Method extends parallelepiped to include given bound.
bound - pointer to constant object of SMLBound type.
[top]
SMLLIBENTRY virtual bool contains(const SMLVec3f& point) const;
Method checks if the point is inside this parallelepiped.
point - reference to a constant object of SMLVec3f type.
Returns true if the point is inside the parallelepiped. Otherwise, returns false.
[top]
SMLLIBENTRY virtual bool contains(const SMLBoxBound* box) const;
Method checks if specified box is inside this parallelepiped.
box - pointer to a constant object of SMLBox Bound type.
Returns true if box is inside this parallelepiped. Otherwise, returns false.
[top]
SMLLIBENTRY virtual bool contains(const SMLSphereBound* sphere) const;
Method checks if specified sphere is inside this parallelepiped.
sphere - pointer to a constant object of SMLSphereBound type.
Returns true if the given sphere is inside this parallelepiped. Otherwise, returns false.
[top]
SMLLIBENTRY virtual bool contains(const SMLBound* bound) const;
Method checks if specified bound is inside this parallelepiped.
bound - pointer to a constant object of SMLBound type.
Returns true if bound is inside this parallelepiped. Otherwise, returns false.
[top]
SMLLIBENTRY virtual void Transform(const SMLBound* bound, const SMLMatrix4f& matrix);
Method transforms the object bound in accordance with transformation matrix and writes it into this.
bound - pointer to a constant object of SMLBound type.
matrix - transformation matrix.
[top]
SMLLIBENTRY virtual void Transform(const SMLBoxBound* src, const SMLMatrix4f& matrix)
Method transforms box in accordance with transformation matrix.
src - pointer to a constant object of SMLBoxBound type.
matrix - transformation matrix.
[top]
SMLLIBENTRY void SetSide(const SMLVec3f& vector);
Method sets side of this box to be equal to vector.
vector - new side of this box.
[top]
SMLLIBENTRY const SMLVec3f& GetSide() const;
Method returns side of this box.
No.
Returns reference to current side of this box.
[top]
virtual void copyFrom(const SMLBound& bound);
Method sets new side and coordinates of center of this box equal to those of object bound.
bound - reference to object of SMLBound type.
[top]
virtual void copySame(const SMLBoxBound* bound);
Method creates new box with side and coordinates of center equal to those of box bound.
bound - poiner to object of SMLBoxBound type.
[top]