VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ballisticGunJoyController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
15 #include "vrfobjcore/simRadio.h"
17 
20 class DtOutputPortGroup;
22 
29 {
30 
31 public:
32 
37  DtReaderWriterRegistry * const parentRegistry = 0);
38 
40  virtual ~DtBallisticGunJoyController();
41 
44  virtual const char* type() const;
45 
48  virtual bool createActiveJoystickPort();
49  virtual DtBooleanOutputPort * activeJoystickPort() const;
50 
51  virtual bool createElevationPort();
52  virtual DtConstrainedAnalogOutputPort * elevationPort() const;
53 
54  virtual bool chooseAmmo(DtString name = DtString::nullString());
55 
56  virtual bool canFire();
57 
61  static DtSimComponent * creator(const DtString& name,
62  DtLocalObject* owner,
63  DtSimulationServices* simManager,
64  DtComponentDescriptor* desc = 0,
65  DtReaderWriterRegistry* parentRegistry = 0);
66 
67 protected:
68  virtual void tick();
69 
70  virtual void calcAndSetPortValues(const DtString& functionGroup, const DtString& function, double value, bool repeat);
71  virtual void joystickConnected();
72  virtual void joystickDisconnected();
73 
75  virtual bool createPorts();
76 
77 private:
78 
81 
84 
87  orig);
88 
89 protected:
90 
93 
100 
108 
110 
111  bool myFiring;
113 };
114 
115 
DtConstrainedAnalogOutputPort * myElevationPort
Output Port Name: elevation Output Port Description: Output Port Range: -1. to 1. Output Port Default Value: Output Group Parent:
Definition: ballisticGunJoyController.h:99
virtual const char * type() const
Returns a string identifies the class type of component. Type values are defined in compTypes...
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
DtConstrainedAnalogOutputPort is a version of DtAnalogOutputPort which will constrain any outgoing va...
Definition: constrainedAnalogIOPort.h:57
bool myFireButtonDown
Definition: ballisticGunJoyController.h:112
virtual void joystickDisconnected()=0
Called when joystick is disconnected for this controller.
!!!!!!!!!!!! DtJoyDeviceControllerDescriptor
Definition: joyDeviceControllerDescriptor.h:93
virtual bool createPorts()
Called by init to create the output ports.
virtual void joystickConnected()=0
Called when joystick is connected for this controller.
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
DtBallisticGunController provides ammunition loading, unloading, and trigger inputs for use by a ball...
Definition: ballisticGunController.h:44
DtBallisticGunJoyController extends the DtBallisticGunController class with the ability to be control...
Definition: ballisticGunJoyController.h:28
const DtBallisticGunController & operator=(const DtBallisticGunController &orig)
Not implemented.
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
virtual bool chooseAmmo(const DtEntityType &targetType, const DtUUID &target, DtSimMunition &munition, DtDetonatorFuze &fuze, int &ammoAvailable)
The chooseAmmo() function is passed a pointer to a target entity and returns the best ammunition to u...
virtual void calcAndSetPortValues(const DtString &functionGroup, const DtString &function, double value, bool repeat)=0
Override to set.
DtBooleanOutputPort * myActiveJoystickPort
Output Port Name: joystick-active Output Port Description: Indicates whether controller behavior is b...
Definition: ballisticGunJoyController.h:107
Will manage basic functionality of a joystick controller. Implement pure virtual functions to respons...
Definition: joystickControllerInterface.h:23
bool myFiring
Definition: ballisticGunJoyController.h:111
virtual void tick()
Calculate new control values.
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)