Added a few models and removed ortho camera perspectiv.
This commit is contained in:
+26
-39
@@ -98,14 +98,15 @@ public:
|
||||
|
||||
//TODO: Remove tobias light-test code.
|
||||
|
||||
//OctoBall
|
||||
{
|
||||
auto ent = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
|
||||
transform->Position = glm::vec3(0.5f, 0.f, -9.9f);
|
||||
transform->Scale = glm::vec3(1.f, 1.f, 1.f);
|
||||
|
||||
std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(ent);
|
||||
sprite->SpriteFile = "Textures/Ball.png";
|
||||
auto model = m_World->AddComponent<Components::Model>(ent);
|
||||
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
|
||||
|
||||
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
|
||||
std::shared_ptr<Components::Ball> ball = m_World->AddComponent<Components::Ball>(ent);
|
||||
@@ -125,28 +126,35 @@ public:
|
||||
m_EventBroker->Publish(e);
|
||||
}
|
||||
|
||||
//PointLightTest
|
||||
{
|
||||
auto t_BrickWall = m_World->CreateEntity();
|
||||
auto transform = m_World->AddComponent<Components::Transform>(t_BrickWall);
|
||||
transform->Position = glm::vec3(0.f, 0.f, -10.f);
|
||||
auto sprite = m_World->AddComponent<Components::Sprite>(t_BrickWall);
|
||||
//TODO: Rename SpriteFile to DiffuseTexture or similar.
|
||||
sprite->SpriteFile = "Textures/Ball.png";
|
||||
sprite->NormalTexture = "Textures/Test/Brick_Normal.png";
|
||||
sprite->SpecularTexture = "Textures/Test/Brick_Specular.png";
|
||||
auto t_Light = m_World->CreateEntity();
|
||||
auto transform = m_World->AddComponent<Components::Transform>(t_Light);
|
||||
transform->Position = glm::vec3(0.f, 0.f, -9.f);
|
||||
auto pl = m_World->AddComponent<Components::PointLight>(t_Light);
|
||||
pl->Radius = 10.f;
|
||||
}
|
||||
|
||||
//Halfpipe background test model.
|
||||
{
|
||||
auto t_BrickWall = m_World->CreateEntity();
|
||||
auto transform = m_World->AddComponent<Components::Transform>(t_BrickWall);
|
||||
transform->Position = glm::vec3(0.4f, 0.f, -9.5f);
|
||||
auto sprite = m_World->AddComponent<Components::Sprite>(t_BrickWall);
|
||||
//TODO: Rename SpriteFile to DiffuseTexture or similar.
|
||||
sprite->SpriteFile = "Textures/Ball.png";
|
||||
sprite->NormalTexture = "Textures/Test/Brick_Normal.png";
|
||||
sprite->SpecularTexture = "Textures/Test/Brick_Specular.png";
|
||||
auto t_halfPipe = m_World->CreateEntity();
|
||||
auto transform = m_World->AddComponent<Components::Transform>(t_halfPipe);
|
||||
transform->Position = glm::vec3(0.f, 0.f, -15.f);
|
||||
transform->Scale = glm::vec3(15.f);
|
||||
auto model = m_World->AddComponent<Components::Model>(t_halfPipe);
|
||||
model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj";
|
||||
}
|
||||
|
||||
//Brick test model
|
||||
{
|
||||
auto t_Brick = m_World->CreateEntity();
|
||||
auto transform = m_World->AddComponent<Components::Transform>(t_Brick);
|
||||
transform->Position = glm::vec3(0.f, 0.f, -12.f);
|
||||
auto model = m_World->AddComponent<Components::Model>(t_Brick);
|
||||
model->ModelFile = "Models/Test/Brick/Brick.obj";
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
auto topWall = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(topWall);
|
||||
@@ -196,25 +204,6 @@ public:
|
||||
m_World->CommitEntity(rightWall);
|
||||
}
|
||||
|
||||
|
||||
/*{
|
||||
auto ent = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
|
||||
transform->Position = glm::vec3(0.f, -3.f, -10.f);
|
||||
transform->Scale = glm::vec3(8.f, 0.5f, 1.f);
|
||||
transform->Orientation = glm::rotate(transform->Orientation, glm::radians(25.f), glm::vec3(0, 0, -1));
|
||||
|
||||
std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(ent);
|
||||
sprite->SpriteFile = "Textures/Core/ErrorTexture.png";
|
||||
|
||||
std::shared_ptr<Components::RectangleShape> boxShape = m_World->AddComponent<Components::RectangleShape>(ent);
|
||||
|
||||
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->Static = true;
|
||||
|
||||
m_World->CommitEntity(ent);
|
||||
}*/
|
||||
|
||||
{
|
||||
auto ent = m_World->CreateEntity();
|
||||
m_World->SetProperty(ent, "Name", "Pad");
|
||||
@@ -376,8 +365,6 @@ public:
|
||||
job.EndIndex = texGroup.EndIndex;
|
||||
job.ModelMatrix = modelMatrix;
|
||||
job.Color = color;
|
||||
//TODO: This Depth is probably wrong.
|
||||
job.Depth = (glm::vec4(1,1,1,0) * modelMatrix).z;
|
||||
|
||||
m_RendererQueue.Deferred.Add(job);
|
||||
}
|
||||
|
||||
Regular → Executable
+1
@@ -16,6 +16,7 @@
|
||||
#include "Physics/CBoxShape.h"
|
||||
#include "Physics/CPhysics.h"
|
||||
#include "Rendering/CSprite.h"
|
||||
#include "Rendering/CModel.h"
|
||||
#include "Game/CBall.h"
|
||||
#include "Core/Component.h"
|
||||
#include "Physics/ESetImpulse.h"
|
||||
|
||||
Reference in New Issue
Block a user