25 #ifndef FREESCAPE_AREA_H 26 #define FREESCAPE_AREA_H 29 #include "math/vector3d.h" 31 #include "freescape/language/instruction.h" 32 #include "freescape/objects/object.h" 33 #include "freescape/objects/group.h" 42 Area(uint16 areaID, uint16 areaFlags, ObjectMap *objectsByID, ObjectMap *entrancesByID,
bool isCastle);
46 Object *objectWithID(uint16 objectID);
47 Object *entranceWithID(uint16 objectID);
50 void changeObjectID(uint16 objectID, uint16 newObjectID);
51 ObjectArray getSensors();
54 uint16 getAreaFlags();
56 void remapColor(
int index,
int color);
57 void unremapColor(
int index);
58 void draw(
Renderer *gfx, uint32 animationTicks, Math::Vector3d camera, Math::Vector3d direction,
bool insideWait);
59 void drawGroup(
Renderer *gfx,
Group *group,
bool runAnimation);
62 Object *checkCollisionRay(
const Math::Ray &ray,
int raySize);
63 bool checkInSight(
const Math::Ray &ray,
float maxDistance);
64 Math::Vector3d separateFromWall(
const Math::Vector3d &position);
65 ObjectArray checkCollisions(
const Math::AABB &boundingBox);
66 bool checkIfPlayerWasCrushed(
const Math::AABB &boundingBox);
67 Math::Vector3d resolveCollisions(Math::Vector3d
const &lastPosition, Math::Vector3d
const &newPosition,
int playerHeight);
68 void addObjectFromArea(int16
id,
Area *global);
69 void addGroupFromArea(int16
id,
Area *global);
70 void addObject(
Object *obj);
72 void addStructure(
Area *global);
73 void removeObject(int16
id);
75 void resetAreaGroups();
77 bool hasActiveGroups();
88 uint32 _gasPocketRadius;
96 uint8 _usualBackgroundColor;
97 uint8 _underFireBackgroundColor;
100 uint8 _extraColor[4];
106 Math::Vector3d _lastCameraPosition;
107 ObjectArray _sortedObjects;
111 ObjectMap *_objectsByID;
112 ObjectMap *_entrancesByID;
113 ObjectArray _drawableObjects;
114 ObjectMap _addedObjects;
115 Object *objectWithIDFromMap(ObjectMap *map, uint16 objectID);
120 #endif // FREESCAPE_AREA_H