meshRoad.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  23. // Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
  24. // Copyright (C) 2015 Faust Logic, Inc.
  25. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  26. #ifndef _MESHROAD_H_
  27. #define _MESHROAD_H_
  28. #ifndef _SCENEOBJECT_H_
  29. #include "scene/sceneObject.h"
  30. #endif
  31. #ifndef _GFXTEXTUREHANDLE_H_
  32. #include "gfx/gfxTextureHandle.h"
  33. #endif
  34. #ifndef _GFXVERTEXBUFFER_H_
  35. #include "gfx/gfxVertexBuffer.h"
  36. #endif
  37. #ifndef _GFXPRIMITIVEBUFFER_H_
  38. #include "gfx/gfxPrimitiveBuffer.h"
  39. #endif
  40. #ifndef _CLIPPEDPOLYLIST_H_
  41. #include "collision/clippedPolyList.h"
  42. #endif
  43. #ifndef _MATINSTANCE_H_
  44. #include "materials/matInstance.h"
  45. #endif
  46. #ifndef _CONVEX_H_
  47. #include "collision/convex.h"
  48. #endif
  49. #include "math/util/decomposePoly.h"
  50. #include "T3D/assets/MaterialAsset.h"
  51. //extern U32 gIdxArray[6][2][3];
  52. struct MeshRoadHitSegment
  53. {
  54. U32 idx;
  55. F32 t;
  56. };
  57. class MeshRoad;
  58. class MeshRoadProfileNode
  59. {
  60. private:
  61. Point3F mPos; // The position of the node. Only x and y are used.
  62. bool mSmooth; // Is the node smoothed? Determines the normal at the node.
  63. public:
  64. MeshRoadProfileNode() { mSmooth = false; }
  65. MeshRoadProfileNode(Point3F p) { mPos = p; mSmooth = false; }
  66. void setPosition(F32 x, F32 y) { mPos.x = x; mPos.y = y; mPos.z = 0.0f; }
  67. Point3F getPosition() { return mPos; }
  68. void setSmoothing(bool isSmooth) { mSmooth = isSmooth; }
  69. bool isSmooth() { return mSmooth; }
  70. };
  71. //-------------------------------------------------------------------------
  72. // MeshRoadProfile Class
  73. //-------------------------------------------------------------------------
  74. class MeshRoadProfile
  75. {
  76. private:
  77. friend class GuiMeshRoadEditorCtrl;
  78. friend class MeshRoad;
  79. friend class GuiMeshRoadEditorUndoAction;
  80. protected:
  81. MeshRoad* mRoad; // A pointer to the Road this profile belongs to
  82. Vector<MeshRoadProfileNode> mNodes; // The list of nodes in the profile
  83. Vector<VectorF> mNodeNormals; // The list of normals for each node
  84. Vector<U8> mSegMtrls; // The list of segment materials
  85. MatrixF mObjToSlice; // Transform profile from obj to slice space
  86. MatrixF mSliceToObj; // Transform profile from slice to obj space
  87. Point3F mStartPos; // Start position of profile in world space
  88. decompPoly mCap; // The polygon that caps the ends
  89. public:
  90. MeshRoadProfile();
  91. S32 clickOnLine(Point3F &p); // In profile space
  92. void addPoint(U32 nodeId, Point3F &p); // In profile space
  93. void removePoint(U32 nodeId);
  94. void setNodePosition(U32 nodeId, Point3F pos); // In profile space
  95. void toggleSmoothing(U32 nodeId);
  96. void toggleSegMtrl(U32 seg); // Toggle between top, bottom, side
  97. void generateNormals();
  98. void generateEndCap(F32 width);
  99. void setProfileDepth(F32 depth);
  100. void setTransform(const MatrixF &mat, const Point3F &p); // Object to slice space transform
  101. void getNodeWorldPos(U32 nodeId, Point3F &p); // Get node position in world space
  102. void getNormToSlice(U32 normId, VectorF &n); // Get normal vector in slice space
  103. void getNormWorldPos(U32 normId, Point3F &p); // Get normal end pos in world space
  104. void worldToObj(Point3F &p); // Transform from world to obj space
  105. void objToWorld(Point3F &p); // Transform from obj to world space
  106. F32 getProfileLen();
  107. F32 getNodePosPercent(U32 nodeId);
  108. Vector<MeshRoadProfileNode> getNodes() { return mNodes; }
  109. void resetProfile(F32 defaultDepth); // Reset profile to 2 default nodes
  110. };
  111. //-------------------------------------------------------------------------
  112. // MeshRoadConvex Class
  113. //-------------------------------------------------------------------------
  114. class MeshRoadConvex : public Convex
  115. {
  116. typedef Convex Parent;
  117. friend class MeshRoad;
  118. protected:
  119. MeshRoad *pRoad;
  120. public:
  121. U32 faceId;
  122. U32 triangleId;
  123. U32 segmentId;
  124. Point3F verts[4];
  125. PlaneF normal;
  126. Box3F box;
  127. public:
  128. MeshRoadConvex():pRoad(NULL), faceId(0), triangleId(0), segmentId(0) { mType = MeshRoadConvexType; }
  129. MeshRoadConvex( const MeshRoadConvex& cv ) {
  130. mType = MeshRoadConvexType;
  131. mObject = cv.mObject;
  132. pRoad = cv.pRoad;
  133. faceId = cv.faceId;
  134. triangleId = cv.triangleId;
  135. segmentId = cv.segmentId;
  136. verts[0] = cv.verts[0];
  137. verts[1] = cv.verts[1];
  138. verts[2] = cv.verts[2];
  139. verts[3] = cv.verts[3];
  140. normal = cv.normal;
  141. box = cv.box;
  142. }
  143. const MatrixF& getTransform() const;
  144. Box3F getBoundingBox() const;
  145. Box3F getBoundingBox(const MatrixF& mat, const Point3F& scale) const;
  146. Point3F support(const VectorF& vec) const;
  147. void getFeatures(const MatrixF& mat,const VectorF& n, ConvexFeature* cf);
  148. void getPolyList(AbstractPolyList* list);
  149. };
  150. //-------------------------------------------------------------------------
  151. // MeshRoadSplineNode Class
  152. //-------------------------------------------------------------------------
  153. class Path;
  154. class TerrainBlock;
  155. struct ObjectRenderInst;
  156. class MeshRoadSplineNode
  157. {
  158. public:
  159. MeshRoadSplineNode() :x(0.0f), y(0.0f), z(0.0f), width(0.0f), depth(0.0f) {}
  160. F32 x;
  161. F32 y;
  162. F32 z;
  163. F32 width;
  164. F32 depth;
  165. VectorF normal;
  166. MeshRoadSplineNode& operator=(const MeshRoadSplineNode&);
  167. MeshRoadSplineNode operator+(const MeshRoadSplineNode&) const;
  168. MeshRoadSplineNode operator-(const MeshRoadSplineNode&) const;
  169. MeshRoadSplineNode operator*(const F32) const;
  170. F32 len();
  171. Point3F getPosition() const { return Point3F(x,y,z); };
  172. };
  173. inline F32 MeshRoadSplineNode::len()
  174. {
  175. return mSqrt(F32(x*x + y*y + z*z));
  176. }
  177. inline MeshRoadSplineNode& MeshRoadSplineNode::operator=(const MeshRoadSplineNode &_node)
  178. {
  179. x = _node.x;
  180. y = _node.y;
  181. z = _node.z;
  182. width = _node.width;
  183. depth = _node.depth;
  184. normal = _node.normal;
  185. return *this;
  186. }
  187. inline MeshRoadSplineNode MeshRoadSplineNode::operator+(const MeshRoadSplineNode& _add) const
  188. {
  189. MeshRoadSplineNode result;
  190. result.x = x + _add.x;
  191. result.y = y + _add.y;
  192. result.z = z + _add.z;
  193. result.width = width + _add.width;
  194. result.depth = depth + _add.depth;
  195. result.normal = normal + _add.normal;
  196. return result;
  197. }
  198. inline MeshRoadSplineNode MeshRoadSplineNode::operator-(const MeshRoadSplineNode& _rSub) const
  199. {
  200. MeshRoadSplineNode result;
  201. result.x = x - _rSub.x;
  202. result.y = y - _rSub.y;
  203. result.z = z - _rSub.z;
  204. result.width = width - _rSub.width;
  205. result.depth = depth - _rSub.depth;
  206. result.normal = normal - _rSub.normal;
  207. return result;
  208. }
  209. inline MeshRoadSplineNode operator*(const F32 mul, const MeshRoadSplineNode& multiplicand)
  210. {
  211. return multiplicand * mul;
  212. }
  213. inline MeshRoadSplineNode MeshRoadSplineNode::operator*(const F32 _mul) const
  214. {
  215. MeshRoadSplineNode result;
  216. result.x = x * _mul;
  217. result.y = y * _mul;
  218. result.z = z * _mul;
  219. result.width = width * _mul;
  220. result.depth = depth * _mul;
  221. result.normal = normal * _mul;
  222. return result;
  223. }
  224. //-------------------------------------------------------------------------
  225. // Structures
  226. //-------------------------------------------------------------------------
  227. struct MeshRoadRenderBatch
  228. {
  229. U32 startSegmentIdx;
  230. U32 endSegmentIdx;
  231. U32 startVert;
  232. U32 endVert;
  233. U32 startIndex;
  234. U32 endIndex;
  235. U32 totalRows;
  236. U32 indexCount;
  237. U32 vertCount;
  238. U32 triangleCount;
  239. };
  240. typedef Vector<MeshRoadRenderBatch> MeshRoadBatchVector;
  241. struct MeshRoadNode
  242. {
  243. // The 3D position of the node
  244. Point3F point;
  245. // The width of the River at this node (meters)
  246. F32 width;
  247. // The depth of the River at this node (meters)
  248. F32 depth;
  249. VectorF normal;
  250. };
  251. typedef Vector<MeshRoadNode> MeshRoadNodeVector;
  252. struct MeshRoadSlice
  253. {
  254. MeshRoadSlice()
  255. {
  256. p0.zero();
  257. p1.zero();
  258. p2.zero();
  259. pb0.zero();
  260. pb2.zero();
  261. uvec.zero();
  262. fvec.zero();
  263. rvec.zero();
  264. width = 0.0f;
  265. depth = 0.0f;
  266. normal.set(0,0,1);
  267. texCoordV = 0.0f;
  268. t = 0.0f;
  269. parentNodeIdx = -1;
  270. };
  271. Point3F p0; // upper left
  272. Point3F p1; // upper center
  273. Point3F p2; // upper right
  274. Point3F pb0; // bottom left
  275. Point3F pb2; // bottom right
  276. VectorF uvec;
  277. VectorF fvec;
  278. VectorF rvec;
  279. F32 width;
  280. F32 depth;
  281. Point3F normal;
  282. F32 t;
  283. F32 texCoordV;
  284. U32 parentNodeIdx;
  285. Vector<Point3F> verts;
  286. Vector<VectorF> norms;
  287. };
  288. typedef Vector<MeshRoadSlice> MeshRoadSliceVector;
  289. //-------------------------------------------------------------------------
  290. // MeshRoadSegment Class
  291. //-------------------------------------------------------------------------
  292. class MeshRoadSegment
  293. {
  294. public:
  295. MeshRoadSegment();
  296. MeshRoadSegment( MeshRoadSlice *rs0, MeshRoadSlice *rs1, const MatrixF &roadMat );
  297. void set( MeshRoadSlice *rs0, MeshRoadSlice *rs1 );
  298. F32 TexCoordStart() const { return slice0->texCoordV; }
  299. F32 TexCoordEnd() const { return slice1->texCoordV; }
  300. const Point3F& getP00() const { return slice0->p0; }
  301. const Point3F& getP01() const { return slice1->p0; }
  302. const Point3F& getP11() const { return slice1->p2; }
  303. const Point3F& getP10() const { return slice0->p2; }
  304. Point3F getSurfaceCenter() const { return ( slice0->p1 + slice1->p1 ) / 2.0f; }
  305. Point3F getSurfaceNormal() const { return -mPlanes[4].getNormal(); }
  306. bool intersectBox( const Box3F &bounds ) const;
  307. bool containsPoint( const Point3F &pnt ) const;
  308. F32 distanceToSurface( const Point3F &pnt ) const;
  309. F32 length() const { return ( slice1->p1 - slice0->p1 ).len(); }
  310. // Quick access to the segment's points
  311. Point3F& operator[](U32);
  312. const Point3F& operator[](U32) const;
  313. Point3F& operator[](S32 i) { return operator[](U32(i)); }
  314. const Point3F& operator[](S32 i ) const { return operator[](U32(i)); }
  315. const Box3F& getWorldBounds() const { return worldbounds; }
  316. MeshRoadSlice *slice0;
  317. MeshRoadSlice *slice1;
  318. protected:
  319. PlaneF mPlanes[6];
  320. U32 mPlaneCount;
  321. U32 columns;
  322. U32 rows;
  323. U32 startVert;
  324. U32 endVert;
  325. U32 startIndex;
  326. U32 endIndex;
  327. U32 numVerts;
  328. U32 numTriangles;
  329. Box3F objectbounds;
  330. Box3F worldbounds;
  331. };
  332. typedef Vector<MeshRoadSegment> MeshRoadSegmentVector;
  333. inline Point3F& MeshRoadSegment::operator[](U32 index)
  334. {
  335. AssertFatal(index < 8, "MeshRoadSegment::operator[] - out of bounds array access!");
  336. MeshRoadSlice *slice = NULL;
  337. if ( index > 3 )
  338. {
  339. slice = slice1;
  340. index -= 4;
  341. }
  342. else
  343. {
  344. slice = slice0;
  345. }
  346. if ( index == 0 )
  347. return slice->p0;
  348. if ( index == 1 )
  349. return slice->p2;
  350. if ( index == 2 )
  351. return slice->pb0;
  352. else //( index == 3 )
  353. return slice->pb2;
  354. }
  355. inline const Point3F& MeshRoadSegment::operator[](U32 index) const
  356. {
  357. AssertFatal(index < 8, "MeshRoadSegment::operator[] - out of bounds array access!");
  358. MeshRoadSlice *slice = NULL;
  359. if ( index > 3 )
  360. {
  361. slice = slice1;
  362. index -= 4;
  363. }
  364. else
  365. {
  366. slice = slice0;
  367. }
  368. if ( index == 0 )
  369. return slice->p0;
  370. if ( index == 1 )
  371. return slice->p2;
  372. if ( index == 2 )
  373. return slice->pb0;
  374. else// ( index == 3 )
  375. return slice->pb2;
  376. }
  377. //------------------------------------------------------------------------------
  378. // MeshRoad Class
  379. //------------------------------------------------------------------------------
  380. class PhysicsBody;
  381. struct MeshRoadNodeList;
  382. class MeshRoad : public SceneObject
  383. {
  384. private:
  385. friend class GuiMeshRoadEditorCtrl;
  386. friend class GuiMeshRoadEditorUndoAction;
  387. friend class MeshRoadConvex;
  388. friend class MeshRoadProfile;
  389. typedef SceneObject Parent;
  390. enum
  391. {
  392. MeshRoadMask = Parent::NextFreeMask,
  393. NodeMask = Parent::NextFreeMask << 1,
  394. RegenMask = Parent::NextFreeMask << 2,
  395. InitialUpdateMask = Parent::NextFreeMask << 3,
  396. SelectedMask = Parent::NextFreeMask << 4,
  397. MaterialMask = Parent::NextFreeMask << 5,
  398. ProfileMask = Parent::NextFreeMask << 6,
  399. NextFreeMask = Parent::NextFreeMask << 7,
  400. };
  401. public:
  402. MeshRoad();
  403. ~MeshRoad();
  404. DECLARE_CONOBJECT(MeshRoad);
  405. // ConObject.
  406. static void initPersistFields();
  407. static void consoleInit();
  408. // SimObject
  409. bool onAdd();
  410. void onRemove();
  411. void onEditorEnable();
  412. void onEditorDisable();
  413. void inspectPostApply();
  414. void onStaticModified(const char* slotName, const char*newValue = NULL);
  415. void writeFields(Stream &stream, U32 tabStop);
  416. bool writeField( StringTableEntry fieldname, const char *value );
  417. // NetObject
  418. U32 packUpdate(NetConnection *, U32, BitStream *);
  419. void unpackUpdate(NetConnection *, BitStream *);
  420. // SceneObject
  421. virtual void prepRenderImage( SceneRenderState* sceneState );
  422. virtual void setTransform( const MatrixF &mat );
  423. virtual void setScale( const VectorF &scale );
  424. // SceneObject - Collision
  425. virtual void buildConvex(const Box3F& box,Convex* convex);
  426. virtual bool buildPolyList(PolyListContext context, AbstractPolyList* polyList, const Box3F &box, const SphereF &sphere);
  427. virtual bool castRay(const Point3F &start, const Point3F &end, RayInfo* info);
  428. virtual bool collideBox(const Point3F &start, const Point3F &end, RayInfo* info);
  429. // MeshRoad
  430. void regenerate();
  431. void setBatchSize( U32 level );
  432. void setTextureFile( StringTableEntry file );
  433. void setTextureRepeat( F32 meters );
  434. bool collideRay( const Point3F &origin, const Point3F &direction, U32 *nodeIdx = NULL, Point3F *collisionPnt = NULL );
  435. bool buildSegmentPolyList( AbstractPolyList* polyList, U32 startSegIdx, U32 endSegIdx, bool capFront, bool capEnd );
  436. void buildNodesFromList( MeshRoadNodeList* list );
  437. U32 insertNode( const Point3F &pos, const F32 &width, const F32 &depth, const Point3F &normal, const U32 &idx );
  438. U32 addNode( const Point3F &pos, const F32 &width, const F32 &depth, const Point3F &normal );
  439. void deleteNode( U32 idx );
  440. void setNode( const Point3F &pos, const F32 &width, const F32 &depth, const Point3F &normal, const U32 &idx );
  441. const MeshRoadNode& getNode( U32 idx );
  442. VectorF getNodeNormal( U32 idx );
  443. void setNodeNormal( U32 idx, const VectorF &normal );
  444. Point3F getNodePosition( U32 idx );
  445. void setNodePosition( U32 idx, const Point3F &pos );
  446. F32 getNodeWidth( U32 idx );
  447. void setNodeWidth( U32 idx, F32 width );
  448. F32 getNodeDepth( U32 idx );
  449. void setNodeDepth( U32 idx, F32 depth );
  450. MatrixF getNodeTransform( U32 idx );
  451. void calcSliceTransform( U32 idx, MatrixF &mat );
  452. bool isEndNode( U32 idx ) { return ( mNodes.size() > 0 && ( idx == 0 || idx == mNodes.size() - 1 ) ); }
  453. U32 getSegmentCount() { return mSegments.size(); }
  454. const MeshRoadSegment& getSegment( U32 idx ) { return mSegments[idx]; }
  455. F32 getRoadLength() const;
  456. static SimSet* getServerSet();
  457. /// Protected 'Component' Field setter that will add a component to the list.
  458. static bool addNodeFromField( void *object, const char *index, const char *data );
  459. static bool addProfileNodeFromField(void *obj, const char *index, const char* data);
  460. static bool smEditorOpen;
  461. static bool smWireframe;
  462. static bool smShowBatches;
  463. static bool smShowSpline;
  464. static bool smShowRoad;
  465. static bool smShowRoadProfile;
  466. static SimObjectPtr<SimSet> smServerMeshRoadSet;
  467. protected:
  468. void _initMaterial();
  469. void _debugRender( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance* );
  470. U32 _insertNode( const Point3F &pos, const F32 &width, const F32 &depth, const Point3F &normal, const U32 &idx );
  471. U32 _addNode( const Point3F &pos, const F32 &width, const F32 &depth, const Point3F &normal );
  472. void _regenerate();
  473. void _generateSlices();
  474. void _generateSegments();
  475. void _generateVerts();
  476. protected:
  477. MeshRoadSliceVector mSlices;
  478. MeshRoadNodeVector mNodes;
  479. MeshRoadSegmentVector mSegments;
  480. MeshRoadBatchVector mBatches;
  481. static GFXStateBlockRef smWireframeSB;
  482. enum {
  483. Top = 0,
  484. Bottom = 1,
  485. Side = 2,
  486. SurfaceCount = 3
  487. };
  488. GFXVertexBufferHandle<GFXVertexPNTT> mVB[SurfaceCount];
  489. GFXPrimitiveBufferHandle mPB[SurfaceCount];
  490. DECLARE_MATERIALASSET(MeshRoad, TopMaterial);
  491. DECLARE_ASSET_NET_SETGET(MeshRoad, TopMaterial, MeshRoadMask);
  492. DECLARE_MATERIALASSET(MeshRoad, BottomMaterial);
  493. DECLARE_ASSET_NET_SETGET(MeshRoad, BottomMaterial, MeshRoadMask);
  494. DECLARE_MATERIALASSET(MeshRoad, SideMaterial);
  495. DECLARE_ASSET_NET_SETGET(MeshRoad, SideMaterial, MeshRoadMask);
  496. //String mMaterialName[SurfaceCount];
  497. SimObjectPtr<Material> mMaterial[SurfaceCount];
  498. BaseMatInstance *mMatInst[SurfaceCount];
  499. U32 mVertCount[SurfaceCount];
  500. U32 mTriangleCount[SurfaceCount];
  501. MeshRoadProfile mSideProfile;
  502. // Fields.
  503. F32 mTextureLength;
  504. F32 mBreakAngle;
  505. S32 mWidthSubdivisions;
  506. // Collision and Physics.
  507. Convex* mConvexList;
  508. Vector<MeshRoadConvex*> mDebugConvex;
  509. PhysicsBody *mPhysicsRep;
  510. private:
  511. static bool buildPolyList_TopSurfaceOnly;
  512. public:
  513. bool buildTopPolyList(PolyListContext, AbstractPolyList*);
  514. };
  515. #endif // _MESHROAD_H_