123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- /*!
- * \file include/RoomData.h
- * \brief World Room Mesh
- *
- * \author xythobuz
- */
-
- #ifndef _ROOM_DATA_H_
- #define _ROOM_DATA_H_
-
- #include <vector>
- #include <memory>
- #include "math/Matrix.h"
- #include "TombRaider.h"
-
- class BoundingBox {
- public:
- BoundingBox();
- void getBoundingBox(float box[2][3]);
- void setBoundingBox(float min[3], float max[3]);
- void display(bool points, const unsigned char c1[4], const unsigned char c2[4]);
- bool inBox(float x, float y, float z);
- bool inBoxPlane(float x, float z);
-
- private:
- float a[3], b[3];
- };
-
- class Light {
- public:
- /*!
- * \brief Type a light can be of
- */
- typedef enum {
- typePoint = 1, //!< Point light
- typeSpot = 2, //!< Spot light
- typeDirectional = 3 //!< Directional light
- } LightType;
-
- Light(TombRaider &tr, unsigned int room, unsigned int index);
-
- void getPos(float p[4]);
- void getDir(float d[3]);
- float getAtt();
- void getColor(float c[4]);
- float getCutoff();
- LightType getType();
-
- private:
- float pos[4]; //! Light position in 3 space
- float dir[3]; //! Light direction
- float att;
- float color[4]; //! Color of light
- float cutoff; //! Fade out distance
- LightType type; //! Type of light
- };
-
- class StaticModel {
- public:
- StaticModel(TombRaider &tr, unsigned int room, unsigned int i);
- void display();
-
- // Compares distance to ViewVolume for depth sorting
- bool operator<(const StaticModel &other);
- static bool compare(StaticModel *a, StaticModel *b);
-
- private:
- int index;
- float yaw;
- float pos[3];
-
- // ?
- //float bbox[2][3];
- };
-
- class Portal {
- public:
- Portal(TombRaider &tr, unsigned int room, unsigned int index, Matrix &transform);
-
- void getVertices(float vert[4][3]);
- int getAdjoiningRoom();
-
- private:
- float vertices[4][3];
- float normal[3];
- int adjoiningRoom;
- };
-
- class Box {
- public:
- Box(TombRaider &tr, unsigned int room, unsigned int index);
-
- private:
- float a[3], b[3], c[3], d[3];
- };
-
- class Sector {
- public:
- Sector(TombRaider &tr, unsigned int room, unsigned int index);
- float getFloor();
- float getCeiling();
- bool isWall();
-
- private:
- float floor;
- float ceiling;
- bool wall;
- };
-
- #endif
|