AnimatLab  2
Test
Stomach.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 namespace AnimatSim
9 {
10  namespace Environment
11  {
12  namespace Bodies
13  {
14 
26  class ANIMAT_PORT Stomach : public RigidBody
27  {
28  protected:
32 
35 
38 
41 
45 
48 
51 
54 
56  bool m_bKilled;
57 
60 
61  public:
62  Stomach();
63  virtual ~Stomach();
64 
65  static Stomach *CastToDerived(AnimatBase *lpBase) {return static_cast<Stomach*>(lpBase);}
66 
67  virtual float EnergyLevel();
68  virtual void EnergyLevel(float fltVal);
69  virtual void AddEnergy(float fltVal);
70 
71  virtual float ConsumptionRate();
72  virtual void ConsumptionRate(float fltVal);
73 
74  virtual float BaseConsumptionRate();
75  virtual void BaseConsumptionRate(float fltVal);
76 
77  virtual float MaxEnergyLevel();
78  virtual void MaxEnergyLevel(float fltVal);
79 
80  virtual bool KillOrganism();
81  virtual void KillOrganism(bool bVal);
82 
83  //Stomach parts are never static joints.
84  virtual bool HasStaticJoint() {return false;};
85 
86  virtual void CreateParts();
87 
88  //Node Overrides
89  virtual void AddExternalNodeInput(int iTargetDataType, float fltInput);
90  virtual float *GetDataPointer(const std::string &strDataType);
91  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
92  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
93  virtual void StepSimulation();
94  virtual void ResetSimulation();
95  virtual void Load(CStdXml &oXml);
96  };
97 
98  } //Joints
99  } // Environment
100 } //AnimatSim
float m_fltEnergyLevel
The current energy level.
Definition: Stomach.h:37
float m_fltBaseConsumptionRate
The base consumption rate. This is the standard, constant rate of consumption.
Definition: Stomach.h:47
Root namespace for the base simulation library for AnimatLab.
float m_fltConsumptionForStep
The consumption for the current simulation step. This is the consumption rate times the time step siz...
Definition: Stomach.h:50
The Stomach object is responsible for holding food energy.
Definition: Stomach.h:26
bool m_bKillOrganism
If this is true then if the energy level reaches zero then the organism is killed.
Definition: Stomach.h:53
float m_fltConsumptionRate
The current consumption rate. This is calculated by adding m_fltAdapterConsumptionRate and m_fltBaseC...
Definition: Stomach.h:40
bool m_bKilled
Set to true if the organism is killed.
Definition: Stomach.h:56
virtual bool HasStaticJoint()
Query if this object has a static joint.
Definition: Stomach.h:84
float m_fltReportAlive
Used to report in GetDataPointer if the organism was killed.
Definition: Stomach.h:59
Animat base class.
Definition: AnimatBase.h:36
float m_fltInitEnergyLevel
The starting energy level.
Definition: Stomach.h:34
The base class for all of the basic rigid body type of objects.
Definition: RigidBody.h:66