Make CPhysics and CBrain use COldObject
parent
2c474d7c06
commit
45302a3f4e
|
@ -27,6 +27,7 @@
|
||||||
#include "graphics/core/color.h"
|
#include "graphics/core/color.h"
|
||||||
#include "graphics/engine/terrain.h"
|
#include "graphics/engine/terrain.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/motion/motion.h"
|
#include "object/motion/motion.h"
|
||||||
#include "object/motion/motionvehicle.h"
|
#include "object/motion/motionvehicle.h"
|
||||||
|
@ -55,7 +56,7 @@ const int MAXTRACERECORD = 1000;
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CBrain::CBrain(CObject* object)
|
CBrain::CBrain(COldObject* object)
|
||||||
{
|
{
|
||||||
m_object = object;
|
m_object = object;
|
||||||
m_engine = Gfx::CEngine::GetInstancePointer();
|
m_engine = Gfx::CEngine::GetInstancePointer();
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "object/task/taskshield.h"
|
#include "object/task/taskshield.h"
|
||||||
|
|
||||||
|
|
||||||
class CObject;
|
class COldObject;
|
||||||
class CPhysics;
|
class CPhysics;
|
||||||
class CMotion;
|
class CMotion;
|
||||||
class CTaskManager;
|
class CTaskManager;
|
||||||
|
@ -87,7 +87,7 @@ struct Program
|
||||||
class CBrain
|
class CBrain
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CBrain(CObject* object);
|
CBrain(COldObject* object);
|
||||||
~CBrain();
|
~CBrain();
|
||||||
|
|
||||||
void DeleteObject(bool bAll=false);
|
void DeleteObject(bool bAll=false);
|
||||||
|
@ -190,7 +190,7 @@ protected:
|
||||||
Gfx::CWater* m_water;
|
Gfx::CWater* m_water;
|
||||||
Gfx::CCamera* m_camera;
|
Gfx::CCamera* m_camera;
|
||||||
Gfx::CParticle* m_particle;
|
Gfx::CParticle* m_particle;
|
||||||
CObject* m_object;
|
COldObject* m_object;
|
||||||
CPhysics* m_physics;
|
CPhysics* m_physics;
|
||||||
CMotion* m_motion;
|
CMotion* m_motion;
|
||||||
Ui::CInterface* m_interface;
|
Ui::CInterface* m_interface;
|
||||||
|
|
|
@ -43,16 +43,13 @@
|
||||||
#include "object/task/task.h"
|
#include "object/task/task.h"
|
||||||
#include "object/level/parserline.h"
|
#include "object/level/parserline.h"
|
||||||
#include "object/level/parserparam.h"
|
#include "object/level/parserparam.h"
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/interface/carrier_object.h"
|
#include "object/interface/carrier_object.h"
|
||||||
#include "object/interface/jostleable_object.h"
|
#include "object/interface/jostleable_object.h"
|
||||||
#include "object/interface/powered_object.h"
|
#include "object/interface/powered_object.h"
|
||||||
#include "object/interface/transportable_object.h"
|
#include "object/interface/transportable_object.h"
|
||||||
|
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const float LANDING_SPEED = 3.0f;
|
const float LANDING_SPEED = 3.0f;
|
||||||
const float LANDING_ACCEL = 5.0f;
|
const float LANDING_ACCEL = 5.0f;
|
||||||
|
@ -63,7 +60,7 @@ const float LANDING_ACCELh = 1.5f;
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CPhysics::CPhysics(CObject* object)
|
CPhysics::CPhysics(COldObject* object)
|
||||||
{
|
{
|
||||||
m_object = object;
|
m_object = object;
|
||||||
m_engine = Gfx::CEngine::GetInstancePointer();
|
m_engine = Gfx::CEngine::GetInstancePointer();
|
||||||
|
@ -119,16 +116,13 @@ CPhysics::CPhysics(CObject* object)
|
||||||
m_fallingHeight = 0.0f;
|
m_fallingHeight = 0.0f;
|
||||||
m_minFallingHeight = 20.0f;
|
m_minFallingHeight = 20.0f;
|
||||||
m_fallDamageFraction = 0.007f;
|
m_fallDamageFraction = 0.007f;
|
||||||
|
|
||||||
memset(&m_linMotion, 0, sizeof(Motion));
|
|
||||||
memset(&m_cirMotion, 0,sizeof(Motion));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object's destructor.
|
// Object's destructor.
|
||||||
|
|
||||||
CPhysics::~CPhysics()
|
CPhysics::~CPhysics()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Destroys the object.
|
// Destroys the object.
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
|
|
||||||
class CObject;
|
class CObject;
|
||||||
|
class COldObject;
|
||||||
class CBrain;
|
class CBrain;
|
||||||
class CMotion;
|
class CMotion;
|
||||||
class CSoundInterface;
|
class CSoundInterface;
|
||||||
|
@ -99,7 +100,7 @@ struct Motion
|
||||||
class CPhysics
|
class CPhysics
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CPhysics(CObject* object);
|
CPhysics(COldObject* object);
|
||||||
~CPhysics();
|
~CPhysics();
|
||||||
|
|
||||||
void DeleteObject(bool bAll=false);
|
void DeleteObject(bool bAll=false);
|
||||||
|
@ -212,7 +213,7 @@ protected:
|
||||||
Gfx::CTerrain* m_terrain;
|
Gfx::CTerrain* m_terrain;
|
||||||
Gfx::CWater* m_water;
|
Gfx::CWater* m_water;
|
||||||
Gfx::CCamera* m_camera;
|
Gfx::CCamera* m_camera;
|
||||||
CObject* m_object;
|
COldObject* m_object;
|
||||||
CBrain* m_brain;
|
CBrain* m_brain;
|
||||||
CMotion* m_motion;
|
CMotion* m_motion;
|
||||||
CSoundInterface* m_sound;
|
CSoundInterface* m_sound;
|
||||||
|
|
Loading…
Reference in New Issue