This commit is contained in:
ViktorLjung
2014-03-13 03:03:11 +01:00
parent fad346d76f
commit 40725bd2d4
3 changed files with 7 additions and 9 deletions
@@ -29,20 +29,20 @@ void Systems::LevelGenerationSystem::SpawnObstacle()
switch (typeRandom)
{
case 0:
case 0: // Mountain stuff :D
{
transform->Position = glm::vec3( positionRandom, startyz); // fix position
float scale = (float)(rand() % 1000) / 100;
float scale = (float)(rand() % 1000) / 200;
transform->Scale = glm::vec3(scale);
bounds->VolumeVector = glm::vec3(9, 12, 7);
bounds->Origin = glm::vec3(1,11,-1);
model->ModelFile = "Models/obstacle_mountain_1.obj";
}
break;
case 1:
case 1: // Single Mountain :D
{
transform->Position = glm::vec3( positionRandom, startyz); // fix position
float scale = (float)(rand() % 1000) / 100;
float scale = (float)(rand() % 1000) / 200;
transform->Scale = glm::vec3(scale);
bounds->VolumeVector = glm::vec3(3.5f, 7.5f, 3.5f);
bounds->Origin = glm::vec3(0,7.5f,0);
@@ -51,10 +51,8 @@ void Systems::LevelGenerationSystem::SpawnObstacle()
break;
case 2:
{
transform->Position = glm::vec3( positionRandom, startyz); // fix position
float scale = (float)(rand() % 1000) / 100;
float scale = (float)(rand() % 1000) / 200;
transform->Scale = glm::vec3(scale);
bounds->VolumeVector = glm::vec3(1, 1, 1);
@@ -7,7 +7,7 @@
#include "Components/Bounds.h"
#include "Components/Collision.h"
#include "Components/Model.h"
#include "Components/PointLight.h"
namespace Systems
{
+1 -1
View File
@@ -32,7 +32,7 @@ void Systems::RenderSystem::UpdateEntity( double dt, EntityID entity, EntityID p
#ifdef DEBUG
auto bounds = m_World->GetComponent<Components::Bounds>(entity, "Bounds");
if (bounds != nullptr) {
glm::vec3 origin = transformComponent->Scale * (transformComponent->Position + bounds->Origin);
glm::vec3 origin = transformComponent->Position + (transformComponent->Scale * bounds->Origin);
glm::vec3 volumeVector = transformComponent->Scale * bounds->VolumeVector;
m_Renderer->AddAABBToDraw(origin, volumeVector);
}