2011-12-10 13:25:22 +00:00
|
|
|
#ifndef _PAYSAGES_TYPES_H_
|
|
|
|
#define _PAYSAGES_TYPES_H_
|
|
|
|
|
2013-01-19 22:42:50 +00:00
|
|
|
#include "../tools/euclid.h"
|
|
|
|
#include "../tools/color.h"
|
2012-06-17 09:40:40 +00:00
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-11-25 21:53:01 +00:00
|
|
|
typedef struct Renderer Renderer;
|
2011-12-10 13:25:22 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int length;
|
|
|
|
int alloc_length;
|
|
|
|
int item_size;
|
|
|
|
int dirty;
|
|
|
|
void* data;
|
|
|
|
} Array;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int hit;
|
|
|
|
Color hit_color;
|
|
|
|
Vector3 hit_location;
|
|
|
|
} RayCastingResult;
|
2012-12-09 17:49:28 +00:00
|
|
|
typedef RayCastingResult (*FuncGeneralCastRay)(Renderer* renderer, Vector3 start, Vector3 direction);
|
2011-12-10 13:25:22 +00:00
|
|
|
|
2012-01-29 17:53:12 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-06-17 09:40:40 +00:00
|
|
|
double min_height;
|
|
|
|
double max_height;
|
|
|
|
double base_height;
|
2012-01-29 17:53:12 +00:00
|
|
|
} HeightInfo;
|
|
|
|
|
2012-01-31 11:20:52 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Vector3 location;
|
2012-06-17 09:40:40 +00:00
|
|
|
double yaw;
|
|
|
|
double pitch;
|
|
|
|
double roll;
|
2012-12-09 17:49:28 +00:00
|
|
|
|
2012-01-31 11:20:52 +00:00
|
|
|
Vector3 target;
|
|
|
|
Vector3 forward;
|
|
|
|
Vector3 right;
|
|
|
|
Vector3 up;
|
2012-12-09 17:49:28 +00:00
|
|
|
|
2012-06-17 09:40:40 +00:00
|
|
|
double width;
|
|
|
|
double height;
|
|
|
|
double yfov;
|
|
|
|
double xratio;
|
|
|
|
double znear;
|
|
|
|
double zfar;
|
2012-12-09 17:49:28 +00:00
|
|
|
|
2012-01-31 11:20:52 +00:00
|
|
|
Matrix4 project;
|
|
|
|
Matrix4 unproject;
|
|
|
|
} CameraDefinition;
|
|
|
|
|
2012-12-09 17:49:28 +00:00
|
|
|
typedef void* (*FuncObjectCreate)();
|
|
|
|
typedef void (*FuncObjectDelete)(void* object);
|
|
|
|
typedef void (*FuncObjectCopy)(void* source, void* destination);
|
|
|
|
typedef void (*FuncObjectValidate)(void* object);
|
|
|
|
typedef void (*FuncObjectSave)(PackStream* stream, void* object);
|
|
|
|
typedef void (*FuncObjectLoad)(PackStream* stream, void* object);
|
|
|
|
typedef void (*FuncObjectBind)(void* base, void* sub);
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
FuncObjectCreate create;
|
|
|
|
FuncObjectDelete destroy;
|
|
|
|
FuncObjectCopy copy;
|
|
|
|
FuncObjectValidate validate;
|
|
|
|
FuncObjectSave save;
|
|
|
|
FuncObjectLoad load;
|
|
|
|
} StandardDefinition;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
FuncObjectCreate create;
|
|
|
|
FuncObjectDelete destroy;
|
|
|
|
FuncObjectBind bind;
|
|
|
|
} StandardRenderer;
|
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
#endif
|