1#include "WebDemoScene.h"
2#include "../Util/Render/SEnvironmentMgr.h"
3#include "../Component/LightComponent.h"
4#include "../Component/CameraComponent.h"
5#include "../Component/CustomComponent.h"
7#include "../Util/Loader/DAE/DAELoader.h"
8#include "../Util/Render/SFrameBuffer.h"
9#include "../../Assets/cube.h"
13void WebDemoScene::Init() {
15 SPrefab* stormtrooper = SResource::Create<SPrefab>(
"model.prefab");
18 auto ab = stormtrooper->Clone(
vec3{ 0, -0.3f, 0 }, root);
20 ab->GetTransform()->m_scale =
vec3{ 0.08f, 0.08f, 0.08f };
21 ab->GetTransform()->m_rotation = Quaternion::AngleAxis(
vec3{1, 0, 0}, Pi/2.f);
23 ab->GetComponent<
CustomComponent>()->SetClassName(
"Stormtrooper.script");
27 camera->GetTransform()->m_position =
vec3{0, 0, 1.2f };
28 camera_comp->SetBackgroundSkybox();
29 camera_comp->SetBackgroundType(CameraBase::SKYBOX);
32 direction->SetParent(root);
33 direction->SetName(
"directional");
34 direction->GetTransform()->m_position =
vec3{ 0.f, 0.5f, 0.f };
37 direction->GetComponent<
LightComponent>()->SetLightType(LightComponent::DIRECTIONAL);
45void WebDemoScene::Tick(
float elapsedTime) {
49void WebDemoScene::Destroy() {