VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtControlSurfacesActuator Class Reference

Detailed Description

DtControlSurfacesActuator manages the articulated parts for fixed wing flight control surfaces such as rudder, ailerons, elevators, and flaps. It receives control inputs through input ports and applies the appropriate deflection values to the corresponding articulated parts.

Uses Descriptor Type: DtActuatorComponentDescriptor

#include <controlSurfacesActuator.h>

Inheritance diagram for makVre::DtControlSurfacesActuator:
[legend]

Classes

struct  PortData
 

Public Member Functions

 DtControlSurfacesActuator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtControlSurfacesActuator () override
 
virtual const char * type () const override
 
virtual bool postAddComponentsInit () override
 
virtual void tick () override
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtActuatorComponent >
 DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreSimComponent ()
 
bool isPlayerControlled (const std::string &role="") const
 
DtString entitySystemName () const
 

Static Public Member Functions

static DtSimComponent * creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 

Protected Member Functions

virtual bool createPorts () override
 
virtual bool createPortGroups () override
 

Protected Attributes

std::map< std::string, PortDatamyPorts
 
DtInputPortGroup * myControlSurfacesInputGroup
 
bool myPlayerControlled
 

Private Member Functions

 DtControlSurfacesActuator ()
 
 DtControlSurfacesActuator (const DtControlSurfacesActuator &orig)
 
const DtControlSurfacesActuatoroperator= (const DtControlSurfacesActuator &orig)
 

Constructor & Destructor Documentation

◆ DtControlSurfacesActuator() [1/3]

makVre::DtControlSurfacesActuator::DtControlSurfacesActuator ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor.

Parameters
nameThe name of this component
ownerThe local object that owns this component
simManagerThe simulation services manager
descOptional component descriptor
parentRegistryOptional parent registry for reader/writer functionality

Creates a new control surfaces actuator component with the specified parameters.

Referenced by DtControlSurfacesActuator(), and operator=().

◆ ~DtControlSurfacesActuator()

virtual makVre::DtControlSurfacesActuator::~DtControlSurfacesActuator ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the control surfaces actuator component.

◆ DtControlSurfacesActuator() [2/3]

makVre::DtControlSurfacesActuator::DtControlSurfacesActuator ( )
private

Default constructor (not implemented)

Default constructor is private and not implemented to prevent creation of instances without proper initialization.

◆ DtControlSurfacesActuator() [3/3]

makVre::DtControlSurfacesActuator::DtControlSurfacesActuator ( const DtControlSurfacesActuator & orig)
private

Copy constructor (not implemented)

Copy constructor is private and not implemented to prevent copy construction.

References DtControlSurfacesActuator().

Member Function Documentation

◆ type()

virtual const char * makVre::DtControlSurfacesActuator::type ( ) const
overridevirtual

Gets the type identifier for this component.

Returns
String identifying the component type (DtControlSurfacesActuatorType)

Implements the DtSimComponent::type() method to return the type identifier for this component.

◆ postAddComponentsInit()

virtual bool makVre::DtControlSurfacesActuator::postAddComponentsInit ( )
overridevirtual

Performs post-component-addition initialization.

Returns
True if initialization is successful, false otherwise

Gets and caches references to the articulated part repositories for each control surface after all components have been added.

◆ tick()

virtual void makVre::DtControlSurfacesActuator::tick ( )
overridevirtual

Updates control surface positions each simulation frame.

Reads current input port values and applies the appropriate deflection to each control surface articulated part. When player control is lost, it will run one additional tick to reset surfaces to neutral positions.

◆ creator()

static DtSimComponent * makVre::DtControlSurfacesActuator::creator ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )
static

Factory method to create a new instance of this component.

Parameters
nameThe name for the new component
ownerThe local object that will own this component
simManagerThe simulation services manager
descOptional component descriptor
parentRegistryOptional parent registry for reader/writer functionality
Returns
Pointer to the newly created component

Static factory method used by the component creation system to instantiate new instances of this component type.

◆ operator=()

const DtControlSurfacesActuator & makVre::DtControlSurfacesActuator::operator= ( const DtControlSurfacesActuator & orig)
private

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtControlSurfacesActuator().

◆ createPorts()

virtual bool makVre::DtControlSurfacesActuator::createPorts ( )
overrideprotectedvirtual

Creates input ports for control surfaces.

Returns
True if ports were created successfully, false otherwise

Creates the input ports for each defined control surface and adds them to the control surfaces port group.

◆ createPortGroups()

virtual bool makVre::DtControlSurfacesActuator::createPortGroups ( )
overrideprotectedvirtual

Creates port groups for organizing input ports.

Returns
True if port groups were created successfully, false otherwise

Creates a port group called "control-surfaces" to organize all control surface input ports.

Member Data Documentation

◆ myPorts

std::map<std::string, PortData> makVre::DtControlSurfacesActuator::myPorts
protected

Map of control surface names to their port and articulated part data.

Maps each control surface name (e.g., "rudder", "aileron") to its corresponding PortData structure containing input port and art part references.

◆ myControlSurfacesInputGroup

DtInputPortGroup* makVre::DtControlSurfacesActuator::myControlSurfacesInputGroup
protected

Port group for control surface inputs.

Groups all control surface input ports under the "control-surfaces" group for easier organization and access.

◆ myPlayerControlled

bool makVre::DtControlSurfacesActuator::myPlayerControlled
protected

Flag indicating if this entity is currently player-controlled.

Tracks whether the entity is currently under player control. When control is lost, this allows the actuator to tick one more time to reset control surfaces to neutral positions.


The documentation for this class was generated from the following file: