VR-Forces 4.1 Class Documentation
opcodeTerrainIntersector.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: opcodeTerrainIntersector.h,v $ $Revision: 1.2 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef opcodeTerrainIntersector_h
13 #define opcodeTerrainIntersector_h
14 
15 #include "gdb/terrainIntersector.h"
17 
20 
21 // Terrain intersector that uses the external OPCODE library do do terrain
22 // intersection. This takes a little while to init(), and uses a decent
23 // amount of memory, but results in very fast runtime intersection checks.
25 {
26 private:
27  // Not implemented.
29  // Not implemented.
31  // Not implemented.
33 
34 public:
36  const DtTerrainIntersectorDescriptor* descriptor);
37  virtual ~DtOpcodeTerrainIntersector();
38 
39  virtual bool init();
40  virtual bool reinitialize();
41 
42  // \return The total number of bytes of memory used by this intersector
43  // and any of its internal indexing into the terrain.
44  virtual unsigned int memoryUsage() const;
45 
46  virtual bool chordIntersect(const DtChord& chord,
49 
50  virtual bool allIntersectsAlongChord(const DtChord& chord,
53 
54  virtual bool sphereIntersect(const DtSphere& sphere, DtSphereIntersectionRecord& record,
56 
57  virtual int terrainIntersectorType() const;
58 
59  // \return A descriptor for setting this intersector to the DtTerrainDatabase.
60  static DtOpcodeTerrainIntersectorDescriptor* createDescriptor();
61 
62  // \return True if the OPCODE Intersector is valid to use on this terrain
63  // database. Tests to see if each vertex in the database can be converted
64  // to floating point without loosing too much precision.
65  static bool intersectorValid(const DtTerrainDatabase* terrainDb);
66 
67 protected:
69 };
70 
71 // Descriptor for the DtOpcodeTerrainIntersector class.
73 {
74 public:
78 
80 
81  virtual int terrainIntersectorType() const;
82 
83  virtual void descriptorInformation(DtString& name, DtString& properties) const;
84 
85  virtual DtTerrainIntersectorDescriptor* clone() const;
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)