28 event_dispatcher::AddEventListner<mouse_button_event>([&](
mouse_button_event &Event) { CallUpdate();
return false; });
29 event_dispatcher::AddEventListner<mouse_wheel_event>([&](
mouse_wheel_event &Event) { CallUpdate();
return false; });
30 event_dispatcher::AddEventListner<mouse_move_event>([&](
mouse_move_event &Event) { CallUpdate();
return false; });
31 event_dispatcher::AddEventListner<keyboard_event>([&](
keyboard_event &Event) { CallUpdate();
return false; });
34 if (Event.GetViewportId() == ViewportId)
35 ViewportWidth = Event.GetWidth(),
36 ViewportHeight = Event.GetHeight();
45void scl::scene::CallUpdate()
50 if (!native_script.ObjectBehaviour)
52 native_script.ObjectBehaviour = native_script.Instanciate();
53 native_script.ObjectBehaviour->Object =
scene_object { entity,
this };
54 native_script.ObjectBehaviour->OnCreate();
58 if (native_script.IsActive)
59 native_script.ObjectBehaviour->OnUpdate();
66 if (UpdateDelay < 0.015)
return;
76 if (
camera.IsPrimary) { primary_camera = &
camera.Camera;
break; }
77 if (primary_camera ==
nullptr)
return;
78 if (primary_camera->GetViewportWidth() != ViewportWidth || primary_camera->GetViewportHeight() != ViewportHeight)
79 primary_camera->
Resize(ViewportWidth, ViewportHeight);
88 vec3 direction = transform.AnglesMatr.TransformVector(
vec3 { 0, -1, 0 });
89 vec3 at = transform.Position + direction;
96 vec3 direction = transform.AnglesMatr.TransformVector(
vec3 { 0, -1, 0 });
101 for (
auto &&[entity,
mesh, transform] : Registry.group<
mesh_component>(entt::get<transform_component>).each())
109 scene_object created_object { this->Registry.create(),
this };
111 return created_object;
116 for (
auto &&[entity, name] : Registry.view<
name_component>().each())
117 if (name.Name == Name)
return scene_object { entity,
this };
118 return this->CreateObject(Name);
128 Registry.destroy(Object.Entity);
129 Object.Entity = entt::null;
130 Object.Scene =
nullptr;
Static hich-level renderer class implementation module. Implements objects rendering functions via re...
camera & Resize(int ViewportWidth, int ViewportHeight)
static matr4 View(vec3< float > Location, vec3< float > At, vec3< float > Up)
static void StartPipeline(const camera &Camera, const vec3 &EnviromentAmbiente)
static void Submit(const shared< mesh > &Mesh, const vec3 &Scale, const vec3 &Angles, const vec3 &Position)
static void SubmitSpotLight(const vec3 &Position, const vec3 &Direction, const vec3 &Color, float InnerCutoffCos, float OuterCutoffCos, float Epsilon)
static void SubmitPointLight(const vec3 &Position, const vec3 &Color, float Constant, float Linear, float Quadratic)
static void EndPipeline()
static void SubmitDirectionalLight(const vec3 &Direction, const vec3 &Color, bool IsShadows=false, const matr4 &ViewProjection={}, const shared< frame_buffer > &ShadowMap=nullptr)
decltype(auto) AddComponent(Targs &&... Args)
scene_object CreateObject(const std::string &Name="")
void RemoveObject(scene_object &Object)
scene_object GetSceneObject(scene_object_handle SceneObjectHandle)
scene_object CreaetOrGetObject(const std::string &Name)
static float GetDeltaTime()
Application scene objects system components include module.
Mesh material class deinition module.
Mesh interfaces definition module. Mesh stores vertex and index buffer and implement their binding du...
entt::entity scene_object_handle
Topology objects points array (useful for creation dummy rendering object) class declaration module.
Render bridge class implementation module. Static class for making calls to low-level render api,...
Scene class defintion module.
Application scene object class defintion module.
Application scene object behaviour class defintion module.
Sculpto library prehompiled header. Defines common definitions, includes commonly used modules.
Texture interface definition module.
Timer, calculating interframe deltatime and fps class implementation module.