VR-Engage  2.3
Loading...
Searching...
No Matches
vortexPagedTerrain.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2024 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vortexPagedTerrain.h
7//! \brief Class that manages all the translation from the VR-Forces terrain to the Vortex Terrain system.
8//! This class also manages dynamic terrain events that come from DtVortexDynamicTerrainHandler.
9//! This class acts as an interface between the paged terrain producer and the terrain database in regions
10//! where parts and collision geometries are required for collision with other entities.
11//! The responsibility of the paged terrain interface is to answer these queries and to create the requested
12//! parts and collision geometries from the terrain information in the terrain database.
13//!
14//! \ingroup vreVrfVortex
15
16#pragma once
17
18#include <vreVrfVortex/export.h>
21
22#include <vrfobjcore/simObjectReference.h>
23
25
26#include <VxTerrain/VxPagedTerrainInterface.h>
27
28#include <VxMath/VxMath.h>
29#include <VxMath/BoundingBox.h>
30
31#include <atomic>
32#include <future>
33
34#include <tbb/concurrent_vector.h>
35#include <tbb/task_arena.h>
36#include <tbb/spin_mutex.h>
37
38// Forward declares
39class DtTerrainImplementation;
40
41namespace VxTerrain
42{
43class VxPagedTerrainProducer;
44}
45
46namespace Vx
47{
48class VxCollisionGeometry;
49class VxPart;
50class VxTriangleMeshUVGrid;
51class VxTriangleMeshBVTree;
52} // namespace Vx
53
54namespace makVre
55{
60
61//! \brief Main class that manages terrain translation between VR-Forces and Vortex
62//!
63//! This class facilitates the communication between VR-Forces terrain system and the Vortex physics engine.
64//! It handles the conversion of terrain data, processes terrain generation requests, creates collision
65//! geometries, and manages dynamic terrain modifications. The class implements the VxPagedTerrainInterface
66//! to interact with the Vortex paged terrain system.
67class VREVRFVORTEX_DLL DtVortexPagedTerrainInterface : public VxTerrain::VxPagedTerrainInterface
68{
69public:
70 //! \brief Data structure for managing new terrain requests from the Vortex Forecaster
71 //!
72 //! Holds information about asynchronous terrain generation requests including priority,
73 //! unique identifier, and future object for tracking completion.
75 {
76 std::shared_future<void> future; //!< Future object for asynchronous processing
77 int priority; //!< Priority level of the request
78 int requestId; //!< Unique identifier for the request
79 };
80 using NewTerrainRequestQueue = std::list<VortexNewTerrainRequest>;
81
82 //! \brief Structure for queueing vortex requests to be inserted on the next update()
83 //!
84 //! Contains all necessary data for creating and inserting a new terrain cell,
85 //! including the bounding box, triangle mesh, and triangle interface.
87 {
88 //! \brief Default constructor
89 //!
90 //! Initializes the structure with null pointers for the triangle interface and mesh.
92
93 //! \brief Destructor
94 //!
95 //! Cleans up by setting pointers to nullptr to prevent dangling references.
97
98 VxMath::BoundingBox requestBounds; //!< The bounding box of this request
99 std::shared_ptr<DtVortexTriangleOutputInterface> newTriangleInterface; //!< Triangle Interface
100 Vx::VxTriangleMeshBVTree* newTriangleMesh; //!< The triangle mesh
101 };
102
103 //! \brief Structure for queueing vortex requests to be modified on the next step()
104 //!
105 //! Contains the data needed to modify an existing terrain cell, including
106 //! source ID, request ID, generation, and new triangle data.
108 {
109 //! \brief Default constructor
110 //!
111 //! Initializes the structure with invalid identifiers and null triangle data.
113
114 int sourceId; //!< The source ID this cell collision geometry links to
115 Vx::VxCollisionGeometry* collisionGeometry; //!< Legacy non-owning pointer; dynamic updates re-resolve it
116 Vx::VxTriangleMeshBVTree* newTriangleData; //!< Owned mesh data to apply; cleared after deletion
117 int requestId; //!< The request ID associated with the collision geometry
118 unsigned int generation; //!< Dynamic terrain generation that created this update
119 std::vector<DtSimObjectReference>
120 objects; //!< List of objects that will need to be dropped if this is a dynamic terrain event
121 };
122
123public:
124 //! \brief Default constructor
125 //!
126 //! Initializes the paged terrain interface with default settings, sets up the material mapper,
127 //! and retrieves configuration parameters from the Vortex physical world. Also initializes
128 //! the terrain implementation and coordinate conversion system.
130
131 //! \brief Destructor
132 //!
133 //! Performs cleanup of resources owned by this interface.
135
136 //! \brief Called every frame from within the vortex application while running
137 //!
138 //! Reorganizes requests based on priority, processes queued collision geometries,
139 //! and manages the terrain regeneration queue. Also handles the completion of
140 //! asynchronous terrain generation tasks.
141 //!
142 //! \param producer The current terrain producer
143 virtual void step(VxTerrain::VxPagedTerrainProducer* producer) override;
144
145 //! \brief Called when new requests for terrain arise
146 //!
147 //! Processes and queues new terrain generation requests by calling queueNewTerrainRequests.
148 //! These requests are then processed asynchronously by the terrain system.
149 //!
150 //! \param request A list of requests to queue up for terrain generation
151 //! \param producer The current terrain producer
152 virtual void produce(const std::vector<VxTerrain::VxTerrainRequest>& request,
153 VxTerrain::VxPagedTerrainProducer* producer) override;
154
155 //! \brief Called when pending requests for terrain get higher priority
156 //!
157 //! Updates the priority of existing terrain requests to ensure that urgent
158 //! requests are processed first during the next update cycle.
159 //!
160 //! \param request A list of requests to update priority for
161 //! \param producer The current terrain producer
162 virtual void update(const std::vector<VxTerrain::VxTerrainRequest>& request,
163 VxTerrain::VxPagedTerrainProducer* producer) override;
164
165 //! \brief Gets the material mapper
166 //!
167 //! Returns the current material mapper used for translating terrain surface types
168 //! to Vortex material properties.
169 //!
170 //! \return The current material mapper
171 virtual std::shared_ptr<DtSurfaceToVxMaterialMapper> materialMapper() const;
172
173 //! \brief Sets the material mapper
174 //!
175 //! Updates the material mapper used for translating terrain surface types
176 //! to Vortex material properties.
177 //!
178 //! \param val The new material mapper to use
179 virtual void setMaterialMapper(std::shared_ptr<DtSurfaceToVxMaterialMapper> val);
180
181 //! \brief Sort the incoming requests to have the highest priority ones first
182 //!
183 //! Prioritizes terrain requests based on their priority level and submits them
184 //! as asynchronous jobs to the thread pool. This ensures that more important
185 //! terrain cells are generated first.
186 //!
187 //! \param requests List of requests to queue up
188 virtual void queueNewTerrainRequests(const std::vector<VxTerrain::VxTerrainRequest>& requests);
189
190 //! \brief Queues up and manages any new dynamic terrain or terrain regeneration requests
191 //!
192 //! Processes terrain modification requests from the dynamic terrain handler.
193 //! This includes creating new triangle meshes for modified terrain areas
194 //! and queuing them for integration in the next update cycle.
196
197 //! \brief Discards dynamic terrain work created for the current Vortex application.
198 //!
199 //! Pending terrain updates can reference collision geometry that Vortex removes during
200 //! scenario reset, load, or shutdown. This invalidates those updates before cleanup.
201 virtual void resetDynamicTerrain();
202
203 //! \brief Gets the maximum terrain height tolerance check value
204 //!
205 //! Returns the tolerance value used to determine how far above/below
206 //! the terrain to check for collisions.
207 //!
208 //! \return The current terrain height tolerance check value in meters
209 virtual double terrainHeightToleranceCheck() const;
210
211 //! \brief Sets the maximum terrain height tolerance check value
212 //!
213 //! Updates the tolerance value used to determine how far above/below
214 //! the terrain to check for collisions. This value can be configured
215 //! through vortexConfig.lua.
216 //!
217 //! \param val The new terrain height tolerance check value in meters
218 virtual void setTerrainHeightToleranceCheck(double val);
219
220protected:
221 //! \brief Generates a source ID given the minimum x and y coordinate of a request
222 //!
223 //! Creates a unique identifier for a terrain cell based on its position.
224 //! The ID is calculated using the cell's row and column in the terrain grid,
225 //! and is guaranteed to be positive and within a valid range.
226 //!
227 //! \param minXCoordinate The minimum X coordinate of the request
228 //! \param minYCoordinate The minimum Y coordinate of the request
229 //! \return A unique source ID for the terrain cell
230 virtual int generateSourceID(double minXCoordinate, double minYCoordinate);
231
232 //! \brief Helper function for processing queued collision geometries
233 //!
234 //! Processes collision geometries contained in myCellsToInsert and myCellsToModify.
235 //! This includes creating new collision geometries, integrating them into the
236 //! Vortex system, and handling dynamic terrain modifications.
238
239 //! \brief Processes all dynamic terrain events that have been queued up for regeneration
240 //!
241 //! Handles the regeneration of terrain cells that have been modified by dynamic terrain events.
242 //! This includes modifying existing triangle meshes, updating collision geometries,
243 //! and managing affected simulation objects.
244 //!
245 //! \param regenerationData Pair containing the source ID and new triangle mesh
246 //! \return True if the regeneration was successful, false otherwise
247 virtual bool processTerrainRegenerationRequest(const std::pair<int, Vx::VxTriangleMeshBVTree*>& regenerationData);
248
249 //! \brief Processes a terrain request and builds a collision geometry for Vortex
250 //!
251 //! Creates a new terrain cell from a terrain request, extracting triangles from the
252 //! terrain implementation and building a collision geometry for use in Vortex.
253 //! The resulting cell is then queued for insertion in the next update cycle.
254 //!
255 //! \param req The VxTerrainRequest that has been queued for generation
256 //! \param triMesh Optional pre-created triangle mesh to use
257 virtual void processNewTerrainRequest(VxTerrain::VxTerrainRequest req, Vx::VxTriangleMeshBVTree* triMesh = nullptr);
258
259 //! \brief Creates a collision geometry based on the vertices and the surface
260 //!
261 //! Generates a Vortex collision geometry from a triangle output interface,
262 //! either using a provided triangle mesh or creating a new one. The collision
263 //! geometry is configured with appropriate material properties and settings.
264 //!
265 //! \param outputInterface The information of the terrain cell that has been generated
266 //! \param triMeshParam Optional triangle mesh to use for the collision geometry
267 //! \return The created collision geometry
268 virtual Vx::VxCollisionGeometry* createVortexCollisionGeometry(DtVortexTriangleOutputInterface& outputInterface,
269 Vx::VxTriangleMeshBVTree* triMeshParam = nullptr);
270
271 //! \brief Fills out a triangle mesh based on all the triangles from the output interface
272 //!
273 //! Populates a Vortex triangle mesh with vertices, triangles, and material properties
274 //! from a triangle output interface. Handles coordinate conversion between VR-Forces
275 //! and Vortex coordinate systems.
276 //!
277 //! \param outputInterface The information of the terrain cell that has been generated
278 //! \param triMesh The triangle mesh to input all the triangles in
279 virtual void buildTriangleMesh(const std::shared_ptr<DtVortexTriangleOutputInterface> outputInterface,
280 Vx::VxTriangleMeshBVTree* triMesh);
281
282 //! \brief Creates a triangle mesh based on the output interface
283 //!
284 //! Creates and initializes a new Vortex triangle mesh from a triangle output interface.
285 //! The mesh is configured with appropriate settings and then populated with triangles
286 //! by calling buildTriangleMesh.
287 //!
288 //! \param outputInterface The information of the terrain cell that has been generated
289 //! \return A triangle mesh created based on the information
290 virtual Vx::VxTriangleMeshBVTree* createVortexTriangleMesh(DtVortexTriangleOutputInterface& outputInterface);
291
292 //! \brief Gets the terrain process box in terms of geocentric/local terrain
293 //!
294 //! Converts a Vortex bounding box to a terrain process box that can be used
295 //! with the terrain implementation to extract triangles. Handles the conversion
296 //! between Vortex and VR-Forces coordinate systems.
297 //!
298 //! \param bb Vortex request bounds
299 //! \return A terrain process box translated for use in getting triangles
300 virtual DtTerrainProcessPolygonsBox getTerrainProcessBox(const Vx::VxBoundingBox& bb);
301
302 //! \brief Modifies a triangle mesh with z values from a new mesh
303 //!
304 //! Updates the heights (z-values) of vertices in an existing triangle mesh
305 //! based on a new mesh. Only applies changes if the difference exceeds the
306 //! specified tolerance.
307 //!
308 //! \param currentMesh The existing mesh to be modified with updated height values
309 //! \param newMesh The new mesh to get the updated triangles
310 //! \param upAxis The axis representing the up direction
311 //! \param tolerance The tolerance for z-value differences
312 //! \return True if there were deformations, false otherwise
313 virtual bool modifyTriangleMesh(Vx::VxTriangleMeshBVTree* currentMesh,
314 const Vx::VxTriangleMeshBVTree* newMesh,
315 const int upAxis,
316 double tolerance = 0.1);
317
318 //! \brief Compares each triangle from both meshes and checks if they are equal
319 //!
320 //! Determines if two triangle meshes are different by comparing their vertices.
321 //! Vertices are considered equal if their positions differ by less than the
322 //! specified tolerance.
323 //!
324 //! \param meshOne First triangle mesh to compare
325 //! \param meshTwo Second triangle mesh to compare
326 //! \param tolerance The tolerance for considering vertices equal
327 //! \return True if the meshes are different, false if they are the same
329 Vx::VxTriangleMeshBVTree* meshOne, Vx::VxTriangleMeshBVTree* meshTwo, double tolerance = 0.1);
330
331 //! \brief Sets the orphan edges of the triangle mesh to not have an invalid angle between meshes
332 //!
333 //! Fixes orphan edges in a triangle mesh to ensure valid angles between connected triangles.
334 //! This addresses an issue in the Vortex code that can cause incorrect edge handling.
335 //!
336 //! \param triMesh The triangle mesh to fix orphan edges for
337 void fixTriangleMeshOrphanEdges(Vx::VxTriangleMeshBVTree* triMesh);
338
339protected:
340 DtVortexPhysicalWorld* myPhysicalWorld; //!< Pointer to the physical world
341 DtTerrainImplementation* myTerrainImplementation; //!< Pointer to the terrain implementation
342 DtVortexPagedTerrainProducer* myTerrainProducer; //!< Pointer to the terrain producer
343 std::weak_ptr<DtVortexDynamicTerrainHandler> myDynamicTerrainHandler; //!< Pointer to the dynamic terrain handler
344
345 std::shared_ptr<DtSurfaceToVxMaterialMapper>
346 myMaterialMapper; //!< Material mapper for surface to Vortex material conversion
347
348 std::unique_ptr<tbb::task_arena> myDynamicTerrainTaskArena; //!< Task arena for dynamic terrain processing
349
350 double myTerrainHeightToleranceCheck; //!< Height tolerance for terrain checks
351 double myDynamicTerrainRegenerationRetryInterval; //!< Interval for retrying dynamic terrain regeneration
352 int myDynamicTerrainRegenerationFailureCount; //!< Maximum number of failures before giving up on regeneration
353 unsigned int myInitialTriangleVectorSize; //!< Initial size for triangle vectors
354
355 bool myWaitForFutureRequests; //!< Whether to wait for future requests to complete
356
357 // Containers for terrain requests and cells
358 std::atomic<unsigned int> myDynamicTerrainGeneration{0}; //!< Identifies updates owned by the current application
359 NewTerrainRequestQueue myNewTerrainRequests; //!< Queue of new terrain requests
360 tbb::concurrent_vector<VortexCellToInsert> myCellsToInsert; //!< Cells to insert on the next update
361 tbb::concurrent_vector<VortexCellToModify> myCellsToModify; //!< Cells to modify on the next step
362
363 tbb::spin_mutex myCellsToInsertSwapMutex; //!< Protects swap operation on myCellsToInsert (push_back is thread-safe)
364 tbb::spin_mutex myCellsToModifySwapMutex; //!< Protects swap operation on myCellsToModify (push_back is thread-safe)
365};
366} // namespace makVre
Manages dynamic terrain events and updates in the Vortex physics engine.
Definition vortexDynamicTerrainHandler.h:52
void fixTriangleMeshOrphanEdges(Vx::VxTriangleMeshBVTree *triMesh)
Sets the orphan edges of the triangle mesh to not have an invalid angle between meshes.
virtual void queueNewTerrainRequests(const std::vector< VxTerrain::VxTerrainRequest > &requests)
Sort the incoming requests to have the highest priority ones first.
virtual void resetDynamicTerrain()
Discards dynamic terrain work created for the current Vortex application.
tbb::concurrent_vector< VortexCellToInsert > myCellsToInsert
Cells to insert on the next update.
Definition vortexPagedTerrain.h:360
virtual std::shared_ptr< DtSurfaceToVxMaterialMapper > materialMapper() const
Gets the material mapper.
virtual void processQueuedCollisionGeometries()
Helper function for processing queued collision geometries.
std::list< VortexNewTerrainRequest > NewTerrainRequestQueue
Definition vortexPagedTerrain.h:80
virtual void processNewTerrainRequest(VxTerrain::VxTerrainRequest req, Vx::VxTriangleMeshBVTree *triMesh=nullptr)
Processes a terrain request and builds a collision geometry for Vortex.
virtual void queueTerrainRegenerationRequests()
Queues up and manages any new dynamic terrain or terrain regeneration requests.
DtVortexPhysicalWorld * myPhysicalWorld
Pointer to the physical world.
Definition vortexPagedTerrain.h:340
virtual void step(VxTerrain::VxPagedTerrainProducer *producer) override
Called every frame from within the vortex application while running.
virtual void buildTriangleMesh(const std::shared_ptr< DtVortexTriangleOutputInterface > outputInterface, Vx::VxTriangleMeshBVTree *triMesh)
Fills out a triangle mesh based on all the triangles from the output interface.
double myDynamicTerrainRegenerationRetryInterval
Interval for retrying dynamic terrain regeneration.
Definition vortexPagedTerrain.h:351
std::shared_ptr< DtSurfaceToVxMaterialMapper > myMaterialMapper
Material mapper for surface to Vortex material conversion.
Definition vortexPagedTerrain.h:346
virtual void setTerrainHeightToleranceCheck(double val)
Sets the maximum terrain height tolerance check value.
virtual Vx::VxTriangleMeshBVTree * createVortexTriangleMesh(DtVortexTriangleOutputInterface &outputInterface)
Creates a triangle mesh based on the output interface.
virtual bool areTriangleMeshesDifferent(Vx::VxTriangleMeshBVTree *meshOne, Vx::VxTriangleMeshBVTree *meshTwo, double tolerance=0.1)
Compares each triangle from both meshes and checks if they are equal.
virtual double terrainHeightToleranceCheck() const
Gets the maximum terrain height tolerance check value.
unsigned int myInitialTriangleVectorSize
Initial size for triangle vectors.
Definition vortexPagedTerrain.h:353
virtual DtTerrainProcessPolygonsBox getTerrainProcessBox(const Vx::VxBoundingBox &bb)
Gets the terrain process box in terms of geocentric/local terrain.
virtual void setMaterialMapper(std::shared_ptr< DtSurfaceToVxMaterialMapper > val)
Sets the material mapper.
DtVortexPagedTerrainProducer * myTerrainProducer
Pointer to the terrain producer.
Definition vortexPagedTerrain.h:342
NewTerrainRequestQueue myNewTerrainRequests
Queue of new terrain requests.
Definition vortexPagedTerrain.h:359
virtual void produce(const std::vector< VxTerrain::VxTerrainRequest > &request, VxTerrain::VxPagedTerrainProducer *producer) override
Called when new requests for terrain arise.
std::atomic< unsigned int > myDynamicTerrainGeneration
Identifies updates owned by the current application.
Definition vortexPagedTerrain.h:358
tbb::spin_mutex myCellsToModifySwapMutex
Protects swap operation on myCellsToModify (push_back is thread-safe)
Definition vortexPagedTerrain.h:364
virtual Vx::VxCollisionGeometry * createVortexCollisionGeometry(DtVortexTriangleOutputInterface &outputInterface, Vx::VxTriangleMeshBVTree *triMeshParam=nullptr)
Creates a collision geometry based on the vertices and the surface.
double myTerrainHeightToleranceCheck
Height tolerance for terrain checks.
Definition vortexPagedTerrain.h:350
bool myWaitForFutureRequests
Whether to wait for future requests to complete.
Definition vortexPagedTerrain.h:355
virtual void update(const std::vector< VxTerrain::VxTerrainRequest > &request, VxTerrain::VxPagedTerrainProducer *producer) override
Called when pending requests for terrain get higher priority.
tbb::spin_mutex myCellsToInsertSwapMutex
Protects swap operation on myCellsToInsert (push_back is thread-safe)
Definition vortexPagedTerrain.h:363
virtual bool modifyTriangleMesh(Vx::VxTriangleMeshBVTree *currentMesh, const Vx::VxTriangleMeshBVTree *newMesh, const int upAxis, double tolerance=0.1)
Modifies a triangle mesh with z values from a new mesh.
DtVortexPagedTerrainInterface()
Default constructor.
std::weak_ptr< DtVortexDynamicTerrainHandler > myDynamicTerrainHandler
Pointer to the dynamic terrain handler.
Definition vortexPagedTerrain.h:343
virtual int generateSourceID(double minXCoordinate, double minYCoordinate)
Generates a source ID given the minimum x and y coordinate of a request.
virtual bool processTerrainRegenerationRequest(const std::pair< int, Vx::VxTriangleMeshBVTree * > &regenerationData)
Processes all dynamic terrain events that have been queued up for regeneration.
tbb::concurrent_vector< VortexCellToModify > myCellsToModify
Cells to modify on the next step.
Definition vortexPagedTerrain.h:361
DtTerrainImplementation * myTerrainImplementation
Pointer to the terrain implementation.
Definition vortexPagedTerrain.h:341
int myDynamicTerrainRegenerationFailureCount
Maximum number of failures before giving up on regeneration.
Definition vortexPagedTerrain.h:352
std::unique_ptr< tbb::task_arena > myDynamicTerrainTaskArena
Task arena for dynamic terrain processing.
Definition vortexPagedTerrain.h:348
virtual ~DtVortexPagedTerrainInterface() override
Destructor.
Producer that manages terrain in the Vortex physics universe.
Definition vortexPagedTerrainProducer.h:33
Main class responsible for managing the Vortex physics simulation environment.
Definition vortexPhysicalWorld.h:65
Interface for collecting and processing terrain triangles for Vortex.
Definition pagedTerrainRequest.h:83
Export macros for the VR-Forces Vortex extension library.
#define VREVRFVORTEX_DLL
Export macro for non-Windows platforms.
Definition export.h:30
Wheel articulated part IDs used in the system.
Definition surfaceToVxMaterialMapper.h:20
Definition vortexDynamicTerrainHandler.h:36
!
Definition glsVreMessageUtil.h:50
Classes for handling terrain triangle data and requests for the Vortex physics engine.
std::shared_ptr< DtVortexTriangleOutputInterface > newTriangleInterface
Triangle Interface.
Definition vortexPagedTerrain.h:99
VxMath::BoundingBox requestBounds
The bounding box of this request.
Definition vortexPagedTerrain.h:98
Vx::VxTriangleMeshBVTree * newTriangleMesh
The triangle mesh.
Definition vortexPagedTerrain.h:100
int requestId
The request ID associated with the collision geometry.
Definition vortexPagedTerrain.h:117
int sourceId
The source ID this cell collision geometry links to.
Definition vortexPagedTerrain.h:114
Vx::VxCollisionGeometry * collisionGeometry
Legacy non-owning pointer; dynamic updates re-resolve it.
Definition vortexPagedTerrain.h:115
std::vector< DtSimObjectReference > objects
List of objects that will need to be dropped if this is a dynamic terrain event.
Definition vortexPagedTerrain.h:120
unsigned int generation
Dynamic terrain generation that created this update.
Definition vortexPagedTerrain.h:118
Vx::VxTriangleMeshBVTree * newTriangleData
Owned mesh data to apply; cleared after deletion.
Definition vortexPagedTerrain.h:116
Data structure for managing new terrain requests from the Vortex Forecaster.
Definition vortexPagedTerrain.h:75
int priority
Priority level of the request.
Definition vortexPagedTerrain.h:77
int requestId
Unique identifier for the request.
Definition vortexPagedTerrain.h:78
std::shared_future< void > future
Future object for asynchronous processing.
Definition vortexPagedTerrain.h:76
Provides mapping functionality between VR-Forces terrain surface types and Vortex physics materials.
Defines the base class for all VREngage messages.