2014-01-24 09:00:59 +01:00
|
|
|
#ifndef OBJECT_DEFINES_H
|
|
|
|
#define OBJECT_DEFINES_H
|
|
|
|
|
2014-01-28 11:27:29 +01:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2014-01-24 09:00:59 +01:00
|
|
|
namespace GameLogic
|
|
|
|
{
|
2014-01-28 11:27:29 +01:00
|
|
|
/************************************
|
|
|
|
Enums
|
|
|
|
*************************************/
|
|
|
|
|
2014-01-24 09:00:59 +01:00
|
|
|
enum ObjectType
|
|
|
|
{
|
2014-01-28 11:27:29 +01:00
|
|
|
ObjectType_LevelMetaData,
|
2014-01-24 09:00:59 +01:00
|
|
|
ObjectType_Static,
|
|
|
|
ObjectType_Dynamic,
|
2014-01-28 11:27:29 +01:00
|
|
|
//Etc
|
2014-01-24 09:00:59 +01:00
|
|
|
|
|
|
|
ObjectType_NUM_OF_TYPES,
|
|
|
|
|
2014-01-24 10:01:58 +01:00
|
|
|
ObjectType_Unknown = -1,
|
2014-01-24 09:00:59 +01:00
|
|
|
};
|
|
|
|
|
2014-01-28 11:27:29 +01:00
|
|
|
enum UsePhysics
|
|
|
|
{
|
|
|
|
UsePhysics_UseFullPhysics,
|
|
|
|
UsePhysics_IgnoreGravity,
|
|
|
|
UsePhysics_IgnorePhysics,
|
|
|
|
|
|
|
|
UsePhysics_Count,
|
|
|
|
UsePhysics_Unknown = -1,
|
|
|
|
};
|
|
|
|
|
|
|
|
//Should this be moved somewhere else?
|
|
|
|
enum GameMode
|
|
|
|
{
|
|
|
|
GameMode_FreeForAll,
|
|
|
|
GameMode_TeamDeathMatch,
|
|
|
|
//Etc
|
|
|
|
|
|
|
|
GameMode_Count,
|
|
|
|
GameMode_Unknown = -1,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
Structs
|
|
|
|
*************************************/
|
|
|
|
|
|
|
|
struct FormatVersion
|
|
|
|
{
|
|
|
|
int formatVersionMajor;
|
|
|
|
int formatVersionMinor;
|
|
|
|
|
|
|
|
bool operator ==(const FormatVersion& obj)
|
|
|
|
{
|
|
|
|
return (this->formatVersionMajor != obj.formatVersionMajor && this->formatVersionMinor != obj.formatVersionMinor);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator !=(const FormatVersion& obj)
|
|
|
|
{
|
|
|
|
return !(*this == obj);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-01-24 09:00:59 +01:00
|
|
|
struct ObjectTypeHeader
|
|
|
|
{
|
|
|
|
ObjectType typeID;
|
2014-01-28 11:27:29 +01:00
|
|
|
};
|
2014-01-24 09:00:59 +01:00
|
|
|
|
2014-01-28 11:27:29 +01:00
|
|
|
struct PhysicsObject
|
|
|
|
{
|
|
|
|
float mass;
|
|
|
|
float elasticity;
|
|
|
|
float frictionCoeffStatic;
|
|
|
|
float frictionCoeffDynamic;
|
|
|
|
float inertiaTensor[16];
|
|
|
|
UsePhysics usePhysics;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LevelMetaData : ObjectTypeHeader
|
|
|
|
{
|
|
|
|
std::string levelName;
|
|
|
|
FormatVersion levelVersion;
|
|
|
|
std::string levelDescription;
|
|
|
|
std::string levelAuthor;
|
|
|
|
int maxNumberOfPlayer;
|
|
|
|
float worldSize;
|
|
|
|
int overviewPictureID;
|
|
|
|
std::vector<GameMode> gameModesSupported;
|
2014-01-24 09:00:59 +01:00
|
|
|
};
|
|
|
|
|
2014-01-28 11:27:29 +01:00
|
|
|
struct ObjectHeader : public PhysicsObject, public ObjectTypeHeader
|
2014-01-24 09:00:59 +01:00
|
|
|
{
|
|
|
|
//Model,
|
2014-01-27 10:15:39 +01:00
|
|
|
int ModelID;
|
2014-01-24 09:00:59 +01:00
|
|
|
//Texture
|
2014-01-27 10:15:39 +01:00
|
|
|
int TextureID;
|
2014-01-24 09:00:59 +01:00
|
|
|
//Position
|
|
|
|
float position[3];
|
|
|
|
//Rotation
|
|
|
|
float rotation[3];
|
|
|
|
//Scale
|
|
|
|
float scale[3];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|