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);
46 Object *objectWithID(uint16 objectID);
47 Object *entranceWithID(uint16 objectID);
50 void changeObjectID(uint16 objectID, uint16 newObjectID);
51 ObjectArray getSensors();
53 uint16 getAreaFlags();
55 void remapColor(
int index,
int color);
56 void unremapColor(
int index);
57 void draw(
Renderer *gfx, uint32 animationTicks, Math::Vector3d camera, Math::Vector3d direction);
58 void drawGroup(
Renderer *gfx,
Group *group,
bool runAnimation);
61 Object *checkCollisionRay(
const Math::Ray &ray,
int raySize);
62 bool checkInSight(
const Math::Ray &ray,
float maxDistance);
63 Math::Vector3d separateFromWall(
const Math::Vector3d &position);
64 ObjectArray checkCollisions(
const Math::AABB &boundingBox);
65 bool checkIfPlayerWasCrushed(
const Math::AABB &boundingBox);
66 Math::Vector3d resolveCollisions(Math::Vector3d
const &lastPosition, Math::Vector3d
const &newPosition,
int playerHeight);
67 void addObjectFromArea(int16
id,
Area *global);
68 void addGroupFromArea(int16
id,
Area *global);
69 void addObject(
Object *obj);
71 void addStructure(
Area *global);
72 void removeObject(int16
id);
74 void resetAreaGroups();
76 bool hasActiveGroups();
87 uint32 _gasPocketRadius;
92 uint8 _usualBackgroundColor;
93 uint8 _underFireBackgroundColor;
104 ObjectMap *_objectsByID;
105 ObjectMap *_entrancesByID;
106 ObjectArray _drawableObjects;
107 ObjectMap _addedObjects;
108 Object *objectWithIDFromMap(ObjectMap *map, uint16 objectID);
113 #endif // FREESCAPE_AREA_H