2012-06-26 20:23:05 +00:00
|
|
|
// * This file is part of the COLOBOT source code
|
|
|
|
// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
|
|
|
|
// *
|
|
|
|
// * This program is free software: you can redistribute it and/or modify
|
|
|
|
// * it under the terms of the GNU General Public License as published by
|
|
|
|
// * the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// * (at your option) any later version.
|
|
|
|
// *
|
|
|
|
// * This program is distributed in the hope that it will be useful,
|
|
|
|
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// * GNU General Public License for more details.
|
|
|
|
// *
|
|
|
|
// * You should have received a copy of the GNU General Public License
|
|
|
|
// * along with this program. If not, see http://www.gnu.org/licenses/.
|
|
|
|
|
2012-10-17 19:55:45 +00:00
|
|
|
/**
|
|
|
|
* \file object/object.h
|
|
|
|
* \brief CObject - base class for all game objects
|
|
|
|
*/
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
#include "graphics/engine/engine.h"
|
|
|
|
#include "graphics/engine/camera.h"
|
2012-09-22 12:40:13 +00:00
|
|
|
|
2012-08-25 09:47:48 +00:00
|
|
|
#include "object/object_ids.h"
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-09-22 12:40:13 +00:00
|
|
|
#include "sound/sound.h"
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
class CInstanceManager;
|
2012-09-22 12:40:13 +00:00
|
|
|
class CApplication;
|
2012-06-26 20:23:05 +00:00
|
|
|
class CPhysics;
|
|
|
|
class CBrain;
|
|
|
|
class CMotion;
|
|
|
|
class CAuto;
|
|
|
|
class CDisplayText;
|
|
|
|
class CRobotMain;
|
|
|
|
class CBotVar;
|
|
|
|
class CScript;
|
|
|
|
|
2012-09-10 21:29:38 +00:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class CDisplayText;
|
|
|
|
}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-10 21:31:42 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
// The father of all parts must always be the part number zero!
|
|
|
|
|
|
|
|
const int OBJECTMAXPART = 40;
|
|
|
|
const int MAXCRASHSPHERE = 40;
|
|
|
|
const int OBJECTMAXDESELLIST = 10;
|
|
|
|
const int OBJECTMAXINFO = 10;
|
|
|
|
const int OBJECTMAXCMDLINE = 20;
|
|
|
|
|
2012-09-10 21:29:38 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
enum ObjectMaterial
|
|
|
|
{
|
2012-09-10 21:29:38 +00:00
|
|
|
OM_METAL = 0, // metal
|
|
|
|
OM_PLASTIC = 1, // plastic
|
|
|
|
OM_HUMAN = 2, // cosmonaut
|
|
|
|
OM_ANIMAL = 3, // insect
|
|
|
|
OM_VEGETAL = 4, // plant
|
|
|
|
OM_MINERAL = 5, // stone
|
2012-06-26 20:23:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectPart
|
|
|
|
{
|
2012-09-10 21:29:38 +00:00
|
|
|
char bUsed;
|
|
|
|
int object; // number of the object in CEngine
|
|
|
|
int parentPart; // number of father part
|
|
|
|
int masterParti; // master canal of the particle
|
|
|
|
Math::Vector position;
|
|
|
|
Math::Vector angle;
|
|
|
|
Math::Vector zoom;
|
|
|
|
char bTranslate;
|
|
|
|
char bRotate;
|
|
|
|
char bZoom;
|
|
|
|
Math::Matrix matTranslate;
|
|
|
|
Math::Matrix matRotate;
|
|
|
|
Math::Matrix matTransform;
|
|
|
|
Math::Matrix matWorld;
|
2012-06-26 20:23:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Character
|
|
|
|
{
|
2012-09-10 21:29:38 +00:00
|
|
|
float wheelFront; // position X of the front wheels
|
|
|
|
float wheelBack; // position X of the back wheels
|
|
|
|
float wheelLeft; // position Z of the left wheels
|
|
|
|
float wheelRight; // position Z of the right wheels
|
|
|
|
float height; // normal height on top of ground
|
|
|
|
Math::Vector posPower; // position of the battery
|
2012-06-26 20:23:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Info
|
|
|
|
{
|
2012-09-10 21:29:38 +00:00
|
|
|
char name[20]; // name of the information
|
|
|
|
float value; // value of the information
|
2012-06-26 20:23:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum ExploType
|
|
|
|
{
|
2012-09-10 21:29:38 +00:00
|
|
|
EXPLO_BOUM = 1,
|
|
|
|
EXPLO_BURN = 2,
|
|
|
|
EXPLO_WATER = 3,
|
2012-06-26 20:23:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum ResetCap
|
|
|
|
{
|
2012-09-10 21:29:38 +00:00
|
|
|
RESET_NONE = 0,
|
|
|
|
RESET_MOVE = 1,
|
|
|
|
RESET_DELETE = 2,
|
2012-06-26 20:23:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum RadarFilter
|
|
|
|
{
|
2012-09-10 21:29:38 +00:00
|
|
|
FILTER_NONE = 0,
|
|
|
|
FILTER_ONLYLANDING = 1,
|
|
|
|
FILTER_ONLYFLYING = 2,
|
2012-06-26 20:23:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CObject(CInstanceManager* iMan);
|
|
|
|
~CObject();
|
|
|
|
|
|
|
|
void DeleteObject(bool bAll=false);
|
|
|
|
void Simplify();
|
|
|
|
bool ExploObject(ExploType type, float force, float decay=1.0f);
|
|
|
|
|
|
|
|
bool EventProcess(const Event &event);
|
|
|
|
void UpdateMapping();
|
|
|
|
|
|
|
|
int CreatePart();
|
|
|
|
void DeletePart(int part);
|
|
|
|
void SetObjectRank(int part, int objRank);
|
2012-08-09 20:50:04 +00:00
|
|
|
int GetObjectRank(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetObjectParent(int part, int parent);
|
|
|
|
void SetType(ObjectType type);
|
2012-08-09 20:50:04 +00:00
|
|
|
ObjectType GetType();
|
|
|
|
char* GetName();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetOption(int option);
|
2012-08-09 20:50:04 +00:00
|
|
|
int GetOption();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetID(int id);
|
2012-08-09 20:50:04 +00:00
|
|
|
int GetID();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
bool Write(char *line);
|
|
|
|
bool Read(char *line);
|
|
|
|
|
|
|
|
void SetDrawWorld(bool bDraw);
|
|
|
|
void SetDrawFront(bool bDraw);
|
|
|
|
|
|
|
|
bool CreateVehicle(Math::Vector pos, float angle, ObjectType type, float power, bool bTrainer, bool bToy);
|
|
|
|
bool CreateInsect(Math::Vector pos, float angle, ObjectType type);
|
|
|
|
bool CreateBuilding(Math::Vector pos, float angle, float height, ObjectType type, float power=1.0f);
|
|
|
|
bool CreateResource(Math::Vector pos, float angle, ObjectType type, float power=1.0f);
|
|
|
|
bool CreateFlag(Math::Vector pos, float angle, ObjectType type);
|
|
|
|
bool CreateBarrier(Math::Vector pos, float angle, float height, ObjectType type);
|
|
|
|
bool CreatePlant(Math::Vector pos, float angle, float height, ObjectType type);
|
|
|
|
bool CreateMushroom(Math::Vector pos, float angle, float height, ObjectType type);
|
|
|
|
bool CreateTeen(Math::Vector pos, float angle, float zoom, float height, ObjectType type);
|
|
|
|
bool CreateQuartz(Math::Vector pos, float angle, float height, ObjectType type);
|
|
|
|
bool CreateRoot(Math::Vector pos, float angle, float height, ObjectType type);
|
|
|
|
bool CreateHome(Math::Vector pos, float angle, float height, ObjectType type);
|
|
|
|
bool CreateRuin(Math::Vector pos, float angle, float height, ObjectType type);
|
|
|
|
bool CreateApollo(Math::Vector pos, float angle, ObjectType type);
|
|
|
|
|
2012-09-10 21:29:38 +00:00
|
|
|
bool ReadProgram(int rank, const char* filename);
|
2012-06-26 20:23:05 +00:00
|
|
|
bool WriteProgram(int rank, char* filename);
|
|
|
|
bool RunProgram(int rank);
|
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
int GetShadowLight();
|
|
|
|
int GetEffectLight();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void FlushCrashShere();
|
|
|
|
int CreateCrashSphere(Math::Vector pos, float radius, Sound sound, float hardness=0.45f);
|
2012-08-09 20:50:04 +00:00
|
|
|
int GetCrashSphereTotal();
|
2012-06-26 20:23:05 +00:00
|
|
|
bool GetCrashSphere(int rank, Math::Vector &pos, float &radius);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetCrashSphereHardness(int rank);
|
|
|
|
Sound GetCrashSphereSound(int rank);
|
2012-06-26 20:23:05 +00:00
|
|
|
void DeleteCrashSphere(int rank);
|
|
|
|
void SetGlobalSphere(Math::Vector pos, float radius);
|
|
|
|
void GetGlobalSphere(Math::Vector &pos, float &radius);
|
|
|
|
void SetJotlerSphere(Math::Vector pos, float radius);
|
|
|
|
void GetJotlerSphere(Math::Vector &pos, float &radius);
|
|
|
|
void SetShieldRadius(float radius);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetShieldRadius();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetFloorHeight(float height);
|
|
|
|
void FloorAdjust();
|
|
|
|
|
|
|
|
void SetLinVibration(Math::Vector dir);
|
2012-08-09 20:50:04 +00:00
|
|
|
Math::Vector GetLinVibration();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetCirVibration(Math::Vector dir);
|
2012-08-09 20:50:04 +00:00
|
|
|
Math::Vector GetCirVibration();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetInclinaison(Math::Vector dir);
|
2012-08-09 20:50:04 +00:00
|
|
|
Math::Vector GetInclinaison();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetPosition(int part, const Math::Vector &pos);
|
2012-08-09 20:50:04 +00:00
|
|
|
Math::Vector GetPosition(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetAngle(int part, const Math::Vector &angle);
|
2012-08-09 20:50:04 +00:00
|
|
|
Math::Vector GetAngle(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetAngleY(int part, float angle);
|
|
|
|
void SetAngleX(int part, float angle);
|
|
|
|
void SetAngleZ(int part, float angle);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetAngleY(int part);
|
|
|
|
float GetAngleX(int part);
|
|
|
|
float GetAngleZ(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetZoom(int part, float zoom);
|
|
|
|
void SetZoom(int part, Math::Vector zoom);
|
2012-08-09 20:50:04 +00:00
|
|
|
Math::Vector GetZoom(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetZoomX(int part, float zoom);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetZoomX(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetZoomY(int part, float zoom);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetZoomY(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetZoomZ(int part, float zoom);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetZoomZ(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetWaterLevel();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetTrainer(bool bEnable);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetTrainer();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetToy(bool bEnable);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetToy();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetManual(bool bManual);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetManual();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetResetCap(ResetCap cap);
|
2012-08-09 20:50:04 +00:00
|
|
|
ResetCap GetResetCap();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetResetBusy(bool bBusy);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetResetBusy();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetResetPosition(const Math::Vector &pos);
|
2012-08-09 20:50:04 +00:00
|
|
|
Math::Vector GetResetPosition();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetResetAngle(const Math::Vector &angle);
|
2012-08-09 20:50:04 +00:00
|
|
|
Math::Vector GetResetAngle();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetResetRun(int run);
|
2012-08-09 20:50:04 +00:00
|
|
|
int GetResetRun();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-09-10 21:29:38 +00:00
|
|
|
void SetMasterParticle(int part, int parti);
|
|
|
|
int GetMasterParticle(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetPower(CObject* power);
|
2012-08-09 20:50:04 +00:00
|
|
|
CObject* GetPower();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetFret(CObject* fret);
|
2012-08-09 20:50:04 +00:00
|
|
|
CObject* GetFret();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetTruck(CObject* truck);
|
2012-08-09 20:50:04 +00:00
|
|
|
CObject* GetTruck();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetTruckPart(int part);
|
2012-08-09 20:50:04 +00:00
|
|
|
int GetTruckPart();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void InfoFlush();
|
|
|
|
void DeleteInfo(int rank);
|
|
|
|
void SetInfo(int rank, Info info);
|
2012-08-09 20:50:04 +00:00
|
|
|
Info GetInfo(int rank);
|
|
|
|
int GetInfoTotal();
|
2012-09-10 21:29:38 +00:00
|
|
|
void SetInfoReturn(float value);
|
|
|
|
float GetInfoReturn();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetInfoUpdate(bool bUpdate);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetInfoUpdate();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
bool SetCmdLine(int rank, float value);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetCmdLine(int rank);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
Math::Matrix* GetRotateMatrix(int part);
|
|
|
|
Math::Matrix* GetTranslateMatrix(int part);
|
|
|
|
Math::Matrix* GetTransformMatrix(int part);
|
|
|
|
Math::Matrix* GetWorldMatrix(int part);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
void SetViewFromHere(Math::Vector &eye, float &dirH, float &dirV,
|
|
|
|
Math::Vector &lookat, Math::Vector &upVec,
|
|
|
|
Gfx::CameraType type);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetCharacter(Character* character);
|
|
|
|
void GetCharacter(Character* character);
|
2012-08-09 20:50:04 +00:00
|
|
|
Character* GetCharacter();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetAbsTime();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetEnergy(float level);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetEnergy();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetCapacity(float capacity);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetCapacity();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetShield(float level);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetShield();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetRange(float delay);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetRange();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetTransparency(float value);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetTransparency();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
ObjectMaterial GetMaterial();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetGadget(bool bMode);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetGadget();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetFixed(bool bFixed);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetFixed();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetClip(bool bClip);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetClip();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
bool JostleObject(float force);
|
|
|
|
|
|
|
|
void StartDetectEffect(CObject *target, bool bFound);
|
|
|
|
|
|
|
|
void SetVirusMode(bool bEnable);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetVirusMode();
|
|
|
|
float GetVirusTime();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
void SetCameraType(Gfx::CameraType type);
|
|
|
|
Gfx::CameraType GetCameraType();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetCameraDist(float dist);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetCameraDist();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetCameraLock(bool bLock);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetCameraLock();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetHilite(bool bMode);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetHilite();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetSelect(bool bMode, bool bDisplayError=true);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetSelect(bool bReal=false);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetSelectable(bool bMode);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetSelectable();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetActivity(bool bMode);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetActivity();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetVisible(bool bVisible);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetVisible();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetEnable(bool bEnable);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetEnable();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetCheckToken(bool bMode);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetCheckToken();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetProxyActivate(bool bActivate);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetProxyActivate();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetProxyDistance(float distance);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetProxyDistance();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetMagnifyDamage(float factor);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetMagnifyDamage();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetParam(float value);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetParam();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetExplo(bool bExplo);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetExplo();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetLock(bool bLock);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetLock();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetCargo(bool bCargo);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetCargo();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetBurn(bool bBurn);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetBurn();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetDead(bool bDead);
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetDead();
|
|
|
|
bool GetRuin();
|
|
|
|
bool GetActif();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetGunGoalV(float gunGoal);
|
|
|
|
void SetGunGoalH(float gunGoal);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetGunGoalV();
|
|
|
|
float GetGunGoalH();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
bool StartShowLimit();
|
|
|
|
void StopShowLimit();
|
|
|
|
|
|
|
|
bool IsProgram();
|
2012-09-10 21:29:38 +00:00
|
|
|
void CreateSelectParticle();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void SetRunScript(CScript* script);
|
2012-08-09 20:50:04 +00:00
|
|
|
CScript* GetRunScript();
|
|
|
|
CBotVar* GetBotVar();
|
|
|
|
CPhysics* GetPhysics();
|
|
|
|
CBrain* GetBrain();
|
|
|
|
CMotion* GetMotion();
|
|
|
|
CAuto* GetAuto();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetAuto(CAuto* automat);
|
|
|
|
|
|
|
|
void SetDefRank(int rank);
|
2012-08-09 20:50:04 +00:00
|
|
|
int GetDefRank();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
bool GetTooltipName(char* name);
|
|
|
|
|
|
|
|
void AddDeselList(CObject* pObj);
|
|
|
|
CObject* SubDeselList();
|
|
|
|
void DeleteDeselList(CObject* pObj);
|
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
bool CreateShadowCircle(float radius, float intensity, Gfx::EngineShadowType type = Gfx::ENG_SHADOW_NORM);
|
|
|
|
bool CreateShadowLight(float height, Gfx::Color color);
|
|
|
|
bool CreateEffectLight(float height, Gfx::Color color);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
void FlatParent();
|
|
|
|
|
2012-08-09 20:50:04 +00:00
|
|
|
bool GetTraceDown();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetTraceDown(bool bDown);
|
2012-08-09 20:50:04 +00:00
|
|
|
int GetTraceColor();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetTraceColor(int color);
|
2012-08-09 20:50:04 +00:00
|
|
|
float GetTraceWidth();
|
2012-06-26 20:23:05 +00:00
|
|
|
void SetTraceWidth(float width);
|
|
|
|
|
2012-09-22 12:40:13 +00:00
|
|
|
std::string GetModelDirName();
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
protected:
|
|
|
|
bool EventFrame(const Event &event);
|
|
|
|
void VirusFrame(float rTime);
|
|
|
|
void PartiFrame(float rTime);
|
|
|
|
void CreateOtherObject(ObjectType type);
|
|
|
|
void InitPart(int part);
|
|
|
|
void UpdateTotalPart();
|
|
|
|
int SearchDescendant(int parent, int n);
|
|
|
|
void UpdateEnergyMapping();
|
|
|
|
bool UpdateTransformObject(int part, bool bForceUpdate);
|
|
|
|
bool UpdateTransformObject();
|
2012-09-10 21:29:38 +00:00
|
|
|
void UpdateSelectParticle();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
protected:
|
2012-09-10 21:29:38 +00:00
|
|
|
CInstanceManager* m_iMan;
|
2012-09-22 12:40:13 +00:00
|
|
|
CApplication* m_app;
|
2012-09-10 21:29:38 +00:00
|
|
|
Gfx::CEngine* m_engine;
|
|
|
|
Gfx::CLightManager* m_lightMan;
|
|
|
|
Gfx::CTerrain* m_terrain;
|
|
|
|
Gfx::CWater* m_water;
|
|
|
|
Gfx::CCamera* m_camera;
|
|
|
|
Gfx::CParticle* m_particle;
|
|
|
|
CPhysics* m_physics;
|
|
|
|
CBrain* m_brain;
|
|
|
|
CMotion* m_motion;
|
|
|
|
CAuto* m_auto;
|
|
|
|
Ui::CDisplayText* m_displayText;
|
|
|
|
CRobotMain* m_main;
|
|
|
|
CSoundInterface* m_sound;
|
|
|
|
CBotVar* m_botVar;
|
|
|
|
CScript* m_runScript;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
ObjectType m_type; // OBJECT_*
|
|
|
|
int m_id; // unique identifier
|
|
|
|
char m_name[50]; // name of the object
|
|
|
|
Character m_character; // characteristic
|
|
|
|
int m_option; // option
|
|
|
|
int m_partiReactor; // number of the particle of the reactor
|
|
|
|
int m_shadowLight; // number of light from the shadows
|
|
|
|
float m_shadowHeight; // height of light from the shadows
|
|
|
|
int m_effectLight; // number of light effects
|
|
|
|
float m_effectHeight; // height of light effects
|
|
|
|
Math::Vector m_linVibration; // linear vibration
|
|
|
|
Math::Vector m_cirVibration; // circular vibration
|
|
|
|
Math::Vector m_inclinaison; // tilt
|
|
|
|
CObject* m_power; // battery used by the vehicle
|
|
|
|
CObject* m_fret; // object transported
|
|
|
|
CObject* m_truck; // object with the latter
|
|
|
|
int m_truckLink; // part
|
|
|
|
float m_energy; // energy contained (if battery)
|
|
|
|
float m_lastEnergy;
|
|
|
|
float m_capacity; // capacity (if battery)
|
|
|
|
float m_shield; // shield
|
|
|
|
float m_range; // flight range
|
|
|
|
float m_transparency; // transparency (0..1)
|
|
|
|
int m_material; // matter(0..n)
|
|
|
|
float m_aTime;
|
|
|
|
float m_shotTime; // time since last shot
|
|
|
|
bool m_bVirusMode; // virus activated/triggered
|
|
|
|
float m_virusTime; // lifetime of the virus
|
2012-09-10 21:29:38 +00:00
|
|
|
float m_lastVirusParticle;
|
|
|
|
float m_lastParticle;
|
2012-06-26 20:23:05 +00:00
|
|
|
bool m_bHilite;
|
|
|
|
bool m_bSelect; // object selected
|
|
|
|
bool m_bSelectable; // selectable object
|
|
|
|
bool m_bCheckToken; // object with audited tokens
|
|
|
|
bool m_bVisible; // object active but undetectable
|
|
|
|
bool m_bEnable; // dead object
|
|
|
|
bool m_bProxyActivate; // active object so close
|
|
|
|
bool m_bGadget; // object nonessential
|
|
|
|
bool m_bLock;
|
|
|
|
bool m_bExplo;
|
|
|
|
bool m_bCargo;
|
|
|
|
bool m_bBurn;
|
|
|
|
bool m_bDead;
|
|
|
|
bool m_bFlat;
|
|
|
|
bool m_bTrainer; // drive vehicle (without remote)
|
|
|
|
bool m_bToy; // toy key
|
|
|
|
bool m_bManual; // manual control (Scribbler)
|
|
|
|
bool m_bFixed;
|
|
|
|
bool m_bClip;
|
|
|
|
bool m_bShowLimit;
|
|
|
|
float m_showLimitRadius;
|
|
|
|
float m_gunGoalV;
|
|
|
|
float m_gunGoalH;
|
2012-08-09 20:50:04 +00:00
|
|
|
Gfx::CameraType m_cameraType;
|
2012-06-26 20:23:05 +00:00
|
|
|
float m_cameraDist;
|
|
|
|
bool m_bCameraLock;
|
|
|
|
int m_defRank;
|
|
|
|
float m_magnifyDamage;
|
|
|
|
float m_proxyDistance;
|
|
|
|
float m_param;
|
|
|
|
|
|
|
|
int m_crashSphereUsed; // number of spheres used
|
|
|
|
Math::Vector m_crashSpherePos[MAXCRASHSPHERE];
|
|
|
|
float m_crashSphereRadius[MAXCRASHSPHERE];
|
|
|
|
float m_crashSphereHardness[MAXCRASHSPHERE];
|
|
|
|
Sound m_crashSphereSound[MAXCRASHSPHERE];
|
|
|
|
Math::Vector m_globalSpherePos;
|
|
|
|
float m_globalSphereRadius;
|
|
|
|
Math::Vector m_jotlerSpherePos;
|
|
|
|
float m_jotlerSphereRadius;
|
|
|
|
float m_shieldRadius;
|
|
|
|
|
|
|
|
int m_totalPart;
|
|
|
|
ObjectPart m_objectPart[OBJECTMAXPART];
|
|
|
|
|
|
|
|
int m_totalDesectList;
|
|
|
|
CObject* m_objectDeselectList[OBJECTMAXDESELLIST];
|
|
|
|
|
|
|
|
int m_partiSel[4];
|
|
|
|
|
|
|
|
ResetCap m_resetCap;
|
|
|
|
bool m_bResetBusy;
|
|
|
|
Math::Vector m_resetPosition;
|
|
|
|
Math::Vector m_resetAngle;
|
|
|
|
int m_resetRun;
|
|
|
|
|
|
|
|
int m_infoTotal;
|
|
|
|
Info m_info[OBJECTMAXINFO];
|
2012-09-10 21:29:38 +00:00
|
|
|
float m_infoReturn;
|
2012-06-26 20:23:05 +00:00
|
|
|
bool m_bInfoUpdate;
|
|
|
|
|
|
|
|
float m_cmdLine[OBJECTMAXCMDLINE];
|
|
|
|
};
|
|
|
|
|