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

TRACE.H

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  Trace.h                                                                             */
00003 /*                                                                                      */
00004 /*  Author: John Pollard                                                                */
00005 /*  Description: BSP collision detection code                                           */
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_TRACE_H
00023 #define GE_TRACE_H
00024 
00025 #include <Assert.h>
00026 #include <Windows.h>
00027 
00028 #include "Genesis.h"
00029 #include "BaseType.h"
00030 #include "Vec3d.h"
00031 #include "World.h"
00032 //#include "System.h"
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00038 //=====================================================================================
00039 //      Defines / Structure defines
00040 //=====================================================================================
00041 #define PSIDE_FRONT                     1
00042 #define PSIDE_BACK                      2
00043 #define PSIDE_BOTH                      (PSIDE_FRONT|PSIDE_BACK)
00044 #define PSIDE_FACING            4
00045 
00046 int32 Trace_BoxOnPlaneSide(const geVec3d *Mins, const geVec3d *Maxs, GFX_Plane *Plane);
00047 geBoolean Trace_BBoxInVisibleLeaf(geWorld *World, geVec3d *Mins, geVec3d *Maxs);
00048 
00049 //=====================================================================================
00050 //      Function ProtoTypes
00051 //=====================================================================================
00052 
00053 
00054 geBoolean Trace_GEWorldCollision(       geWorld *World, 
00055                                                                         const           geVec3d *Mins, 
00056                                                                         const           geVec3d *Maxs, 
00057                                                                         const           geVec3d *Front, 
00058                                                                         const           geVec3d *Back, 
00059                                                                         uint32          Contents,                       // Contents to collide with
00060                                                                         uint32          CollideFlags,           // GE_COLLIDE_ALL, etc...
00061                                                                         uint32          UserFlags,                      // Flags to mask against actors
00062                                                                         GE_CollisionCB *CollisionCB,
00063                                                                         void            *Context,
00064                                                                         GE_Collision *Col);
00065 
00066 geBoolean Trace_WorldCollisionBNode(geWorld *World, 
00067                                                                         geVec3d *Front, 
00068                                                                         geVec3d *Back, 
00069                                                                         int32 *ModelNum,
00070                                                                         geVec3d *Impact,
00071                                                                         int32 *Node,
00072                                                                         int32 *Plane,
00073                                                                         int32 *Side);
00074 
00075 geBoolean Trace_WorldCollisionExact(geWorld *World, 
00076                                                                         const geVec3d *Front, 
00077                                                                         const geVec3d *Back, 
00078                                                                         uint32 Flags, 
00079                                                                         geVec3d *Impact,
00080                                                                         GFX_Plane *Plane,
00081                                                                         geWorld_Model **Model,
00082                                                                         Mesh_RenderQ **Mesh,
00083                                                                         geActor **Actor,
00084                                                                         uint32 UserFlags,
00085                                                                         GE_CollisionCB *CollisionCB,
00086                                                                         void *Context);
00087 
00088 // Internal only/ does not chek meshes/ returns index numbers into bsp structures for models
00089 geBoolean Trace_WorldCollisionExact2(geWorld *World, 
00090                                                                         const geVec3d *Front, 
00091                                                                         const geVec3d *Back, 
00092                                                                         geVec3d *Impact,
00093                                                                         int32 *Node,
00094                                                                         int32 *Plane,
00095                                                                         int32 *Side);
00096 
00097 geBoolean Trace_MiscCollision(GFX_BNode *BNodes, GFX_Plane *Planes, const geVec3d *Mins, const geVec3d *Maxs, const geVec3d *Front, const geVec3d *Back, geXForm3d *XForm, geVec3d *I, GFX_Plane *P);
00098 geBoolean Trace_MiscCollision2(GFX_BNode *BNodes, GFX_Plane *Planes, const geVec3d *Front, const geVec3d *Back, geVec3d *I, int32 *P);
00099 
00100 geBoolean Trace_WorldCollisionBBox(     geWorld *World,
00101                                                                         const geVec3d *Mins, const geVec3d *Maxs, 
00102                                                                         const geVec3d *Front, const geVec3d *Back,
00103                                                                         uint32 Flags,
00104                                                                         geVec3d *I, GFX_Plane *P,
00105                                                                         geWorld_Model **Model,
00106                                                                         Mesh_RenderQ **Mesh,
00107                                                                         geActor **Actor,
00108                                                                         uint32 UserFlags,
00109                                                                         GE_CollisionCB *CollisionCB,
00110                                                                         void *Context);
00111 
00112 geBoolean Trace_TestModelMove(  geWorld         *World, 
00113                                                                 geWorld_Model           *Model, 
00114                                                                 const geXForm3d *DXForm, 
00115                                                                 const geVec3d           *Mins, const geVec3d *Maxs,
00116                                                                 const geVec3d           *In, geVec3d *Out);
00117 
00118 geBoolean Trace_ModelCollision(geWorld          *World, 
00119                                                                 geWorld_Model           *Model, 
00120                                                                 const geXForm3d *DXForm,
00121                                                                 GE_Collision    *Collision,
00122                                                                 //Mesh_RenderQ  **ImpactedMesh,
00123                                                                 geVec3d                 *ImpactPoint);
00124 
00125 geBoolean Trace_InverseTreeFromBox(geVec3d *Mins, geVec3d *Maxs, GFX_BNode *BNodes, GFX_Plane *Planes);
00126 
00127 geBoolean Trace_GetContents(geWorld *World, const geVec3d *Pos, const geVec3d *Mins, const geVec3d *Maxs, uint32 Flags, uint32 UserFlags, GE_CollisionCB *CollisionCB, void *Context, GE_Contents *Contents);
00128 // changed texture name
00129 geBoolean Trace_GetTexureName(geWorld *World, const geVec3d *Pos, const geVec3d *Mins, const geVec3d *Maxs, char *TexName);
00130 // end change texture name
00131 
00132 void Trace_GetMoveBox(const geVec3d *Mins, const geVec3d *Maxs, const geVec3d *Front, const geVec3d *Back, geVec3d *OMins, geVec3d *OMaxs);
00133 
00134 void            Trace_SetupIntersect(geWorld *World);
00135 geBoolean       Trace_IntersectWorldBSP(geVec3d *Front, geVec3d *Back, int32 Node);
00136 
00137 #ifdef __cplusplus
00138 }
00139 #endif
00140 
00141 #endif

Generated on Tue Sep 30 12:36:33 2003 for GTestAndEngine by doxygen 1.3.2