VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
examples
extentTerrainImplementation
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
13
#include "
terrainInterface/terrainImplementation.h
"
14
#include "
terrainInterface/terrainCapabilities.h
"
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.
25
class
DtExtentTerrainImplementation
:
public
DtTerrainImplementation
26
{
27
public
:
28
29
DtExtentTerrainImplementation
(
DtConsoleCommandManager
* cmdMgr);
30
virtual
~DtExtentTerrainImplementation
();
31
32
//Static creator function
33
static
DtTerrainImplementation
*
create
(
DtConsoleCommandManager
* cmdMgr);
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
MAKVRinTerra::DtFeatureLoader
&,
39
const
TerrainSettings
& settings =
TerrainSettings
());
40
41
//Returns myCoordinateSystem
42
virtual
const
Coordinate_System
*
coordinateSystem
()
const
;
43
44
//Returns topmost intersection of chord with terrain in record.
45
//irtFlag specifies what intersection
46
//data should be filled in for the record.
47
virtual
bool
chordIntersect
(
const
DtChord
& chord,
48
DtChordIntersectionRecord
& record,
49
DtIntersectionRecord::DtIntersectionType
irtFlag =
50
DtIntersectionRecord::INT_ALL_DATA
,
51
bool
* dataAvailable = 0,
bool
overrideBlockingAssert =
false
)
const
;
52
53
//Returns all intersections of chord with terrain. intList is the list of each intersection record.
54
//irtFlag specifies what intersection data should be filled in for the record.
55
//In this example there will only ever be at most 1 intersection.
56
virtual
bool
allIntersectsAlongChord
(
const
DtChord
& chord,
57
DtChordIntersectRecordList
& intList,
58
DtIntersectionRecord::DtIntersectionType
irtFlag =
59
DtIntersectionRecord::INT_ALL_DATA
,
60
bool
* dataAvailable = 0,
bool
overrideBlockingAssert =
false
)
const
;
61
62
//Returns intersection of sphere with the terrain in the record irtFlag specifies what intersection
63
//data should be filled in for the record.
64
virtual
bool
sphereIntersect
(
const
DtSphere
& sphere,
DtSphereIntersectionRecord
& record,
65
DtIntersectionRecord::DtIntersectionType
irtFlag =
66
DtIntersectionRecord::INT_ALL_DATA
,
67
bool
* dataAvailable = 0,
bool
overrideBlockingAssert =
false
)
const
;
68
69
//Returns the capabilities of the current terrain.
70
virtual
const
DtTerrainCapabilities
*
terrainCapabilities
()
const
;
71
72
//Used by B-HAVE for creating path data. func is a function to be called
73
//on the triangles in the terrain. box is an extent that determines which
74
//triangles should be considered. finalize is called once all triangles
75
//have been processed.
76
virtual
void
processTrianglesInArea
(
DtTriangleCallbackFcn
func,
77
DtTriangleCallbackFinalizeFcn
finalize,
78
const
DtTerrainProcessPolygonsBox
& box,
void
* usr);
79
80
protected
:
81
82
//Fill in the intersection record based on the result of the intersection
83
//test.
84
void
fillHitRecord
(
DtChordIntersectionRecord
& rec,
85
const
DtChord
& chord,
const
DtPoint
& chordNormal,
double
intersectTime,
86
DtIntersectionRecord::DtIntersectionType
irtFlag)
const
;
87
88
//Function that actually does the chord-extent intersection test.
89
bool
chordExtentIntersect
(
const
DtChord
& chord,
90
DtChordIntersectionRecord
& hit,
91
DtIntersectionRecord::DtIntersectionType
irtFlag)
const
;
92
93
protected
:
94
Coordinate_System
*
myCoordinateSystem
;
95
DtTerrainCapabilities
myCapabilities
;
96
};
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)