VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ballisticGunJoy.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1999 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
14 #include "vrfmodel/ballisticGun.h"
17 #include "vrfcore/timer.h"
18 
21 class DtBooleanInputPort;
23 
24 namespace makVrf
25 {
26  class DtArticulatedPartStateRepository;
27 }
28 
29 const char DtBallisticGunJoyActuatorType[] = "ballistic-gun-joystick-actuator";
30 
36 {
37 public:
38 
43  DtReaderWriterRegistry * const parentRegistry = 0);
44 
45 public:
47  virtual ~DtBallisticGunJoy() override;
48 
51  virtual const char* type() const override;
52 
54  virtual bool createPorts() override;
55 
58  virtual void setComponentDescriptor(DtComponentDescriptor* descriptor) override;
59 
62  virtual void tick() override;
63 
68  virtual DtReal setTarget(makVrf::DtArticulatedPartStateRepository *rotBody);
69 
76 
78  makVrf::DtArticulatedPartStateRepository* rotBody, DtReal& detTime, DtReal dist);
79 
86  virtual DtUUID targetSelection(
87  makVrf::DtArticulatedPartStateRepository* rotBody, DtReal& dist);
88 
89  virtual DtReal distanceToTarget();
90 
98  static void detonationCallback(DtTimer * timer);
99 
103  static DtSimComponent * creator(const DtString& name,
104  DtLocalObject* owner,
105  DtSimulationServices* simManager,
106  DtComponentDescriptor* desc = 0,
107  DtReaderWriterRegistry* parentRegistry = 0);
108 
109 private:
113 
115  DtBallisticGunJoy(const DtBallisticGunJoy & orig);
116 
118  const DtBallisticGunJoy & operator=(const DtBallisticGunJoy & orig);
119 
120 protected:
121 
124 
131 
138 
140 
141  // A flag to remember whether a warning message was printed about
142  // not finding an articulated part.
144 };
145 
UUID is a unique ID wrapper class.
Definition: uuid.h:59
DtBallisticGunJoy extends the DtBallisticGun actuator class with the ability to be controlled from a ...
Definition: ballisticGunJoy.h:35
DtBooleanInputPort * myActiveJoystickPort
Input Port Name: joystick-active Input Port Description: Input Port Range: Input Port Default Value...
Definition: ballisticGunJoy.h:137
const char DtBallisticGunJoyActuatorType[]
Definition: ballisticGunJoy.h:29
Instances of DtTimer are used to maintain the information needed to represent some kind of scheduled ...
Definition: timer.h:38
virtual void tick() override
Fire and detonate. It detects if we need to use local or parent function depending on joystick enable...
virtual const char * type() const override
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual ~DtBallisticGunJoy() override
destructor
Definition: fireEvent.h:16
DtBallisticGun provides a simple model of a ballistic gun.
Definition: ballisticGun.h:43
Contains class declarations for DtConstrainedAnalogInputPort and DtConstrainedAnalogOutputPort.
Definition: constrainedAnalogIOPort.h:30
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
DtBallisticGunJoy()
Default constructor; should not be called. Here because the compiler will generate an unprotected one...
DtConstrainedAnalogInputPort * myElevationPort
Input Port Name: elevation Input Port Description: Input Port Range: -1. to 1. Input Port Default Va...
Definition: ballisticGunJoy.h:130
Definition: detonationEvent.h:20
virtual void setComponentDescriptor(DtComponentDescriptor *descriptor) override
Override so we can extract the values we want and set our pointer. Calls down to the base class's set...
DtBallisticGunDescriptor; a descriptor for the DtBallisticGun component.
Definition: ballisticGunDescriptor.h:36
virtual bool createPorts() override
Creates myElevationPort.
static void detonationCallback(DtTimer *timer)
Casts the user data portion of the DtTimer passed to it to a DtDetonationTimerData object...
const DtBallisticGunJoy & operator=(const DtBallisticGunJoy &orig)
assignment operator; see comments on copy constructor!
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual DtUUID targetSelection(makVrf::DtArticulatedPartStateRepository *rotBody, DtReal &dist)
Casts a ray out from the gun to a point MAX_RANGE away, where MAX_RANGE is 4000m currently. Determines, using physicalWorld->getVrfObjectsAlongChord(), if there are any platforms, lifeforms, or cultural features on the ray. Returns the first one found, and the range. Parameter rotBody should be the SR of the gun articulated part, if there is one; otherwise, the entity SR.
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
VRF4API_METHOD const DtSimulationServices * simManager() const
This is the deprecated API that can be used as a reference to migrate 4.X code to 5...
Definition: simComponent.h:583
virtual DtReal setTarget(makVrf::DtArticulatedPartStateRepository *rotBody)
Uses targetSelection() to try to find an entity in the gun's line of fire; if it finds one...
The DtArticulatedPartStateRepository class is used to represent articulated parts for an entity...
Definition: articulatedPartStateRepository.h:40
bool myReportedNoArticulation
Definition: ballisticGunJoy.h:143
virtual makVrfEvents::DtDetonationEvent * manualDetonationInteraction(makVrf::DtArticulatedPartStateRepository *rotBody, DtReal &detTime, DtReal dist)
virtual makVrfEvents::DtFireEvent * manualFireInteraction(makVrf::DtArticulatedPartStateRepository *rotBody)
Creates a fire interaction. Uses the currentTarget in the PSR as the fire target, if present...
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
virtual DtReal distanceToTarget()
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)