Adding ship model

This commit is contained in:
Dynamitos
2024-08-26 22:33:22 +02:00
parent 2fe39cfe8c
commit a602fd0ac3
96 changed files with 21 additions and 36 deletions
+20 -13
View File
@@ -4,6 +4,7 @@
#include "Component/Transform.h"
#include "System/FlyCamSystem.h"
#include "Component/Path.h"
#include "Component/WaterTile.h"
#include "System/SplineCamSystem.h"
#include "Graphics/StaticMeshVertexData.h"
@@ -119,21 +120,27 @@ void MeshShadingDemoGame::setupScene(PScene scene, PSystemGraph graph)
path = new Entity(scene);
path->attachComponent<Path>(p);
chapel = new StaticMeshActor(scene, AssetRegistry::findMesh("Whitechapel", "Whitechapel"));
//chapel->getTransform().setScale(Vector(0.01, 0.01, 0.01));
//flyCam = new FlyCam(scene);
//flyCam->attachComponent<Component::PointLight>(Vector4(0, 0, 0, 0), Vector4(1, 1, 1, 2));
//flyCam->getCamera().mainCamera = true;
followCam = new PathFollowCam(scene);
followCam->getPathFollow().path = path;
followCam->getCamera().mainCamera = true;
//suburbs = new StaticMeshActor(scene, AssetRegistry::findMesh("suburbs", "city-suburbs"));
//test = new StaticMeshActor(scene, AssetRegistry::findMesh("", "cube"));
//test->getTransform().setScale(Vector(1, 1, 1));
//test->getTransform().setPosition(Vector(0, 0, 100));
//chapel = new StaticMeshActor(scene, AssetRegistry::findMesh("Whitechapel", "Whitechapel"));
flyCam = new FlyCam(scene);
flyCam->attachComponent<Component::PointLight>(Vector4(0, 0, 0, 0), Vector4(1, 1, 1, 2));
flyCam->getCamera().mainCamera = true;
//followCam = new PathFollowCam(scene);
//followCam->getPathFollow().path = path;
//followCam->getCamera().mainCamera = true;
test = new StaticMeshActor(scene, AssetRegistry::findMesh("ship", "ship"));
test->getTransform().setScale(Vector(0.01f, 0.01f, 0.01f));
for (int32 x = -10; x < 10; ++x) {
for (int32 y = -10; y < 10; ++y) {
auto e = scene->createEntity();
scene->attachComponent<Component::WaterTile>(e, Component::WaterTile{
.location = UVector2(x, y),
.height = 0,
});
}
}
light = new DirectionalLightActor(scene, Vector4(0.2, 0.3, 0.2, 0.1), Vector(0.1, -1, 0.2));
light = new DirectionalLightActor(scene, Vector4(0.4, 0.6, 0.4, 0.1), Vector(0.1, -1, 0.2));
graph->addSystem(new FlyCamSystem(scene));
graph->addSystem(new SplineCamSystem(scene));
}
+1 -1
View File
@@ -6,7 +6,7 @@ FlyCamSystem::FlyCamSystem(PScene scene)
FlyCamSystem::~FlyCamSystem() {}
void FlyCamSystem::update(Component::KeyboardInput& input, Component::Camera& camera, Component::Transform& transform, Component::PointLight& light) {
float cameraMove = static_cast<float>(deltaTime);
float cameraMove = static_cast<float>(deltaTime) * 10;
if(input.keys[KeyCode::KEY_LEFT_SHIFT])
{
cameraMove *= 10;