Michaël Lemaire
b46060f3c4
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@500 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
88 lines
1.7 KiB
C
88 lines
1.7 KiB
C
#ifndef _PAYSAGES_TYPES_H_
|
|
#define _PAYSAGES_TYPES_H_
|
|
|
|
#include "../tools/euclid.h"
|
|
#include "../tools/color.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct Renderer Renderer;
|
|
|
|
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;
|
|
typedef RayCastingResult (*FuncGeneralCastRay)(Renderer* renderer, Vector3 start, Vector3 direction);
|
|
|
|
typedef struct
|
|
{
|
|
double min_height;
|
|
double max_height;
|
|
double base_height;
|
|
} HeightInfo;
|
|
|
|
typedef struct
|
|
{
|
|
Vector3 location;
|
|
double yaw;
|
|
double pitch;
|
|
double roll;
|
|
|
|
Vector3 target;
|
|
Vector3 forward;
|
|
Vector3 right;
|
|
Vector3 up;
|
|
|
|
double width;
|
|
double height;
|
|
double yfov;
|
|
double xratio;
|
|
double znear;
|
|
double zfar;
|
|
|
|
Matrix4 project;
|
|
Matrix4 unproject;
|
|
} CameraDefinition;
|
|
|
|
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;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|