19#include <readerWriter/rwReal.h>
20#include <readerWriter/rwVector.h>
22#include <vrfobjcore/simObjectReference.h>
24#include <vrfutil/rwEntityType.h>
49 DtProjectile(
const DtString& name, DtReaderWriterRegistry*
const parentRegistry = NULL);
56 DtProjectile(
const DtSymbolString& name, DtReaderWriterRegistry*
const parentRegistry = NULL);
202 virtual void putData(std::string& fp,
int indentLevel = 0)
override;
207 const DtReaderWriter::SearchPaths& searchPaths,
208 const DtVariableBindingsList& variableBindings)
override;
232 const char*
type,
const char* pName, DtReaderWriterRegistry*
const parentRegistry = NULL);
Class representing the result of a projectile detonation.
Definition projectileDetonationResult.h:33
Factory for creating projectile objects.
Definition projectileFactory.h:42
DtRwReal myCrossSection
The cross-sectional area of the projectile.
Definition projectile.h:273
DtRwReal myDragCoefficient
The drag coefficient of the projectile.
Definition projectile.h:279
virtual ProjectileUpdateResult updateProjectilePosition(double deltaTime)
Updates the projectile's position based on physics.
virtual ~DtProjectile() override
Virtual destructor.
Definition projectile.h:68
virtual void setPosition(DtVector position)
Sets the projectile position.
virtual DtString type() const
Returns the class type of projectile. Used to create the correct class type of projectile object on r...
DtProjectile()
Default constructor (not implemented)
virtual void setCrossSection(double crossSection)
Sets the projectile cross-section.
virtual DtProjectile * clone() const
Creates a clone of this projectile.
static DtProjectile * createProjectile(DtlObjPtr mtlStream)
Creates and initializes a projectile when reading in from an MTL (MAK Technologies Lisp) file (i....
virtual DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) override
getData is just used to get us past the type in the data stream, since it's not actually stored.
static DtProjectileFactory * theFactory
Factory for creating projectile instances.
Definition projectile.h:327
static void addProjectileCreatorFcn(const std::string &type, makVre::DtProjectileCreatorFcn fcn)
Adds a given projectile creation function and corresponding type to the DtProjectileFactory.
DtProjectile(const DtString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
Constructor with string name.
static DtProjectileFactory * factory()
The factory for creating objects of type DtProjectile. The factory is used to generate projectiles on...
virtual DtProjectileDetonationResult update(double deltaTime)
Updates the projectile's state for the current frame.
virtual void setMaxRange(double maxRange)
Sets the maximum range.
DtProjectile(const DtSymbolString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
Constructor with symbol string name.
DtSimObject * myFiringEntity
Pointer to the entity that fired this projectile.
Definition projectile.h:315
DtRwEntityType myMunitionType
The DIS entity type of the munition.
Definition projectile.h:267
static DtProjectile * createProjectile(const char *type, const char *pName, DtReaderWriterRegistry *const parentRegistry=NULL)
Creates and initializes a new instance of this class.
virtual void setFiringEntity(DtSimObject *firingEntity)
Sets the firing entity.
DtRwReal myMaxRange
The maximum range of the projectile in meters.
Definition projectile.h:291
DtRwReal myMass
The mass of the projectile in kilograms.
Definition projectile.h:284
static void setFactory(DtProjectileFactory *factory)
The factory for creating objects of type DtProjectile. The factory is used to generate projectiles on...
DtRwVector myVelocity
The current velocity of the projectile.
Definition projectile.h:303
virtual const DtEntityType & munitionType()
Gets the munition type.
Definition projectile.h:189
DtProjectile & operator=(const DtProjectile &orig)
Assignment operator.
virtual void setMunitionType(const DtEntityType &munitionType)
Sets the munition type.
virtual void setDragCoefficient(double dragCoefficient)
Sets the drag coefficient.
virtual DtVector velocity()
Gets the projectile velocity.
Definition projectile.h:195
bool operator!=(const DtProjectile &rhs)
Inequality operator.
Definition projectile.h:95
DtPhysicalWorld * myPhysicalWorld
Pointer to the physical world.
Definition projectile.h:321
DtRwVector myPosition
The current position of the projectile.
Definition projectile.h:297
virtual void setVelocity(DtVector velocity)
Sets the projectile velocity.
DtProjectile(const DtProjectile &orig, DtReaderWriterRegistry *const parentRegistry=NULL)
Copy constructor.
virtual void setMass(double mass)
Sets the projectile mass.
static DtProjectile * creator(const DtString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
virtual void setPhysicalWorld(DtPhysicalWorld *physicalWorld)
Sets the physical world.
bool operator==(const DtProjectile &) const
Equality operator.
virtual void setDistanceTraveled(double distanceTraveled)
Sets the distance traveled.
DtRwReal myDistanceTraveled
The total distance the projectile has traveled.
Definition projectile.h:310
virtual void putData(std::string &fp, int indentLevel=0) override
Overrides base class putData to output our type.
virtual DtProjectileDetonationResult checkForProjectileCollision(const ProjectileUpdateResult &projectUpdateResult)
Checks if the projectile has collided with anything.
Export macros for the VREngage Object Core library.
#define VREVRFOBJCORE_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtProjectile *(*)(const DtString &name, DtReaderWriterRegistry *const parentRegistry) DtProjectileCreatorFcn
Function pointer type for projectile creation functions.
Definition projectileFactory.h:34
const char DtProjectileType[]
Type identifier string for the projectile class.
Definition projectile.h:33
Projectile detonation result class for VREngage.
Structure containing projectile update results.
Definition projectile.h:108
DtVector lastPosition
Last position of the projectile before the update.
Definition projectile.h:113
double distanceTraveledInFrame
Distance traveled in the current frame in meters.
Definition projectile.h:110