#include <_src_object_aircraft.hh>

Public Types | |
| enum | { MODEL_AXIS_PITCH = ZZ, MODEL_AXIS_ROLL = XX, MODEL_AXIS_YAW = YY } |
| enum | eState { eState_PARKED, eState_TAKEOFF, eState_FLYING, eState_LANDING } |
Public Member Functions | |
| virtual | ~Aircraft () |
| CLASS_METHOD shptr< Graph > | LoadModel (const AircraftSpecs &specs, const bool loadCopy) |
| virtual void | Reset (void) |
| virtual const string | GetName (void) |
| virtual void | SetPosition (const WorldVertex &position) |
| virtual void | Translate (uint axis, fp inc) |
| virtual void | Translate (const Vector3 &v) |
| virtual void | Rotate (uint axis, Radian rad) |
| virtual void | SetMatrix (const Matrix &matrix, Dyna::eMatrixChange change) |
| virtual void | PhysicalRotate (uint axis, fp controlFraction, Milliseconds controlFreq) |
| virtual void | RotateControlSurfaces (const uint axis, const fp frac) |
| virtual void | SetThrottle (const fp throttle) |
| virtual fp | GetThrottle (void) |
| virtual void | EnableBrakes (const bool enable) |
| virtual bool | IfBrakes (void) |
| virtual bool | IfWheelBrakes (void) |
| virtual bool | IfAirBrakes (void) |
| virtual void | SetLandingGear (const bool down) |
| virtual bool | IfLandingGear (void) |
| virtual void | SwingWings (const float fraction) |
| virtual void | SwingBayDoors (const float fraction) |
| virtual AircraftPhysics & | GetPhysics (void) |
| void | EnableCoordinatedTurn (const bool enable) |
| bool | IfCoordinatedTurnEnabled (void) const |
| bool | IfCoordinatedTurnExecuting (void) const |
| virtual void | PlayEngineSound (const fp volume) |
| virtual void | StopEngineSound (void) |
| virtual void | SetShadowCaster (const bool enable=true) |
| virtual void | SetState (const eState state) |
| virtual eState | GetState (void) |
| bool | IfFlying (void) |
| virtual void | SetCollision (const Object::eCollision collision) |
| virtual bool | IfCollisionRunway (void) |
| virtual NodeSort | GetNodeSort (void) |
| virtual fp | GetHeight (void) |
| bool | IfCanSetLandingGear (const bool down) |
| virtual const AircraftSpecs & | GetSpecs (void)=0 |
| virtual bool | IfHasPropeller (void)=0 |
| virtual bool | IfHasGuns (void) |
Public Attributes | |
| AircraftPhysics | mPhysics |
| physics model (public to use AircraftPhysics interface) | |
Protected Types | |
| enum | eAileron { LEFT_AILERON = 1, RIGHT_AILERON = -1 } |
| enum | eRudder { SINGLE_RUDDER = 0, LEFT_RUDDER = 1, RIGHT_RUDDER = -1 } |
Protected Member Functions | |
| Aircraft (shptr< Graph > graph, const WorldVertex &pos, const AircraftSpecs &specs) | |
| virtual void | Tick (const Milliseconds millisecElapsed) |
| virtual void | AnimateStall (void) |
| void | RotateAileron (Subgraph &subgraph, const fp controlFraction, const eAileron aileron) |
| void | RotateAileron (Subgraph &subgraph, const fp controlFraction, const eAileron aileron, const Vector3 &aileronOffset) |
| void | RotateElevator (Subgraph &subgraph, const fp controlFraction) |
| void | RotateRudder (Subgraph &subgraph, const fp controlFraction, const eRudder=SINGLE_RUDDER) |
| virtual void | HandleCollisions (const Dyna::Colliders &colliders) |
Protected Attributes | |
| bool | mLandingGearDown |
| bool | mShadowCaster |
| will affect Aircraft::GetNodeSort() | |
Private Types | |
| typedef Craft | Parent |
Private Member Functions | |
| void | MoreCrashDetermination (void) |
| void | UpdateState (const Milliseconds millisecElapsed) |
Private Attributes | |
| Matrix | mSavedMatrix |
| restored by Reset() | |
| eState | mState |
| general states { parked, landing, etc } | |
| Milliseconds | mStateUpdateTime |
| timestamp when state was updated | |
| bool | mOnRunway |
| bool | mCoordinatedTurnEnabled |
| if coordinated turn is enabled | |
| bool | mCoordinatedTurnExecuting |
| if program is performing a coordinated turn | |
| fp | mThrottle |
| {0.0,..,1.0} | |
Friends | |
| class | shptr< Aircraft > |
| class | shptr0< Aircraft > |
This class is unusual:
mThrottle is a fp {0.0,...,1.0}. mStep is a world coordinate. Speed (translation increment) is determined by mThrottle * mStep.
Aircraft state enums: The state enums (flying, landing, etc) are kept in the Aircraft class. Both Aircraft and AircraftPhysics can affect the state.
typedef Craft object::Aircraft::Parent [private] |
Reimplemented from object::Craft.
enum object::Aircraft::eAileron [protected] |
enum object::Aircraft::eRudder [protected] |
| object::Aircraft::Aircraft | ( | shptr< Graph > | graph, | |
| const WorldVertex & | pos, | |||
| const AircraftSpecs & | specs | |||
| ) | [protected] |
| object::Aircraft::~Aircraft | ( | ) | [virtual] |
| shptr< Graph > object::Aircraft::LoadModel | ( | const AircraftSpecs & | specs, | |
| const bool | loadCopy | |||
| ) |
Load a 3D model according to AircraftSpecs.
| specs | ||
| loadCopy | If false, return a possibly shared 3D model. If true, return an independent copy. For dynamic aircraft, nodes should be copies so that propellers etc can be rotated independently without affecting other aircraft. |
| void object::Aircraft::Reset | ( | void | ) | [virtual] |
Reset.
Reimplemented from object::Craft.
| virtual const string object::Aircraft::GetName | ( | void | ) | [inline, virtual] |
Reimplemented from object::Craft.
| void object::Aircraft::SetPosition | ( | const WorldVertex & | position | ) | [virtual] |
Set position of Aircraft.
Reimplemented from object::Object.
Translate matrix.
Reimplemented from object::Object.
| void object::Aircraft::Translate | ( | const Vector3 & | v | ) | [virtual] |
Translate Object by adding a 3D vector offset.
Reimplemented from object::Object.
| virtual void object::Aircraft::Rotate | ( | uint | axis, | |
| Radian | rad | |||
| ) | [virtual] |
Reimplemented from object::Object.
| virtual void object::Aircraft::SetMatrix | ( | const Matrix & | matrix, | |
| Dyna::eMatrixChange | change | |||
| ) | [virtual] |
Reimplemented from object::Dyna.
| virtual void object::Aircraft::PhysicalRotate | ( | uint | axis, | |
| fp | controlFraction, | |||
| Milliseconds | controlFreq | |||
| ) | [virtual] |
Implements object::Craft.
| virtual void object::Aircraft::RotateControlSurfaces | ( | const uint | axis, | |
| const fp | frac | |||
| ) | [inline, virtual] |
| void object::Aircraft::SetThrottle | ( | const fp | throttle | ) | [virtual] |
Set throttle. throttle = {0.0,..,1.0}
| throttle | This method will clamp if necessary. |
Reimplemented from object::Craft.
| virtual fp object::Aircraft::GetThrottle | ( | void | ) | [inline, virtual] |
| void object::Aircraft::EnableBrakes | ( | const bool | enable | ) | [virtual] |
Enable/disable brakes.
| bool object::Aircraft::IfBrakes | ( | void | ) | [virtual] |
| bool object::Aircraft::IfWheelBrakes | ( | void | ) | [virtual] |
| bool object::Aircraft::IfAirBrakes | ( | void | ) | [virtual] |
| void object::Aircraft::SetLandingGear | ( | const bool | down | ) | [virtual] |
Enable/disable landing gear. SUBTLE: This becomes a NOP if speed is zero!
| bool object::Aircraft::IfLandingGear | ( | void | ) | [virtual] |
| virtual void object::Aircraft::SwingWings | ( | const float | fraction | ) | [inline, virtual] |
| virtual void object::Aircraft::SwingBayDoors | ( | const float | fraction | ) | [inline, virtual] |
| virtual AircraftPhysics& object::Aircraft::GetPhysics | ( | void | ) | [inline, virtual] |
| void object::Aircraft::EnableCoordinatedTurn | ( | const bool | enable | ) |
Coordinated-turn methods.
| bool object::Aircraft::IfCoordinatedTurnEnabled | ( | void | ) | const |
| bool object::Aircraft::IfCoordinatedTurnExecuting | ( | void | ) | const |
| virtual void object::Aircraft::Tick | ( | const Milliseconds | millisecElapsed | ) | [protected, virtual] |
Reimplemented from object::Dyna.
| void object::Aircraft::AnimateStall | ( | void | ) | [protected, virtual] |
Animate the aerodynamic stalling of a Aircraft.
| void object::Aircraft::PlayEngineSound | ( | const fp | volume | ) | [virtual] |
Play engine sound. Controlled by Lua.
| void object::Aircraft::StopEngineSound | ( | void | ) | [virtual] |
Stop engine sound.
| void object::Aircraft::SetShadowCaster | ( | const bool | enable = true |
) | [virtual] |
Set this aircraft as the shadow caster. Should be called prior to SceneGraph::AttachObject() else no effect.
| void object::Aircraft::RotateAileron | ( | Subgraph & | subgraph, | |
| const fp | controlFraction, | |||
| const eAileron | aileron | |||
| ) | [protected] |
Subroutines for rotating control surfaces. Rotating rudders of jets is more difficult because they're inclined backwards.
| void object::Aircraft::RotateAileron | ( | Subgraph & | subgraph, | |
| const fp | controlFraction, | |||
| const eAileron | aileron, | |||
| const Vector3 & | aileronOffset | |||
| ) | [protected] |
| void object::Aircraft::RotateRudder | ( | Subgraph & | subgraph, | |
| const fp | controlFraction, | |||
| const eRudder | rudder = SINGLE_RUDDER | |||
| ) | [protected] |
| void object::Aircraft::SetState | ( | const eState | state | ) | [virtual] |
Aircraft states (parked, flying, etc).
| Aircraft::eState object::Aircraft::GetState | ( | void | ) | [virtual] |
| bool object::Aircraft::IfFlying | ( | void | ) |
| void object::Aircraft::SetCollision | ( | const Object::eCollision | collision | ) | [virtual] |
Respond to fatal collision.
Reimplemented from object::Object.
| bool object::Aircraft::IfCollisionRunway | ( | void | ) | [virtual] |
Collision methods.
| void object::Aircraft::HandleCollisions | ( | const Dyna::Colliders & | colliders | ) | [protected, virtual] |
The physics model determines one cause of a collision but other causes are possible.
Reimplemented from object::Dyna.
| void object::Aircraft::MoreCrashDetermination | ( | void | ) | [private] |
| void object::Aircraft::UpdateState | ( | const Milliseconds | millisecElapsed | ) | [private] |
| NodeSort object::Aircraft::GetNodeSort | ( | void | ) | [virtual] |
For state-sorting.
Reimplemented from object::Object.
| fp object::Aircraft::GetHeight | ( | void | ) | [virtual] |
| bool object::Aircraft::IfCanSetLandingGear | ( | const bool | down | ) |
Prevent silliness such as retracting landing gear on runway.
| virtual const AircraftSpecs& object::Aircraft::GetSpecs | ( | void | ) | [pure virtual] |
| virtual bool object::Aircraft::IfHasPropeller | ( | void | ) | [pure virtual] |
| virtual bool object::Aircraft::IfHasGuns | ( | void | ) | [inline, virtual] |
friend class shptr< Aircraft > [friend] |
friend class shptr0< Aircraft > [friend] |
Matrix object::Aircraft::mSavedMatrix [private] |
restored by Reset()
physics model (public to use AircraftPhysics interface)
eState object::Aircraft::mState [private] |
general states { parked, landing, etc }
Milliseconds object::Aircraft::mStateUpdateTime [private] |
timestamp when state was updated
bool object::Aircraft::mOnRunway [private] |
bool object::Aircraft::mCoordinatedTurnEnabled [private] |
if coordinated turn is enabled
bool object::Aircraft::mCoordinatedTurnExecuting [private] |
if program is performing a coordinated turn
fp object::Aircraft::mThrottle [private] |
bool object::Aircraft::mLandingGearDown [protected] |
bool object::Aircraft::mShadowCaster [protected] |
will affect Aircraft::GetNodeSort()
Palomino Flight Simulator documents generated by doxygen 1.5.6 on Tue Sep 28 11:37:49 2010