Pioneer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
CargoBody Class Reference

#include <CargoBody.h>

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

Public Member Functions

 OBJDEF (CargoBody, DynamicBody, CARGOBODY)
 
 CargoBody ()=delete
 
 CargoBody (const LuaRef &cargo, float selfdestructTimer=86400.0f)
 
 CargoBody (const char *modelName, const LuaRef &cargo, float selfdestructTimer=86400.0f)
 
 CargoBody (const Json &jsonObj, Space *space)
 
LuaRef GetCargoType () const
 
virtual void SetLabel (const std::string &label) override
 
virtual void Render (Graphics::Renderer *r, const Camera *camera, const vector3d &viewCoords, const matrix4x4d &viewTransform) override
 
virtual void TimeStepUpdate (const float timeStep) override
 
virtual bool OnCollision (Body *o, Uint32 flags, double relVel) override
 
virtual bool OnDamage (Body *attacker, float kgDamage, const CollisionContact &contactData) override
 
 ~CargoBody ()
 
- Public Member Functions inherited from DynamicBody
 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
 
- Protected Member Functions inherited from DynamicBody
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)
 

Additional Inherited Members

- Public Types inherited from DynamicBody
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) }
 
- 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
 
- Protected Attributes inherited from DynamicBody
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 inherited from DynamicBody
static const double DEFAULT_DRAG_COEFF = 0.1
 

Constructor & Destructor Documentation

◆ CargoBody() [1/4]

CargoBody::CargoBody ( )
delete

◆ CargoBody() [2/4]

CargoBody::CargoBody ( const LuaRef cargo,
float  selfdestructTimer = 86400.0f 
)
Here is the call graph for this function:

◆ CargoBody() [3/4]

CargoBody::CargoBody ( const char *  modelName,
const LuaRef cargo,
float  selfdestructTimer = 86400.0f 
)
Here is the call graph for this function:

◆ CargoBody() [4/4]

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

◆ ~CargoBody()

CargoBody::~CargoBody ( )
inline

Member Function Documentation

◆ GetCargoType()

LuaRef CargoBody::GetCargoType ( ) const
inline

◆ OBJDEF()

CargoBody::OBJDEF ( CargoBody  ,
DynamicBody  ,
CARGOBODY   
)

◆ OnCollision()

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

Reimplemented from DynamicBody.

Here is the call graph for this function:

◆ OnDamage()

bool CargoBody::OnDamage ( Body attacker,
float  kgDamage,
const CollisionContact contactData 
)
overridevirtual

Reimplemented from Body.

Here is the call graph for this function:

◆ Render()

void CargoBody::Render ( Graphics::Renderer r,
const Camera camera,
const vector3d viewCoords,
const matrix4x4d viewTransform 
)
overridevirtual

Implements Body.

Here is the call graph for this function:

◆ SaveToJson()

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

Reimplemented from DynamicBody.

Here is the call graph for this function:

◆ SetLabel()

void CargoBody::SetLabel ( const std::string &  label)
overridevirtual

Reimplemented from Body.

Here is the call graph for this function:

◆ TimeStepUpdate()

void CargoBody::TimeStepUpdate ( const float  timeStep)
overridevirtual

Reimplemented from DynamicBody.

Here is the call graph for this function:

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