VR-Engage  2.2
Loading...
Searching...
No Matches
vreIndLocalNetIfWithProperties.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreIndLocalNetIfWithProperties.h
7//! \ingroup vreVrfVrlinkNetworkInterface
8//! \brief Enhanced local entity network interface for VREngage
9//!
10//! This file defines the DtVreIndividualLocalEntityNetInterface class, which extends
11//! the standard network interface with VREngage-specific functionality, particularly
12//! for player-controlled entities to improve network update fidelity.
13
14#pragma once
15
17
18#include <vrlinkNetworkInterface/simIndividualLocalEntityWithPropertiesNetInterface.h>
19
20//! \brief Enhanced local entity network interface for VREngage
21//!
22//! This class replaces the default local entity network interface, which is responsible
23//! for copying internal entity state to the VR-Link publisher which outputs that data to
24//! the network. It forces an update each frame when the entity is player-controlled
25//! to improve fidelity for that particular entity, ensuring smoother player movement
26//! and interactions in networked simulations.
27
28namespace makVre
29{
30//! \brief Enhanced local entity network interface for VREngage
31//!
32//! This class implements a specialized network interface for local entities in VREngage.
33//! It extends the standard interface with VREngage-specific functionality, particularly
34//! for improving the network update rates of player-controlled entities to ensure
35//! smoother movement and interactions in networked simulations.
37 : public makVrf::DtSimIndividualLocalEntityWithPropertiesNetInterface
38{
39public:
40 //! \brief Constructor
41 //! \param vrfObject The state data object for the entity
42 //! \param mgr The VRLink network interface manager
43 //! \param publishObject Flag indicating whether this object should be published (default: true)
44 //!
45 //! Initializes a new network interface for the specified entity with VREngage-specific
46 //! enhancements for network publication.
48 makVrf::DtStateData* vrfObject, makVrf::DtVrlinkNetworkInterface* mgr, bool publishObject = true);
49
50 //! \brief Destructor
51 //!
52 //! Cleans up resources used by the network interface.
54
55 //! \brief Updates the VR-Link publisher with current entity state
56 //!
57 //! Copies entity state data from the VR-Forces state components into the
58 //! VR-Link state repository for publication to the network. This implementation
59 //! enhances the update behavior for player-controlled entities to improve network
60 //! fidelity of movement and other state changes.
61 //!
62 //! \note For player-controlled entities, this function forces an update on every frame
63 //! regardless of internal change detection, ensuring smoother network representation.
64 virtual void updatePublisher();
65
66 //! \brief Gets the type identifier for this network interface
67 //! \return String identifying this network interface type
68 //!
69 //! Returns a unique type identifier string for this custom network interface.
70 //! This is overridden to completely replace the default VR-Forces interface in
71 //! the interface factory system.
72 virtual DtString type() const;
73
74 //! \brief Factory function to create a new instance of this interface
75 //! \param vrfObject The state data object for the entity
76 //! \param mgr The VRLink network interface manager
77 //! \param publishObject Flag indicating whether this object should be published
78 //! \return Pointer to the newly created network interface
79 //!
80 //! Static factory function used by the interface creation system to instantiate
81 //! new instances of this network interface type.
82 static DtSimObjectNetInterface* creator(
83 makVrf::DtStateData* vrfObject, makVrf::DtVrlinkNetworkInterface* mgr, bool publishObject);
84
85protected:
86 //! \brief Determines if the entity is currently player-controlled
87 //! \return True if the entity is player-controlled, false otherwise
88 //!
89 //! Checks if the entity is currently being controlled by a player in any role.
90 //! This is determined by examining the extended data map for an entry starting
91 //! with the string "role-" and having a non-empty string value, which indicates
92 //! that a player is assigned to the entity in some capacity.
93 virtual bool isPlayerControlled();
94
95private:
96 //! \brief Default constructor (not implemented)
97 //!
98 //! Default constructor is private and not implemented to prevent
99 //! creation of instances without proper initialization.
101
102 //! \brief Copy constructor (not implemented)
103 //! \param orig The source object
104 //!
105 //! Copy constructor is private and not implemented to prevent copying.
107
108 //! \brief Assignment operator (not implemented)
109 //! \param orig The source object
110 //! \return Reference to this object
111 //!
112 //! Assignment operator is private and not implemented to prevent assignment.
114};
115} // namespace makVre
DtVreIndividualLocalEntityNetInterface(makVrf::DtStateData *vrfObject, makVrf::DtVrlinkNetworkInterface *mgr, bool publishObject=true)
Constructor.
const DtVreIndividualLocalEntityNetInterface & operator=(const DtVreIndividualLocalEntityNetInterface &orig)
Assignment operator (not implemented)
virtual void updatePublisher()
Updates the VR-Link publisher with current entity state.
virtual bool isPlayerControlled()
Determines if the entity is currently player-controlled.
virtual DtString type() const
Gets the type identifier for this network interface.
virtual ~DtVreIndividualLocalEntityNetInterface()
Destructor.
DtVreIndividualLocalEntityNetInterface()
Default constructor (not implemented)
DtVreIndividualLocalEntityNetInterface(const DtVreIndividualLocalEntityNetInterface &orig)
Copy constructor (not implemented)
static DtSimObjectNetInterface * creator(makVrf::DtStateData *vrfObject, makVrf::DtVrlinkNetworkInterface *mgr, bool publishObject)
Factory function to create a new instance of this interface.
Include export definitions for this library.
Definition glsVreMessageUtil.h:49