collision_desc.h

Go to the documentation of this file.
00001 
00005 /* Copyright, 2001 Nevrax Ltd.
00006  *
00007  * This file is part of NEVRAX NEL.
00008  * NEVRAX NEL is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2, or (at your option)
00011  * any later version.
00012 
00013  * NEVRAX NEL is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * General Public License for more details.
00017 
00018  * You should have received a copy of the GNU General Public License
00019  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00020  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00021  * MA 02111-1307, USA.
00022  */
00023 
00024 #ifndef NL_COLLISION_DESC_H
00025 #define NL_COLLISION_DESC_H
00026 
00027 #include "nel/misc/types_nl.h"
00028 #include "nel/misc/file.h"
00029 #include "nel/misc/vector.h"
00030 #include "nel/pacs/u_collision_desc.h"
00031 #include <vector>
00032 
00033 namespace NLPACS
00034 {
00035 
00043 class CCollisionDesc: public UCollisionDesc
00044 {
00045 public:
00046     // XChg contact normal 0 and 1
00047     void XChgContactNormals ()
00048     {
00049         NLMISC::CVectorD tmp=ContactNormal0;
00050         ContactNormal0=ContactNormal1;
00051         ContactNormal1=tmp;
00052     }
00053 };
00054 
00055 
00063 class CSurfaceIdent
00064 {
00065 public:
00067     sint32              RetrieverInstanceId;
00069     sint32              SurfaceId;
00070 
00071     bool operator==(const CSurfaceIdent &o) const
00072     {
00073         return RetrieverInstanceId==o.RetrieverInstanceId && SurfaceId==o.SurfaceId;
00074     }
00075 
00076     bool operator!=(const CSurfaceIdent &o) const
00077     {
00078         return !(*this==o);
00079     }
00080 
00081 
00082 public:
00083     CSurfaceIdent() {}
00084     CSurfaceIdent(sint32 retInstance, sint32 surfId) : RetrieverInstanceId(retInstance), SurfaceId(surfId) {}
00085 
00086     void                serial(NLMISC::IStream &f)  { f.serial(RetrieverInstanceId, SurfaceId); }
00087 };
00088 
00089 
00097 class CCollisionSurfaceDesc
00098 {
00099 public:
00100     NLMISC::CVectorD    ContactNormal;
00101     double              ContactTime;
00102 
00104     CSurfaceIdent       ContactSurface;
00105 };
00106 
00107 
00108 typedef std::vector<CCollisionSurfaceDesc>  TCollisionSurfaceDescVector;
00109 
00110 
00111 
00112 } // NLPACS
00113 
00114 
00115 #endif // NL_COLLISION_DESC_H
00116 
00117 /* End of collision_desc.h */

Generated on Thu Jan 7 08:26:36 2010 for NeL by  doxygen 1.6.1