Renderer working and some test blocks in the world
This commit is contained in:
@@ -70,9 +70,6 @@ public:
|
|||||||
m_World->SystemFactory.Register<Systems::TransformSystem>(
|
m_World->SystemFactory.Register<Systems::TransformSystem>(
|
||||||
[this]() { return new Systems::TransformSystem(m_World.get(), m_EventBroker); });
|
[this]() { return new Systems::TransformSystem(m_World.get(), m_EventBroker); });
|
||||||
m_World->AddSystem<Systems::TransformSystem>();
|
m_World->AddSystem<Systems::TransformSystem>();
|
||||||
// m_World->ComponentFactory.Register<Components::Model>();
|
|
||||||
// m_World->ComponentFactory.Register<Components::Template>();
|
|
||||||
|
|
||||||
|
|
||||||
m_World->ComponentFactory.Register<Components::Sprite>();
|
m_World->ComponentFactory.Register<Components::Sprite>();
|
||||||
|
|
||||||
@@ -130,9 +127,9 @@ public:
|
|||||||
{
|
{
|
||||||
auto t_Light = m_World->CreateEntity();
|
auto t_Light = m_World->CreateEntity();
|
||||||
auto transform = m_World->AddComponent<Components::Transform>(t_Light);
|
auto transform = m_World->AddComponent<Components::Transform>(t_Light);
|
||||||
transform->Position = glm::vec3(0.f, 0.f, -9.f);
|
transform->Position = glm::vec3(2.f, 1.5f, -10.f);
|
||||||
auto pl = m_World->AddComponent<Components::PointLight>(t_Light);
|
auto pl = m_World->AddComponent<Components::PointLight>(t_Light);
|
||||||
pl->Radius = 10.f;
|
pl->Radius = 8.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Halfpipe background test model.
|
//Halfpipe background test model.
|
||||||
@@ -150,10 +147,11 @@ public:
|
|||||||
auto t_Brick = m_World->CreateEntity();
|
auto t_Brick = m_World->CreateEntity();
|
||||||
auto transform = m_World->AddComponent<Components::Transform>(t_Brick);
|
auto transform = m_World->AddComponent<Components::Transform>(t_Brick);
|
||||||
transform->Position = glm::vec3(0.f, 0.f, -12.f);
|
transform->Position = glm::vec3(0.f, 0.f, -12.f);
|
||||||
|
transform->Orientation = glm::rotate(glm::quat(), 0.5f, glm::vec3(0,-1,-1));
|
||||||
auto model = m_World->AddComponent<Components::Model>(t_Brick);
|
auto model = m_World->AddComponent<Components::Model>(t_Brick);
|
||||||
model->ModelFile = "Models/Test/Brick/Brick.obj";
|
model->ModelFile = "Models/Test/Brick/Brick.obj";
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto topWall = m_World->CreateEntity();
|
auto topWall = m_World->CreateEntity();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ void main()
|
|||||||
//frag_Diffuse = DiffuseTexel * (vec4(La, 0.0) * (vec4(LightingTexel.rgb, 0.0) + vec4(LightingTexel.a, LightingTexel.a, LightingTexel.a, 0.0)));
|
//frag_Diffuse = DiffuseTexel * (vec4(La, 0.0) * (vec4(LightingTexel.rgb, 0.0) + vec4(LightingTexel.a, LightingTexel.a, LightingTexel.a, 0.0)));
|
||||||
//frag_Diffuse = DiffuseTexel * (vec4(La, 0.0) + LightingTexel);
|
//frag_Diffuse = DiffuseTexel * (vec4(La, 0.0) + LightingTexel);
|
||||||
//frag_Diffuse = DiffuseTexel * (vec4(1.f, 1.f, 1.f, 0.0) + LightingTexel);
|
//frag_Diffuse = DiffuseTexel * (vec4(1.f, 1.f, 1.f, 0.0) + LightingTexel);
|
||||||
frag_Diffuse = DiffuseTexel;
|
frag_Diffuse = DiffuseTexel + LightingTexel;
|
||||||
|
//frag_Diffuse = DiffuseTexel;
|
||||||
//frag_Diffuse = vec4(LightingTexel.r, LightingTexel.g, LightingTexel.b, 1.0);
|
//frag_Diffuse = vec4(LightingTexel.r, LightingTexel.g, LightingTexel.b, 1.0);
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "Core/World.h"
|
#include "Core/World.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <Game/CPad.h>
|
#include <Game/CPad.h>
|
||||||
|
#include <Rendering/CPointLight.h>
|
||||||
|
|
||||||
|
|
||||||
void dd::Systems::PadSystem::Initialize()
|
void dd::Systems::PadSystem::Initialize()
|
||||||
@@ -147,6 +148,7 @@ bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event)
|
|||||||
transform->Scale = glm::vec3(1.f, 1.f, 1.f);
|
transform->Scale = glm::vec3(1.f, 1.f, 1.f);
|
||||||
auto model = m_World->AddComponent<Components::Model>(ent);
|
auto model = m_World->AddComponent<Components::Model>(ent);
|
||||||
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
|
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
|
||||||
|
//auto pointlight = m_World->AddComponent<Components::PointLight>(ent);
|
||||||
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
|
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
|
||||||
std::shared_ptr<Components::Ball> cball = m_World->AddComponent<Components::Ball>(ent);
|
std::shared_ptr<Components::Ball> cball = m_World->AddComponent<Components::Ball>(ent);
|
||||||
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
|
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
|
||||||
|
|||||||
Reference in New Issue
Block a user