5#ifndef __SCENE_GRAPH_H__
6#define __SCENE_GRAPH_H__
21#include "ObjectList.h"
23#include "QuadtreeNode.h"
27#if !defined(SG_SIMP) && !defined(SG_QUAD) && !defined(SG_GRID)
28#pragma message "Must #define exactly one of: SG_SIMPLE, SG_QUAD, SG_GRID"
29#elif defined(SG_SIMP) && (defined(SG_QUAD) || defined(SG_GRID))
30#pragma message "Must #define exactly one of: SG_SIMPLE, SG_QUAD, SG_GRID"
31#elif defined(SG_QUAD) && (defined(SG_SIMP) || defined(SG_GRID))
32#pragma message "Must #define exactly one of: SG_SIMPLE, SG_QUAD, SG_GRID"
33#elif defined(SG_GRID) && (defined(SG_SIMP) || defined(SG_QUAD))
34#pragma message "Must #define exactly one of: SG_SIMPLE, SG_QUAD, SG_GRID"
39const int MAX_ALTITUDE = 4;
48 std::map<std::string, ObjectList>
m_type;
Definition: ObjectList.h:15
Definition: QuadtreeNode.h:16
Definition: SceneGraph.h:41
int updateType(Object *p_o, std::string new_type)
Re-position Object in SceneGraph to new type.
ObjectList visibleObjects(int altitude) const
Return all active, visible Objects at altitude. Empty list if none.
ObjectList m_visible_objects[MAX_ALTITUDE+1]
Visible Objects.
Definition: SceneGraph.h:46
void shutDown()
Shutdown Scenegraph (delete Quadtree, clear Grid).
int startUp()
Startup Scenegraph (create Grid).
int updateSolidness(Object *p_o, Solidness new_solidness)
Re-position Object in SceneGraph to new solidness.
ObjectList activeObjects() const
Return all active Objects. Empty list if none.
ObjectList solidObjects() const
Return all active, solid Objects. Empty list if none.
Grid m_grid
Grid for collision detection.
Definition: SceneGraph.h:50
int insertObject(Object *p_o)
Insert Object into SceneGraph.
ObjectList m_inactive_objects
All inactive Objects.
Definition: SceneGraph.h:47
ObjectList m_solid_objects
Solid Objects.
Definition: SceneGraph.h:45
Grid * getGrid()
Get Grid.
int removeObject(Object *p_o)
Remove Object from SceneGraph.
ObjectList getCollisions(Object *p_o, Vector where) const
Return list of solid Objects collided with at position 'where'.
ObjectList m_active_objects
All active Objects.
Definition: SceneGraph.h:44
ObjectList objectsOfType(std::string type)
Return list of Objects matching type.
int updateActive(Object *p_o, bool new_active)
Re-position Object in SceneGraph to new activeness.
int updatePosition(Object *p_o, Vector new_position)
Set position of Object in SceneGraph.
int updateVisible(Object *p_vo, bool new_visible)
Re-position Object in SceneGraph to new visibility.
std::map< std::string, ObjectList > m_type
Map of type:Object.
Definition: SceneGraph.h:48
int updateAltitude(Object *p_o, int new_alt)
Re-position Object in SceneGraph to new altitude.
ObjectList inactiveObjects() const
Return all inactive Objects. Empty list if none.
An animation for a sprite.
Definition: Animation.h:15
Solidness
Types of solidness of Object.
Definition: Object.h:26