Pioneer
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
DynamicBody Class Reference

#include <DynamicBody.h>

Inheritance diagram for DynamicBody:
Inheritance graph
[legend]
Collaboration diagram for DynamicBody:
Collaboration graph
[legend]

Public Types

enum  AIError {
  AIERROR_NONE = 0 , AIERROR_GRAV_TOO_HIGH , AIERROR_REFUSED_PERM , AIERROR_PRESS_TOO_HIGH ,
  AIERROR_ORBIT_IMPOSSIBLE
}
 
- Public Types inherited from Body
enum  { FLAG_CAN_MOVE_FRAME = (1 << 0) , FLAG_LABEL_HIDDEN = (1 << 1) , FLAG_DRAW_LAST = (1 << 2) , FLAG_DRAW_EXCLUDE = (1 << 3) }
 

Public Member Functions

 OBJDEF (DynamicBody, ModelBody, DYNAMICBODY)
 
 DynamicBody ()
 
 DynamicBody (const Json &jsonObj, Space *space)
 
virtual ~DynamicBody ()
 
virtual vector3d GetVelocity () const override
 
virtual void SetVelocity (const vector3d &v) override
 
virtual void SetFrame (FrameId fId) override
 
vector3d GetAngVelocity () const override
 
void SetAngVelocity (const vector3d &v) override
 
virtual bool OnCollision (Body *o, Uint32 flags, double relVel) override
 
vector3d GetAngularMomentum () const
 
double GetAngularInertia () const
 
void SetMassDistributionFromModel ()
 
void SetMoving (bool isMoving)
 
bool IsMoving () const
 
virtual double GetMass () const override
 
virtual void TimeStepUpdate (const float timeStep) override
 
double CalcAtmosphericDrag (double velSqr, double area, double coeff) const
 
void CalcExternalForce ()
 
void SetMass (double)
 
void AddForce (const vector3d &)
 
void AddTorque (const vector3d &)
 
void SetForce (const vector3d &)
 
void SetTorque (const vector3d &)
 
vector3d GetLastForce () const
 
vector3d GetLastTorque () const
 
void AddRelForce (const vector3d &)
 
void AddRelTorque (const vector3d &)
 
vector3d GetExternalForce () const
 
vector3d GetAtmosForce () const
 
vector3d GetGravityForce () const
 
virtual void UpdateInterpTransform (double alpha) override
 
virtual void PostLoadFixup (Space *space) override
 
Orbit ComputeOrbit () const
 
AIError AIMessage (AIError msg=AIERROR_NONE)
 
void SetDecelerating (bool decel)
 
- Public Member Functions inherited from ModelBody
 OBJDEF (ModelBody, Body, MODELBODY)
 
 ModelBody ()
 
 ModelBody (const Json &jsonObj, Space *space)
 
virtual ~ModelBody ()
 
void SetPosition (const vector3d &p) override
 
void SetOrient (const matrix3x3d &r) override
 
virtual void SetFrame (FrameId fId) override
 
void SetColliding (bool colliding)
 
bool IsColliding () const
 
void SetStatic (bool isStatic)
 
bool IsStatic () const
 
const AabbGetAabb () const
 
SceneGraph::ModelGetModel () const
 
CollMeshGetCollMesh ()
 
GeomGetGeom () const
 
void SetModel (const char *modelName)
 
void RenderModel (Graphics::Renderer *r, const Camera *camera, const vector3d &viewCoords, const matrix4x4d &viewTransform, const bool setLighting=true)
 
virtual void TimeStepUpdate (const float timeStep) override
 
- Public Member Functions inherited from Body
virtual ObjectType GetType () const
 
virtual bool IsType (ObjectType c) const
 
 Body ()
 
 Body (const Json &jsonObj, Space *space)
 
virtual ~Body ()
 
void ToJson (Json &jsonObj, Space *space)
 
virtual void PostLoadFixup (Space *space)
 
virtual void SetPosition (const vector3d &p)
 
vector3d GetPosition () const
 
virtual void SetOrient (const matrix3x3d &r)
 
const matrix3x3dGetOrient () const
 
virtual void SetVelocity (const vector3d &v)
 
virtual vector3d GetVelocity () const
 
virtual void SetAngVelocity (const vector3d &v)
 
virtual vector3d GetAngVelocity () const
 
void SetPhysRadius (double r)
 
double GetPhysRadius () const
 
void SetClipRadius (double r)
 
double GetClipRadius () const
 
virtual double GetMass () const
 
virtual bool OnCollision (Body *o, Uint32 flags, double relVel)
 
virtual bool OnDamage (Body *attacker, float kgDamage, const CollisionContact &contactData)
 
virtual void NotifyRemoved (const Body *const removedBody)
 
virtual void StaticUpdate (const float timeStep)
 
virtual void TimeStepUpdate (const float timeStep)
 
virtual void Render (Graphics::Renderer *r, const Camera *camera, const vector3d &viewCoords, const matrix4x4d &viewTransform)=0
 
virtual void SetFrame (FrameId f)
 
FrameId GetFrame () const
 
void SwitchToFrame (FrameId newFrame)
 
void UpdateFrame ()
 
vector3d GetVelocityRelTo (const Body *) const
 
vector3d GetVelocityRelTo (FrameId) const
 
vector3d GetPositionRelTo (FrameId) const
 
vector3d GetPositionRelTo (const Body *) const
 
matrix3x3d GetOrientRelTo (FrameId) const
 
virtual const SystemBodyGetSystemBody () const
 
void OrientOnSurface (double radius, double latitude, double longitude)
 
virtual void SetLabel (const std::string &label)
 
const std::string & GetLabel () const
 
unsigned int GetFlags () const
 
void SetFlag (unsigned int flag, bool enable)
 
template<typename T >
bool HasComponent () const
 
template<typename T >
T * GetComponent () const
 
template<typename T >
T * AddComponent ()
 
uint64_t GetComponentList () const
 
void MarkDead ()
 
bool IsDead () const
 
virtual bool IsInSpace () const
 
const matrix3x3dGetInterpOrient () const
 
vector3d GetInterpPosition () const
 
vector3d GetInterpPositionRelTo (FrameId relToId) const
 
vector3d GetInterpPositionRelTo (const Body *relTo) const
 
matrix3x3d GetInterpOrientRelTo (FrameId relToId) const
 
virtual void UpdateInterpTransform (double alpha)
 
virtual vector3d GetTargetIndicatorPosition () const
 
- Public Member Functions inherited from DeleteEmitter
 DeleteEmitter ()
 
virtual ~DeleteEmitter ()
 
- Public Member Functions inherited from LuaWrappable
virtual ~LuaWrappable ()
 
- Public Member Functions inherited from PropertiedObject
PropertyMapProperties ()
 
const PropertyMapProperties () const
 

Protected Member Functions

virtual void SaveToJson (Json &jsonObj, Space *space) override
 
void GetCurrentAtmosphericState (double &pressure, double &density) const
 
virtual vector3d CalcAtmosphericForce () const
 
- Protected Member Functions inherited from ModelBody
virtual void SaveToJson (Json &jsonObj, Space *space) override
 
void SetLighting (Graphics::Renderer *r, const Camera *camera, std::vector< float > &oldIntensity, Color &oldAmbient)
 
void ResetLighting (Graphics::Renderer *r, const std::vector< float > &oldIntensity, const Color &oldAmbient)
 
ShieldsGetShields () const
 
virtual void SaveToJson (Json &jsonObj, Space *space)
 

Protected Attributes

double m_dragCoeff
 
bool m_decelerating
 
AIError m_aiMessage
 
- Protected Attributes inherited from Body
unsigned int m_flags = 0
 
vector3d m_interpPos
 
matrix3x3d m_interpOrient
 

Static Protected Attributes

static const double DEFAULT_DRAG_COEFF = 0.1
 

Friends

class Propulsion
 
class FixedGuns
 

Additional Inherited Members

- Static Public Member Functions inherited from Body
static constexpr ObjectType StaticType ()
 
static BodyFromJson (const Json &jsonObj, Space *space)
 
- Public Attributes inherited from DeleteEmitter
sigc::signal< void > onDelete
 

Member Enumeration Documentation

◆ AIError

Enumerator
AIERROR_NONE 
AIERROR_GRAV_TOO_HIGH 
AIERROR_REFUSED_PERM 
AIERROR_PRESS_TOO_HIGH 
AIERROR_ORBIT_IMPOSSIBLE 

Constructor & Destructor Documentation

◆ DynamicBody() [1/2]

DynamicBody::DynamicBody ( )
Here is the call graph for this function:

◆ DynamicBody() [2/2]

DynamicBody::DynamicBody ( const Json jsonObj,
Space space 
)
Here is the call graph for this function:

◆ ~DynamicBody()

DynamicBody::~DynamicBody ( )
virtual

Member Function Documentation

◆ AddForce()

void DynamicBody::AddForce ( const vector3d f)

◆ AddRelForce()

void DynamicBody::AddRelForce ( const vector3d f)
Here is the call graph for this function:

◆ AddRelTorque()

void DynamicBody::AddRelTorque ( const vector3d t)
Here is the call graph for this function:

◆ AddTorque()

void DynamicBody::AddTorque ( const vector3d t)

◆ AIMessage()

AIError DynamicBody::AIMessage ( AIError  msg = AIERROR_NONE)
inline

◆ CalcAtmosphericDrag()

double DynamicBody::CalcAtmosphericDrag ( double  velSqr,
double  area,
double  coeff 
) const
Here is the call graph for this function:

◆ CalcAtmosphericForce()

vector3d DynamicBody::CalcAtmosphericForce ( ) const
protectedvirtual

Reimplemented in Ship.

Here is the call graph for this function:

◆ CalcExternalForce()

void DynamicBody::CalcExternalForce ( )
Here is the call graph for this function:

◆ ComputeOrbit()

Orbit DynamicBody::ComputeOrbit ( ) const
Here is the call graph for this function:

◆ GetAngularInertia()

double DynamicBody::GetAngularInertia ( ) const
inline

◆ GetAngularMomentum()

vector3d DynamicBody::GetAngularMomentum ( ) const

◆ GetAngVelocity()

vector3d DynamicBody::GetAngVelocity ( ) const
overridevirtual

Reimplemented from Body.

◆ GetAtmosForce()

vector3d DynamicBody::GetAtmosForce ( ) const
inline

◆ GetCurrentAtmosphericState()

void DynamicBody::GetCurrentAtmosphericState ( double &  pressure,
double &  density 
) const
protected
Here is the call graph for this function:

◆ GetExternalForce()

vector3d DynamicBody::GetExternalForce ( ) const
inline

◆ GetGravityForce()

vector3d DynamicBody::GetGravityForce ( ) const
inline

◆ GetLastForce()

vector3d DynamicBody::GetLastForce ( ) const
inline

◆ GetLastTorque()

vector3d DynamicBody::GetLastTorque ( ) const
inline

◆ GetMass()

virtual double DynamicBody::GetMass ( ) const
inlineoverridevirtual

Reimplemented from Body.

◆ GetVelocity()

vector3d DynamicBody::GetVelocity ( ) const
overridevirtual

Reimplemented from Body.

◆ IsMoving()

bool DynamicBody::IsMoving ( ) const
inline

◆ OBJDEF()

DynamicBody::OBJDEF ( DynamicBody  ,
ModelBody  ,
DYNAMICBODY   
)

◆ OnCollision()

bool DynamicBody::OnCollision ( Body o,
Uint32  flags,
double  relVel 
)
overridevirtual

Reimplemented from Body.

Reimplemented in CargoBody, Missile, and Ship.

Here is the call graph for this function:

◆ PostLoadFixup()

void DynamicBody::PostLoadFixup ( Space space)
overridevirtual

Reimplemented from Body.

Reimplemented in Missile, and Ship.

Here is the call graph for this function:

◆ SaveToJson()

void DynamicBody::SaveToJson ( Json jsonObj,
Space space 
)
overrideprotectedvirtual

Reimplemented from ModelBody.

Reimplemented in CargoBody, Missile, Player, and Ship.

Here is the call graph for this function:

◆ SetAngVelocity()

void DynamicBody::SetAngVelocity ( const vector3d v)
overridevirtual

Reimplemented from Body.

◆ SetDecelerating()

void DynamicBody::SetDecelerating ( bool  decel)
inline

◆ SetForce()

void DynamicBody::SetForce ( const vector3d f)

◆ SetFrame()

void DynamicBody::SetFrame ( FrameId  fId)
overridevirtual

Reimplemented from ModelBody.

Reimplemented in Ship.

Here is the call graph for this function:

◆ SetMass()

void DynamicBody::SetMass ( double  mass)

◆ SetMassDistributionFromModel()

void DynamicBody::SetMassDistributionFromModel ( )
Here is the call graph for this function:

◆ SetMoving()

void DynamicBody::SetMoving ( bool  isMoving)

◆ SetTorque()

void DynamicBody::SetTorque ( const vector3d t)

◆ SetVelocity()

void DynamicBody::SetVelocity ( const vector3d v)
overridevirtual

Reimplemented from Body.

◆ TimeStepUpdate()

void DynamicBody::TimeStepUpdate ( const float  timeStep)
overridevirtual

Reimplemented from ModelBody.

Reimplemented in CargoBody, Missile, and Ship.

Here is the call graph for this function:

◆ UpdateInterpTransform()

void DynamicBody::UpdateInterpTransform ( double  alpha)
overridevirtual

Reimplemented from Body.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ FixedGuns

friend class FixedGuns
friend

◆ Propulsion

friend class Propulsion
friend

Member Data Documentation

◆ DEFAULT_DRAG_COEFF

const double DynamicBody::DEFAULT_DRAG_COEFF = 0.1
staticprotected

◆ m_aiMessage

AIError DynamicBody::m_aiMessage
protected

◆ m_decelerating

bool DynamicBody::m_decelerating
protected

◆ m_dragCoeff

double DynamicBody::m_dragCoeff
protected

The documentation for this class was generated from the following files: