VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
gdb
terrainIntersector.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2008 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: terrainIntersector.h,v $ $Revision: 1.17 $ $State: Exp $
7
*******************************************************************************/
8
11
12
#ifndef terrainIntersector_h
13
#define terrainIntersector_h
14
15
#include "
gdb/gdbDefines.h
"
16
#include "
gdb/gdbNode.h
"
17
18
class
DtTerrainDatabase
;
19
class
DtPoint
;
20
class
DtChord
;
21
class
DtChordIntersectionRecord
;
22
class
DtSphereIntersectionRecord
;
23
class
DtTerrainIntersectorDescriptor
;
24
25
// Common place to keep all current intersector types
26
const
int
DtBaseTerrainIntersectorType
= 0;
27
const
int
DtSpatialSubdivisionTerrainIntersectorType
= 1;
28
const
int
DtOpcodeTerrainIntersectorType
= 2;
29
30
// Abstract base class for intersectors used in a DtTerrainDatabase.
31
// Subclasses of this interface class implement the actual intersection
32
// methods for getting intersections with the polygonal terrain data.
33
class
DT_DLL_gdb
DtTerrainIntersector
34
{
35
private
:
36
// Not implemented.
37
DtTerrainIntersector
();
38
// Not implemented.
39
DtTerrainIntersector
(
const
DtTerrainIntersector
& orig);
40
// Not implemented.
41
DtTerrainIntersector
& operator=(
const
DtTerrainIntersector
& orig);
42
43
public
:
44
// Provide the terrain database and descriptor to instantiate a terrain intersector.
45
// The descriptor is cloned and held internally by the intersector.
46
DtTerrainIntersector
(
DtTerrainDatabase
* db,
47
const
DtTerrainIntersectorDescriptor
* descriptor);
48
virtual
~
DtTerrainIntersector
();
49
50
// Called for first time init
51
virtual
bool
init
() = 0;
52
53
// Called when something has changed about the underlying terrain database and the intersector
54
// needs to be reinitialized
55
virtual
bool
reinitialize() = 0;
56
57
// \return The total number of bytes of memory used by this intersector
58
// and any of its internal indexing into the terrain.
59
virtual
unsigned
int
memoryUsage()
const
= 0;
60
61
virtual
int
terrainIntersectorType()
const
= 0;
62
63
virtual
bool
chordIntersect(
const
DtChord
& chord,
64
DtChordIntersectionRecord
& record,
65
DtGdbNode::DtIntersectRecordType
irtFlag =
DtGdbNode::IRT_ALL_DATA_TERRAIN
)
const
= 0;
66
67
virtual
bool
allIntersectsAlongChord(
const
DtChord
& chord,
68
DtChordIntersectRecordList
& intList,
69
DtGdbNode::DtIntersectRecordType
irtFlag =
DtGdbNode::IRT_ALL_DATA_TERRAIN
)
const
= 0;
70
71
virtual
bool
sphereIntersect(
const
DtSphere
& sphere,
DtSphereIntersectionRecord
& record,
72
DtGdbNode::DtIntersectRecordType
irtFlag =
DtGdbNode::IRT_ALL_DATA_TERRAIN
)
const
= 0;
73
74
virtual
DtTerrainDatabase
*
terrainDatabase
()
const
{
return
myTerrainDatabase; };
75
virtual
DtTerrainDatabase
*
terrainDatabase
() {
return
myTerrainDatabase; };
76
77
// \return A pointer to the descriptor used by this intersector.
78
virtual
const
DtTerrainIntersectorDescriptor
* descriptor()
const
;
79
80
// Called to return information about this intersector. Calls down to the descriptor to return the information
81
virtual
void
intersectorInformation(
DtString
& name,
DtString
& properties)
const
;
82
83
protected
:
84
DtTerrainDatabase
*
myTerrainDatabase
;
85
DtTerrainIntersectorDescriptor
*
myDescriptor
;
86
};
87
88
#endif
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
)