terrCollision.h
Engine/source/terrain/terrCollision.h
Classes:
class
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _TERRCOLL_H_ 25#define _TERRCOLL_H_ 26 27#ifndef _CONVEX_H_ 28#include "collision/convex.h" 29#endif 30 31 32class TerrainConvex : public Convex 33{ 34 friend class TerrainBlock; 35 TerrainConvex *square; ///< Alternate convex if square is concave 36 bool halfA; ///< Which half of square 37 bool split45; ///< Square split pattern 38 U32 squareId; ///< Used to match squares 39 U32 material; 40 Point3F point[4]; ///< 3-4 vertices 41 VectorF normal[2]; 42 Box3F box; ///< Bounding box 43 44 public: 45 46 TerrainConvex(); 47 48 TerrainConvex( const TerrainConvex& cv ); 49 50 // Convex 51 Box3F getBoundingBox() const; 52 Box3F getBoundingBox(const MatrixF& mat, const Point3F& scale) const; 53 Point3F support(const VectorF& v) const; 54 void getFeatures(const MatrixF& mat,const VectorF& n, ConvexFeature* cf); 55 void getPolyList(AbstractPolyList* list); 56}; 57 58#endif // _TERRCOLL_H_ 59