VR-Forces 4.0.4 Class Documentation
include/vrfmodel/surfEntAct.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2002 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: surfEntAct.h,v $ $Revision: 1.39 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00013 
00014 #ifndef DtSurfaceEntityActuator_H_
00015 #define DtSurfaceEntityActuator_H_
00016 
00017 #include "vrfobjcore/actCmpnt.h"
00018 #include "vrfobjcore/vrfKinState.h"
00019 
00020 class DtString;
00021 class DtSimManager;
00022 class DtSurfaceEntityStateRepository;
00023 class DtSurfaceEntityActuatorDescriptor;
00024 class DtConstrainedAnalogInputPort;
00025 class DtBooleanOutputPort;
00026 class DtSurfaceMovementPSR;
00027 
00028 
00050 #include "vrfmodel/vrfmodelDefines.h"
00051 class DT_DLL_vrfmodel DtSurfaceEntityActuator : public DtActuatorComponent
00052 {
00053 
00054 public:
00055 
00059    DtSurfaceEntityActuator (const DtString& name, 
00060       DtVrfObject* owner,
00061       DtSimManager* simManager, 
00062       DtComponentDescriptor* desc = 0,
00063       DtReaderWriterRegistry* parentRegistry = 0);
00064 
00069    virtual ~DtSurfaceEntityActuator();
00070 
00073    virtual bool init();
00074 
00077    virtual DtString type() const;
00078 
00081    virtual bool postAddComponentsInit();
00082 
00085    virtual void initProcessSR();
00086 
00114    virtual void tick();
00115  
00121    virtual double calculateRudderYawAcceleration();
00122    
00127    virtual double calculateResistanceYawAcceleration();
00128    
00136    virtual const DtVector calculateThrottleAcceleration();
00137 
00142    virtual const DtVector calculateDragAcceleration();
00143 
00149    virtual bool clampSmallVelocityToZero();
00150 
00153    virtual double stoppingSpeed();
00154 
00161    virtual void useFuel(double fuelUsed);
00162 
00168    virtual double fuelLeft() const;
00169 
00173    static DtSimComponent * creator(const DtString& name, 
00174       DtVrfObject* owner,
00175       DtSimManager* simManager, 
00176       DtComponentDescriptor* desc = 0,
00177       DtReaderWriterRegistry* parentRegistry = 0);
00178 
00179 protected:
00180    
00183    virtual bool createPortGroups();
00184 
00187    virtual bool createPorts();
00188 
00193    virtual void integratePosition(double dT);
00194 
00201    virtual void integrateOrientation(double dT);
00202 
00206    void constrainYawAcceleration(double& yawAcceleration, double yawRate,
00207       double maxYawRate, double dT);
00208 
00212    virtual void updateRepository();
00213 
00214    DtSurfaceEntityStateRepository * surfaceEntityState (void) const;
00215 
00221    virtual bool createPSR();
00222 
00223 protected:
00224    
00226    DtSurfaceEntityActuator();
00227 
00229    DtSurfaceEntityActuator
00230       (const DtSurfaceEntityActuator & orig);
00231 
00233    const DtSurfaceEntityActuator & operator=
00234       (const DtSurfaceEntityActuator & orig);
00235 
00236 
00237 protected:
00238 
00239    DtSurfaceEntityStateRepository * mySurfaceEntityState;
00240    DtSurfaceEntityActuatorDescriptor * mySurfaceEntityActuatorDescriptor;
00241 
00244 
00247    DtInputPortGroup* mySurfaceControlPortGroup;
00248 
00254    DtConstrainedAnalogInputPort* myThrottlePort;
00255 
00261    DtConstrainedAnalogInputPort* myRudderPort;
00262 
00266    DtBooleanOutputPort * mySmallVelocityClampedPort;
00267 
00269 
00270    DtDcm myBodyToLocalMatrix;
00271    DtDcm myLocalToBodyMatrix;
00272 
00273    DtVector myLocalPosition;
00274    DtVector myRelativeVelocity;
00275    DtVector myRelativeAcceleration;
00276    DtTaitBryan myOrientation;
00277    DtVector myBodyRotationRates;
00278    DtVector myBodyRotationalAcceleration;
00279 
00282    DtSurfaceMovementPSR* myProcessState;
00283 
00284    bool myOutOfFuelWarningPrinted;
00285 };
00286 
00287 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)