VR-Engage  2.2
Loading...
Searching...
No Matches
vreBallisticGunJoyController.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreBallisticGunJoyController.h
7//! \ingroup vreVrfmodel
8//! \brief Controller for ballistic guns with joystick input support
9//!
10//! This file defines the DtVreBallisticGunJoyController class which extends the base
11//! ballistic gun controller with the ability to be controlled from a joystick.
12//! It provides mechanisms for handling joystick input to control gun aiming and firing.
13
14#pragma once
15
16#include "vreVrfmodel/export.h"
18
20
21namespace makVre
22{
23
24//! \brief Type identifier for the VRE ballistic gun joy controller component
25const char DtVreBallisticGunJoyControllerType[] = "vre-ballistic-gun-joy-controller";
26
27//! \brief Controller for ballistic guns with joystick support
28//!
29//! DtVreBallisticGunJoyController extends the DtBallisticGunController class
30//! with the ability to be controlled from a joystick. It processes joystick
31//! inputs to control gun aiming, elevation adjustment, and firing operations.
32//! The controller responds to joystick events by updating the appropriate
33//! control parameters for the underlying ballistic gun.
34//!
35//! Uses Descriptor Type: DtBallisticGunJoyControllerDescriptor
36class VREVRFMODEL_DLL DtVreBallisticGunJoyController : public DtVreSimComponent<DtBallisticGunJoyController>
37{
38public:
39 //! \brief Constructor
40 //! \param name The name of this component
41 //! \param owner The local object that owns this component
42 //! \param simManager The simulation services manager
43 //! \param desc Component descriptor with configuration parameters
44 //! \param parentRegistry Optional parent registry for reader/writer functionality
45 //!
46 //! Creates a new ballistic gun joy controller component with the specified parameters.
47 DtVreBallisticGunJoyController(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
48 DtComponentDescriptor* desc, DtReaderWriterRegistry* const parentRegistry = 0);
49
50 //! \brief Virtual destructor
51 //!
52 //! Cleans up resources used by the ballistic gun joy controller component.
54
55 //! \brief Gets the type identifier for this component
56 //! \return String identifying the component type (DtVreBallisticGunJoyControllerType)
57 //!
58 //! Implements the DtSimComponent::type() method to return the
59 //! type identifier for this component.
60 virtual const char* type() const override { return DtVreBallisticGunJoyControllerType; }
61
62 //! \brief Factory method to create a new instance of this component
63 //! \param name The name for the new component
64 //! \param owner The local object that will own this component
65 //! \param simManager The simulation services manager
66 //! \param desc Optional component descriptor
67 //! \param parentRegistry Optional parent registry for reader/writer functionality
68 //! \return Pointer to the newly created component
69 //!
70 //! Static factory method used by the component creation system to instantiate
71 //! new instances of this component type.
72 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
73 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
74
75protected:
76 //! \brief Updates the controller state each simulation frame
77 //!
78 //! Processes joystick input and updates the gun's aiming and firing state.
79 //! This method is called each simulation frame to maintain continuous control
80 //! of the gun based on current joystick inputs.
81 virtual void tick() override;
82
83private:
84 //! \brief Default constructor (not implemented)
85 //!
86 //! Default constructor is private and not implemented to prevent
87 //! creation of instances without proper initialization.
89
90 //! \brief Copy constructor (not implemented)
91 //!
92 //! Copy constructor is private and not implemented to prevent
93 //! copy construction.
95
96 //! \brief Assignment operator (not implemented)
97 //! \return Reference to this object
98 //!
99 //! Assignment operator is private and not implemented to prevent assignment.
101};
102
103} // namespace makVre
Controller for ballistic guns with joystick input support.
DtVreBallisticGunJoyController(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *const parentRegistry=0)
Constructor.
virtual void tick() override
Updates the controller state each simulation frame.
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Factory method to create a new instance of this component.
DtVreBallisticGunJoyController()
Default constructor (not implemented)
virtual ~DtVreBallisticGunJoyController() override
Virtual destructor.
const DtVreBallisticGunJoyController & operator=(const DtVreBallisticGunJoyController &orig)
Assignment operator (not implemented)
virtual const char * type() const override
Gets the type identifier for this component.
Definition vreBallisticGunJoyController.h:60
DtVreBallisticGunJoyController(const DtVreBallisticGunJoyController &orig)
Copy constructor (not implemented)
DtVreSimComponent(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Definition vreSimComponent.h:54
Defines export macros for the vreVrfmodel library.
#define VREVRFMODEL_DLL
Definition export.h:22
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
const char DtVreBallisticGunJoyControllerType[]
Type identifier for the VRE ballistic gun joy controller component.
Definition vreBallisticGunJoyController.h:25
Base template class for VR-Engage simulation components.