VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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
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
,
int
flags = 0)
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
,
int
flags = 0)
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.
67
virtual
void
processTrianglesInArea
(
DtTriangleCallbackFcn
func,
68
DtTriangleCallbackFinalizeFcn
finalize,
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
;
86
DtTerrainCapabilities
myCapabilities
;
87
};
Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)