VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
entityTerrainGeometryHandle.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
17 
20 
21 #include <vector>
22 #include <boost/unordered_map.hpp>
23 #include <tbb/spin_mutex.h>
24 
25 class DtPoint;
26 class DtTaitBryan;
27 
31 {
32 public:
36  {
37  public:
38  typedef boost::shared_ptr<CollisionObject> Ptr;
39 
41 
42  bool enabled() const;
43 
44  void incrementEnableCount();
45  void decrementEnableCount();
46 
47  protected:
48  tbb::atomic<unsigned> myEnableCount;
49  };
50 
52  {
53  public:
54  explicit DynamicFeature(const DtPoint& location, double radius);
55 
56  ~DynamicFeature();
57 
58  DtString description() const;
59 
60  bool matches(const makVrv::DtDynamicTerrainChange&, bool useOriginalGeometry = false) const;
61  bool matches(const makVrv::DtDynamicTerrainGeometry&, bool useOriginalGeometry = false) const;
62 
63  const makVrv::DtDynamicTerrainGeometry* geometry() const;
64  const makVrv::DtDynamicTerrainGeometry* originalGeometry() const;
65 
66  bool isInDefaultState() const;
67  bool lastStateWasDefaultState() const;
68  void changeState(const makVrv::DtDynamicTerrainChanges& history);
69  void iterateCommands(const boost::function<void(const makVrv::DtDynamicTerrainChange&)>&) const;
70 
71  void setToDefaultState();
72 
73  makVrv::DtDynamicTerrainChange* createChange() const;
74 
75  protected:
78 
79  tbb::atomic<bool> myDefaultStateFlag;
80  };
81 
82  typedef std::vector<CollisionObject::Ptr> CollisionObjectVector;
83  typedef boost::unordered_map<DtAppearance, CollisionObjectVector> AppearanceMap;
84 
86  explicit DtEntityTerrainGeometryHandle(DtVantageTerrainEngine& engine, const DtFilename& model);
87 
90 
92  bool isValid() const;
93 
95 
96  bool isDisabled() const;
97  void disable();
98  void setAppearance(DtAppearance app);
99  void setPosition(const DtPoint& location, const DtDcm& orientation);
101 
102 protected:
104  virtual CollisionObjectVector& loadAppearance(DtAppearance flags);
105 
106  virtual void setupDynamicFeature(const DtPoint& location, double radius);
107  void destroyDynamicFeature();
108 
109  mutable tbb::spin_mutex myMutex;
110 
112  const DtFilename myFile;
113 
114  boost::optional<DtAppearance> myCurrentAppearance;
115  boost::optional<DtPoint> myCurrentLocation;
116  boost::optional<DtDcm> myCurrentOrientation;
117 
118  boost::shared_ptr<DynamicFeature> myFeature;
121 
123 };
Definition: DtDynamicTerrainFeature.h:316
DtVantageTerrainEngine & myVantageTerrainEngine
Definition: entityTerrainGeometryHandle.h:111
Bullet collision object which defaults to being disabled and is enabled when the enable count is non-...
Definition: entityTerrainGeometryHandle.h:35
Represents (possibly infinite) area of space.
Definition: DtDynamicTerrainGeometry.h:19
boost::unordered_map< DtAppearance, CollisionObjectVector > AppearanceMap
Definition: entityTerrainGeometryHandle.h:83
Allows manipulating a terrain object.
Definition: terrainImplementation.h:139
Definition: entityTerrainGeometryHandle.h:51
boost::shared_ptr< CollisionObject > Ptr
Definition: entityTerrainGeometryHandle.h:38
makVrv::DtDynamicTerrainWorld::RequestHandle myRequestHandle
Definition: entityTerrainGeometryHandle.h:120
boost::optional< DtAppearance > myCurrentAppearance
Definition: entityTerrainGeometryHandle.h:114
Implementation of handle which allows controlling entity geometry which has been inserted into the te...
Definition: entityTerrainGeometryHandle.h:30
boost::optional< DtDcm > myCurrentOrientation
Definition: entityTerrainGeometryHandle.h:116
Definition: bvhTriangleMeshShape.h:101
Interface which abstracts the concept of a individually identifiable &quot;thing&quot; in the terrain...
Definition: DtDynamicTerrainFeature.h:83
makVrv::DtDynamicTerrainGeometry * myGeometry
Definition: entityTerrainGeometryHandle.h:76
makVrv::DtDynamicTerrainWorld::FeatureHandle myFeatureHandle
Definition: entityTerrainGeometryHandle.h:119
Contains makVrv::DtDynamicTerrainFeature class.
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
Contains makVrv::DtDynamicTerrainWorld class.
Command which can be given to the dynamic terrain system to perform some change.
Definition: DtDynamicTerrainChange.h:42
Feature Insertion/Removal/Paging Features represent parts of the terrain which are individually ident...
Definition: DtDynamicTerrainWorld.h:99
tbb::atomic< bool > myDefaultStateFlag
Definition: entityTerrainGeometryHandle.h:79
This class wraps the VR-Vantage Display Engine, and uses as a terrain loader and intersector.
Definition: vantageTerrainEngine.h:93
AppearanceMap myAppearanceMap
Definition: entityTerrainGeometryHandle.h:122
tbb::atomic< unsigned > myEnableCount
Definition: entityTerrainGeometryHandle.h:48
makVrv::DtDynamicTerrainGeometry * myOriginalGeometry
Definition: entityTerrainGeometryHandle.h:77
tbb::spin_mutex myMutex
Definition: entityTerrainGeometryHandle.h:109
const DtFilename myFile
Definition: entityTerrainGeometryHandle.h:112
std::vector< CollisionObject::Ptr > CollisionObjectVector
Definition: entityTerrainGeometryHandle.h:82
Definition: point.h:34
boost::shared_ptr< DynamicFeature > myFeature
Definition: entityTerrainGeometryHandle.h:118
boost::optional< DtPoint > myCurrentLocation
Definition: entityTerrainGeometryHandle.h:115
Resource handle for a change request which has been added to the system.
Definition: DtDynamicTerrainFeature.h:95

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)