VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
extentTerrainImplementation.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2011 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 //\file extentTerrainImplementation.h
7 //\ingroup terrainInterface
8 
9 //\brief
10 
11 #pragma once
12 
15 
16 class DtCoordinateSystem;
17 namespace makArchives
18 {
19  class DtGenericTerrainRecord;
20 }
21 
22 //This terrain implementation is an algorithmic representation of the world
23 //as a flat earth extent. All soil types are returned as
24 //the undefined soil type.
26 {
27 public:
28 
31 
32  //Static creator function
34 
35  //Called with the generic terrain record from the mtf file.
36  //Use to setup initial values on terrain load.
37  virtual bool loadTerrain(const makArchives::DtGenericTerrainRecord& record);
38 
39  //Returns myCoordinateSystem
40  virtual const Coordinate_System* coordinateSystem() const;
41 
42  //Returns topmost intersection of chord with terrain in record.
43  //irtFlag specifies what intersection
44  //data should be filled in for the record.
45  virtual bool chordIntersect(const DtChord& chord,
46  DtChordIntersectionRecord& record,
47  DtIntersectionRecord::DtIntersectionType irtFlag =
48  DtIntersectionRecord::INT_ALL_DATA,
49  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
50 
51  //Returns all intersections of chord with terrain. intList is the list of each intersection record.
52  //irtFlag specifies what intersection data should be filled in for the record.
53  //In this example there will only ever be at most 1 intersection.
54  virtual bool allIntersectsAlongChord(const DtChord& chord,
55  DtChordIntersectRecordList& intList,
56  DtIntersectionRecord::DtIntersectionType irtFlag =
57  DtIntersectionRecord::INT_ALL_DATA,
58  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
59 
60  //Returns the capabilities of the current terrain.
61  virtual const DtTerrainCapabilities* terrainCapabilities() const;
62 
63  //Used by B-HAVE for creating path data. func is a function to be called
64  //on the triangles in the terrain. box is an extent that determines which
65  //triangles should be considered. finalize is called once all triangles
66  //have been processed.
69  const DtTerrainProcessPolygonsBox& box, void* usr);
70 
71 protected:
72 
73  //Fill in the intersection record based on the result of the intersection
74  //test.
75  void fillHitRecord(DtChordIntersectionRecord& rec,
76  const DtChord& chord, const DtPoint& chordNormal, double intersectTime,
77  DtIntersectionRecord::DtIntersectionType irtFlag) const;
78 
79  //Function that actually does the chord-extent intersection test.
80  bool chordExtentIntersect(const DtChord& chord,
81  DtChordIntersectionRecord& hit,
82  DtIntersectionRecord::DtIntersectionType irtFlag) const;
83 
84 protected:
85  Coordinate_System* myCoordinateSystem;
87 };

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)