Removing angular(Velocity) from object class as it is not needed there.
This commit is contained in:
parent
2638b43b44
commit
715301552a
11
level.cc
11
level.cc
@ -26,7 +26,6 @@ void Level::load(ACGL::OpenGL::SharedShaderProgram shader) {
|
|||||||
Material material = Material("marbleTexture_small.png", 0.1f, 0.5f, 0.5f, 3.0f);
|
Material material = Material("marbleTexture_small.png", 0.1f, 0.5f, 0.5f, 3.0f);
|
||||||
//Create object
|
//Create object
|
||||||
Object object = Object(model, material, glm::vec3(0.0f, 10.0f, 0.0f),
|
Object object = Object(model, material, glm::vec3(0.0f, 10.0f, 0.0f),
|
||||||
glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f),
|
|
||||||
glm::vec3(0.0f, 0.0f, 0.0f), shader);
|
glm::vec3(0.0f, 0.0f, 0.0f), shader);
|
||||||
//add player to phy
|
//add player to phy
|
||||||
this->physics.addPlayer(1.25f,0.0f,10.0f,0.0f,1.0f,0);
|
this->physics.addPlayer(1.25f,0.0f,10.0f,0.0f,1.0f,0);
|
||||||
@ -38,22 +37,19 @@ void Level::load(ACGL::OpenGL::SharedShaderProgram shader) {
|
|||||||
Material torchMaterial = Material("torchTexture.png", 0.1f, 0.3f, 0.7f, 10.0f);
|
Material torchMaterial = Material("torchTexture.png", 0.1f, 0.3f, 0.7f, 10.0f);
|
||||||
//Create object
|
//Create object
|
||||||
Object torchObject = Object(torchModel, torchMaterial, glm::vec3(-3.0f, 6.0f, 0.0f),
|
Object torchObject = Object(torchModel, torchMaterial, glm::vec3(-3.0f, 6.0f, 0.0f),
|
||||||
glm::vec3(0.0f, 1.0472f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f),
|
glm::vec3(0.0f, 1.0472f, 0.0f), shader);
|
||||||
glm::vec3(0.0f, 0.0f, 0.0f), shader);
|
|
||||||
objects.push_back(torchObject);
|
objects.push_back(torchObject);
|
||||||
|
|
||||||
Model blockModel = Model("Block.obj", 1.0f);
|
Model blockModel = Model("Block.obj", 1.0f);
|
||||||
Material blockMaterial = Material("blockTexture_small.png", 0.1f, 0.6, 0.4f, 2.0f);
|
Material blockMaterial = Material("blockTexture_small.png", 0.1f, 0.6, 0.4f, 2.0f);
|
||||||
Object blockObject = Object(blockModel, blockMaterial, glm::vec3(2.0f, 7.0f, 2.0f),
|
Object blockObject = Object(blockModel, blockMaterial, glm::vec3(2.0f, 7.0f, 2.0f),
|
||||||
glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f),
|
glm::vec3(0.0f, 0.0f, 0.0f), shader);
|
||||||
shader);
|
|
||||||
objects.push_back(blockObject);
|
objects.push_back(blockObject);
|
||||||
|
|
||||||
Model columnModel = Model("Column.obj", 1.0f);
|
Model columnModel = Model("Column.obj", 1.0f);
|
||||||
Material columnMaterial = Material("columnTexture_small.png", 0.1f, 0.6, 0.4f, 2.0f);
|
Material columnMaterial = Material("columnTexture_small.png", 0.1f, 0.6, 0.4f, 2.0f);
|
||||||
Object columnObject = Object(columnModel, columnMaterial, glm::vec3(-2.0f, 7.0f, -2.0f),
|
Object columnObject = Object(columnModel, columnMaterial, glm::vec3(-2.0f, 7.0f, -2.0f),
|
||||||
glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f),
|
glm::vec3(0.0f, 0.0f, 0.0f), shader);
|
||||||
shader);
|
|
||||||
objects.push_back(columnObject);
|
objects.push_back(columnObject);
|
||||||
|
|
||||||
//set lighting parameters
|
//set lighting parameters
|
||||||
@ -72,7 +68,6 @@ void Level::load(ACGL::OpenGL::SharedShaderProgram shader) {
|
|||||||
//Create object
|
//Create object
|
||||||
Object terrainObject = Object(terrainModel, terrainMaterial,
|
Object terrainObject = Object(terrainModel, terrainMaterial,
|
||||||
glm::vec3(-0.5f*(float)this->terrain.getHeightmapHeight(), 0.0f, -0.5f*(float)this->terrain.getHeightmapWidth()),
|
glm::vec3(-0.5f*(float)this->terrain.getHeightmapHeight(), 0.0f, -0.5f*(float)this->terrain.getHeightmapWidth()),
|
||||||
glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f),
|
|
||||||
glm::vec3(0.0f, 0.0f, 0.0f), shader);
|
glm::vec3(0.0f, 0.0f, 0.0f), shader);
|
||||||
objects.push_back(terrainObject);
|
objects.push_back(terrainObject);
|
||||||
cameraCenter = &objects[0];
|
cameraCenter = &objects[0];
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#include "object.hh"
|
#include "object.hh"
|
||||||
|
|
||||||
Object::Object(Model model, Material material, glm::vec3 position, glm::vec3 rotation,
|
Object::Object(Model model, Material material, glm::vec3 position, glm::vec3 rotation,
|
||||||
glm::vec3 velocity, glm::vec3 angularVelocity, ACGL::OpenGL::SharedShaderProgram shader) :
|
ACGL::OpenGL::SharedShaderProgram shader) :
|
||||||
Entity(position, rotation) {
|
Entity(position, rotation) {
|
||||||
this->model = model;
|
this->model = model;
|
||||||
this->material = material;
|
this->material = material;
|
||||||
this->velocity = velocity;
|
|
||||||
this->angularVelocity = angularVelocity;
|
|
||||||
this->shader = shader;
|
this->shader = shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
class Object : public Entity {
|
class Object : public Entity {
|
||||||
public:
|
public:
|
||||||
Object(Model model, Material material, glm::vec3 position, glm::vec3 rotation,
|
Object(Model model, Material material, glm::vec3 position, glm::vec3 rotation,
|
||||||
glm::vec3 velocity, glm::vec3 angularVelocity,
|
|
||||||
ACGL::OpenGL::SharedShaderProgram shader);
|
ACGL::OpenGL::SharedShaderProgram shader);
|
||||||
Object();
|
Object();
|
||||||
~Object();
|
~Object();
|
||||||
@ -20,8 +19,6 @@ class Object : public Entity {
|
|||||||
private:
|
private:
|
||||||
Model model;
|
Model model;
|
||||||
Material material;
|
Material material;
|
||||||
glm::vec3 velocity;
|
|
||||||
glm::vec3 angularVelocity;
|
|
||||||
ACGL::OpenGL::SharedShaderProgram shader;
|
ACGL::OpenGL::SharedShaderProgram shader;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user