geExtBox

Description: Axial aligned bounding box (extent box) support

Source file: …\genesis3d\OpenSource\Source\Math\ExtBox.h

Contents:

Functions: ContainsPoint, ExtendToEnclose, GetScaling, GetTranslation, Intersection , IsValid, LinearSweep, RayCollision, Scale, Set, SetToPoint, SetScaling, SetTranslation, Translate, Union

 Types: geExtBox

Additions in Genesis3D v1.6: None

Types:

geExtBox;

geExtBox represents and axially aligned extents box.
typedef struct geExtBox {
   geVec3d Min;
   geVec3d Max;
} geExtBox;
Return to Contents

Functions:

geBoolean GENESISCC geExtBox_ContainsPoint(const geExtBox* B, const geVec3d * Point);

This function tests whether the point Point is contained by the extents box B.
Returns: GE_TRUE if Point is contained by B, GE_FALSE otherwise.
Return to Contents

void GENESISCC geExtBox_ExtendToEnclose(geExtBox* B, const geVec3d* Point );

This function extends the extents box B so as to enclose the point Point.
Returns: nothing.
Notes:
    from EXTBOX.H: Extend a box to encompass the passed point.
Return to Contents

void GENESISCC geExtBox_GetScaling(const geExtBox* B, geVec3d* pScale);

This function returns the width, height and depth of the extent box B in the vector pScale.
Returns: nothing.
Return to Contents


void GENESISCC geExtBox_GetTranslation(const geExtBox* B, geVec3d* pCenter);

This function returns the coordinates of the center of extent box B in the vector pCenter (I think).
Returns: nothing.
Return to Contents

geBoolean GENESISCC geExtBox_Intersection (const geExtBox* B1, const geExtBox* B2, geExtBox* Result);

This function returns the extent box Result which results from the intersection of the extent boxes B1 and B2.  If there is no intersection then the function returns GE_FALSE and does not alter Result.
Returns: GE_TRUE if B1 and B2 have an intersection, GE_FALSE otherwise.
Notes:
    from EXTBOX.H: Return result of box intersection. If no intersection, returns GE_FALSE and bResult is not modified. If intersection, returns GE_TRUE and fills bResult (if not NULL) with the intersected box, bResult may be one of b1 or b2.
Return to Contents

geBoolean GENESISCC geExtBox_IsValid(const geExtBox* B);

This function checks that B is a valid extents box.
Returns: GE_TRUE if B is valid, GE_FALSE otherwise.
Notes:
    from EXTBOX.H: Test a box for validity ( non NULL and max = min )
Return to Contents

void GENESISCC geExtBox_LinearSweep(const geExtBox* BoxToSweep, const geVec3d* StartPoint, const geVec3d* EndPoint, geExtBox* EnclosingBox);

This function creates an extents box that encompasses BoxToSweep along the linear path from StartPoint to EndPoint and returns it in EnclosingBox.
Returns: nothing.
Notes:
    from EXTBOX.H: Creates a box that encloses the entire area of a box that moves along linear path
Return to Contents

geBoolean GENESISCC geExtBox_RayCollision(const geExtBox* B, const geVec3d* Start, const geVec3d* End, geFloat* T, geVec3d* Normal);

This function computes the intersection of the ray defined by Start and End with the extents box B, returning the collision point T and the normal of the extents box at T Normal.
Returns: GE_TRUE if an interesection exists, GE_FALSE otherwise.
Notes:
    from EXTBOX.H: Collides a ray with box B.  The ray is directed, from Start to End.  Only returns a ray hitting the outside of the box.  On success, GE_TRUE is returned, and if T is non-NULL, T is returned as 0..1 where 0 is a collision at Start, and 1 is a collision at End. If Normal is non-NULL, Normal is the surface normal of the box where the collision occured.
Return to Contents

void GENESISCC geExtBox_Scale(geExtBox* B, geFloat DX, geFloat DY, geFloat DZ);

This function scales the extents box B about its center by (DX, DY, DZ).
Returns: nothing.
Return to Contents

void GENESISCC geExtBox_Set(geExtBox* B, geFloat X1, geFloat Y1, geFloat Z1, geFloat X2, geFloat Y2, geFloat Z2);

This function sets the elements of the extents box B.
Returns: nothing.
Notes:
    from EXTBOX.H: Set the values in a box.
Return to Contents

void GENESISCC geExtBox_SetToPoint(geExtBox* B, const geVec3d* Point);

This function sets both the Min and Max of the extents box B to Point.
Returns: nothing.
Notes:
    from EXTBOX.H: Set box Min and Max to the passed point.
Return to Contents

void GENESISCC geExtBox_SetScaling(geExtBox* B, const geVec3d* pScale);

This function sets the scaling of the set box B to the vector pScale.  This differs from geExtBox_Scale in that geExtBox_Scale is relative to its original scale whereas geExtBox_SetScaling simply utilizes the center point and sets Min and Max up so that the scaling equals pScale.
Returns: nothing.
Return to Contents

void GENESISCC geExtBox_SetTranslation(geExtBox* B, const geVec3d* pCenter );

This function moves the extents box B so that it is centered at pCenter.
Returns: nothing.
Return to Contents

void GENESISCC geExtBox_Translate(geExtBox* B, geFloat DX, geFloat DY, geFloat DZ );

This function moves the extent box B by (DX,DY,DZ).  This is relative movement in comparison to SetTranslation's absolute.
Returns: nothing.
Return to Contents

void GENESISCC geExtBox_Union(const geExtBox* B1, const geExtBox* B2, geExtBox* Result);

This function computes the union of extent boxes B1 and B2 returning the result in Result.  The union of 2 extent boxes is the extent box that minimally contains both.
Returns: nothing.
Notes:
    from EXTBOX.H: computes union of b1 and b2 and returns in bResult.
Return to Contents