Saxum/level.hh

82 lines
2.7 KiB
C++
Raw Normal View History

2014-10-20 16:38:29 +00:00
#ifndef LEVEL_HH_INCLUDED
#define LEVEL_HH_INCLUDED
#include <string>
#include "object.hh"
#include "light.hh"
2014-10-20 16:38:29 +00:00
#include "entity.hh"
2014-10-20 17:07:45 +00:00
#include "terrain.hh"
#include "material.hh"
#include "camera.hh"
#include "physics.hh"
#include "trigger.hh"
2014-10-20 16:38:29 +00:00
extern "C" {
#include "extern/lua/src/lua.h"
#include "extern/lua/src/lualib.h"
#include "extern/lua/src/lauxlib.h"
}
#include "extern/luabridge/LuaBridge.h"
2014-10-20 16:38:29 +00:00
class Level {
public:
Level(std::string heightmapFilePath, std::string xmlFilePath);
Level();
2014-10-20 16:38:29 +00:00
~Level();
void load();
void update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta,bool wPressed, bool aPressed,bool sPressed, bool dPressed, bool kPressed, bool lPressed);
void render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass,
glm::mat4* viewProjectionMatrix, std::vector<glm::mat4>* shadowVPs=0);
2014-10-30 22:59:03 +00:00
glm::vec3 getAmbientLight();
2014-11-17 16:51:15 +00:00
Light* getDirectionalLight();
std::vector<Light>* getLights();
Object* getCameraCenter();
2014-11-15 13:54:44 +00:00
Camera* getCamera();
glm::vec3 getCameraPosition();
glm::vec4 getFogColour();
2014-11-21 23:39:58 +00:00
void setSkydomeSize(float size);
float getSkydomeSize();
2015-03-04 15:08:03 +00:00
Object* getSkydome();
std::vector<Object*>* getObjects();
std::vector<Object*>* getPhysicsObjects();
void deleteObject(int objectIndex);
void moveObject(int objectIndex, float strength, float xPos, float yPos, float zPos);
void setStrength(float strength);
void setSkydomeObject(Object* object);
void addObject(Object* object);
void addPhysicsObject(Object* object);
void setAmbientLight(glm::vec3 colour);
void setFogColour(glm::vec4 colour);
void setDirectionalLight(Light light);
Physics* getPhysics();
unsigned int getObjectsVectorSize();
unsigned int getPhysicsObjectsVectorSize();
void setCameraCenter(Object* object);
void addLight(Light light);
void addTrigger(Trigger trigger);
lua_State* getLuaState();
Terrain* getTerrain();
void resetPlayer();
void setPlayerIndex(int index);
2014-10-20 16:38:29 +00:00
private:
lua_State* luaState=nullptr;
std::vector<Object*> objects;
std::vector<Object*> physicsObjects;
std::vector<Light> lights;
std::vector<Trigger> triggers;
glm::vec3 ambientLight;
glm::vec4 fogColour;
2014-11-17 16:51:15 +00:00
Light directionalLight;
Object* cameraCenter;
int playerIndex;
Object* skydome;
Physics physics;
Camera camera;
2014-10-20 17:07:45 +00:00
Terrain terrain;
2014-11-21 23:39:58 +00:00
float skydomeSize;
float strength;
std::string xmlFilePath;
2014-10-20 16:44:23 +00:00
};
2014-10-20 16:48:20 +00:00
#endif