mirror of
https://github.com/Kbz-8/42_vox.git
synced 2026-01-13 07:33:35 +00:00
working on chunk generation
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef __SCOP_RENDERER_ACTOR__
|
||||
#define __SCOP_RENDERER_ACTOR__
|
||||
#ifndef __SCOP_GRAPHICS_ACTOR__
|
||||
#define __SCOP_GRAPHICS_ACTOR__
|
||||
|
||||
#include <Maths/Vec3.h>
|
||||
#include <Maths/Vec4.h>
|
||||
@@ -11,12 +11,13 @@ namespace Scop
|
||||
{
|
||||
class Actor
|
||||
{
|
||||
friend Scene;
|
||||
|
||||
public:
|
||||
Actor();
|
||||
Actor(Model model);
|
||||
|
||||
inline void AttachScript(std::shared_ptr<ActorScript> script) { p_script = script; }
|
||||
void Update(NonOwningPtr<class Scene> scene, class Inputs& input, float timestep);
|
||||
|
||||
inline void SetColor(Vec4f color) noexcept { m_color = color; }
|
||||
inline void SetPosition(Vec3f position) noexcept { m_position = position; }
|
||||
@@ -32,6 +33,9 @@ namespace Scop
|
||||
|
||||
~Actor();
|
||||
|
||||
public:
|
||||
void Update(NonOwningPtr<class Scene> scene, class Inputs& input, float timestep);
|
||||
|
||||
private:
|
||||
Model m_model;
|
||||
Quatf m_orientation = Quatf::Identity();
|
||||
|
||||
38
ScopEngine/Runtime/Includes/Graphics/Narrator.h
git.filemode.normal_file
38
ScopEngine/Runtime/Includes/Graphics/Narrator.h
git.filemode.normal_file
@@ -0,0 +1,38 @@
|
||||
#ifndef __SCOP_GRAPHICS_NARRATOR__
|
||||
#define __SCOP_GRAPHICS_NARRATOR__
|
||||
|
||||
#include <Maths/Vec3.h>
|
||||
#include <Maths/Vec4.h>
|
||||
#include <Maths/Quaternions.h>
|
||||
#include <Core/Script.h>
|
||||
#include <Graphics/Model.h>
|
||||
|
||||
namespace Scop
|
||||
{
|
||||
class Narrator
|
||||
{
|
||||
friend Scene;
|
||||
|
||||
public:
|
||||
Narrator() = default;
|
||||
inline void AttachScript(std::shared_ptr<NarratorScript> script) { p_script = script; }
|
||||
inline ~Narrator()
|
||||
{
|
||||
if(p_script)
|
||||
p_script->OnQuit();
|
||||
}
|
||||
|
||||
private:
|
||||
inline void Update(NonOwningPtr<class Scene> scene, class Inputs& input, float timestep)
|
||||
{
|
||||
if(p_script)
|
||||
p_script->OnUpdate(scene, input, timestep);
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<NarratorScript> p_script;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <Utils/NonOwningPtr.h>
|
||||
|
||||
#include <Graphics/Actor.h>
|
||||
#include <Graphics/Narrator.h>
|
||||
#include <Graphics/Sprite.h>
|
||||
#include <Renderer/Buffer.h>
|
||||
#include <Renderer/Descriptor.h>
|
||||
@@ -47,6 +48,9 @@ namespace Scop
|
||||
Actor& CreateActor(Model model) noexcept;
|
||||
Actor& CreateActor(std::string_view name, Model model);
|
||||
|
||||
Narrator& CreateNarrator() noexcept;
|
||||
Narrator& CreateNarrator(std::string_view name);
|
||||
|
||||
Sprite& CreateSprite(std::shared_ptr<Texture> texture) noexcept;
|
||||
Sprite& CreateSprite(std::string_view name, std::shared_ptr<Texture> texture);
|
||||
|
||||
@@ -82,6 +86,7 @@ namespace Scop
|
||||
std::shared_ptr<CubeTexture> p_skybox;
|
||||
std::vector<std::shared_ptr<Actor>> m_actors;
|
||||
std::vector<std::shared_ptr<Sprite>> m_sprites;
|
||||
std::vector<std::shared_ptr<Narrator>> m_narrators;
|
||||
std::vector<Scene> m_scene_children;
|
||||
std::string m_name;
|
||||
NonOwningPtr<Scene> p_parent;
|
||||
|
||||
Reference in New Issue
Block a user