Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

ExtBox.h

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  EXTBOX.H                                                                            */
00003 /*                                                                                      */
00004 /*  Author:                                                                             */
00005 /*  Description: Axial aligned bounding box (extent box) support                        */
00006 /*                                                                                      */
00007 /*  The contents of this file are subject to the Genesis3D Public License               */
00008 /*  Version 1.01 (the "License"); you may not use this file except in                   */
00009 /*  compliance with the License. You may obtain a copy of the License at                */
00010 /*  http://www.genesis3d.com                                                            */
00011 /*                                                                                      */
00012 /*  Software distributed under the License is distributed on an "AS IS"                 */
00013 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */
00014 /*  the License for the specific language governing rights and limitations              */
00015 /*  under the License.                                                                  */
00016 /*                                                                                      */
00017 /*  The Original Code is Genesis3D, released March 25, 1999.                            */
00018 /*  Genesis3D Version 1.1 released November 15, 1999                                 */
00019 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */
00020 /*                                                                                      */
00021 /****************************************************************************************/
00022 #ifndef GE_EXTBOX_H
00023 #define GE_EXTBOX_H
00024 
00025 #include "basetype.h"
00026 #include "vec3d.h"
00027 
00028 #ifdef __cplusplus
00029         extern "C" {
00030 #endif
00031 
00032 typedef struct geExtBox
00033 {
00034         geVec3d Min;
00035         geVec3d Max;
00036 } geExtBox;
00037 
00038 // Set the values in a box
00039 void GENESISCC geExtBox_Set (  geExtBox *B,
00040                                   geFloat X1,     geFloat Y1,     geFloat Z1,
00041                                   geFloat X2,     geFloat Y2,     geFloat Z2 );
00042 
00043 // Test a box for validity ( non NULL and max >= min )
00044 geBoolean GENESISCC geExtBox_IsValid(  const geExtBox *B );
00045 
00046 // Set box Min and Max to the passed point
00047 void GENESISCC geExtBox_SetToPoint ( geExtBox *B, const geVec3d *Point );
00048 
00049 // Extend a box to encompass the passed point
00050 void GENESISCC geExtBox_ExtendToEnclose( geExtBox *B, const geVec3d *Point );
00051 
00052 // Return result of box intersection.
00053 // If no intersection, returns GE_FALSE and bResult is not modified.
00054 // If intersection, returns GE_TRUE and fills bResult (if not NULL)
00055 // with the intersected box,
00056 // bResult may be one of b1 or b2.
00057 // 
00058 geBoolean GENESISCC geExtBox_Intersection ( const geExtBox *B1, const geExtBox *B2, geExtBox *Result    );
00059 
00060 // computes union of b1 and b2 and returns in bResult.
00061 void GENESISCC geExtBox_Union ( const geExtBox *B1, const geExtBox *B2, geExtBox *Result );
00062 
00063 geBoolean GENESISCC geExtBox_ContainsPoint ( const geExtBox *B, const geVec3d  *Point );
00064 
00065 void GENESISCC geExtBox_GetTranslation ( const geExtBox *B,       geVec3d *pCenter );
00066 void GENESISCC geExtBox_SetTranslation (       geExtBox *B, const geVec3d *pCenter );
00067 void GENESISCC geExtBox_Translate      (       geExtBox *B, geFloat DX, geFloat DY, geFloat DZ );
00068 
00069 void GENESISCC geExtBox_GetScaling     ( const geExtBox *B,       geVec3d *pScale );
00070 void GENESISCC geExtBox_SetScaling     (       geExtBox *B, const geVec3d *pScale );
00071 void GENESISCC geExtBox_Scale          (       geExtBox *B, geFloat DX, geFloat DY,geFloat DZ );
00072 
00073 //  Creates a box that encloses the entire area of a box that moves along linear path
00074 void GENESISCC geExtBox_LinearSweep(    const geExtBox *BoxToSweep, 
00075                                                 const geVec3d *StartPoint, 
00076                                                 const geVec3d *EndPoint, 
00077                                                 geExtBox *EnclosingBox );
00078 
00079 // Collides a ray with box B.  The ray is directed, from Start to End.  
00080 //   Only returns a ray hitting the outside of the box.  
00081 //     on success, GE_TRUE is returned, and 
00082 //       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
00083 //       if Normal is non-NULL, Normal is the surface normal of the box where the collision occured.
00084 geBoolean GENESISCC geExtBox_RayCollision( const geExtBox *B, const geVec3d *Start, const geVec3d *End, 
00085                                                                 geFloat *T, geVec3d *Normal );
00086 
00087 #ifdef __cplusplus
00088         }
00089 #endif
00090 
00091 
00092 
00093 #endif
00094 

Generated on Tue Sep 30 12:35:43 2003 for GTestAndEngine by doxygen 1.3.2