From 6ab9abdeba23a169e7acf84bbe572be174be65ce Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Sun, 26 Mar 2023 11:06:57 -0700 Subject: [PATCH] Adding some tags to scene item components for the prefab tool --- src/dawn/scene/components/display/Camera.hpp | 10 +++++++++- src/dawn/scene/components/display/MeshRenderer.hpp | 1 + .../scene/components/display/PixelPerfectCamera.hpp | 1 + .../components/display/SimpleRenderTargetQuad.hpp | 1 + src/dawn/scene/components/physics/2d/BoxCollider.hpp | 2 ++ .../components/physics/2d/CharacterController2D.hpp | 2 ++ .../scene/components/physics/3d/CapsuleCollider.hpp | 2 ++ .../components/physics/3d/CharacterController3D.hpp | 3 +++ src/dawn/scene/components/physics/3d/CubeCollider.hpp | 2 ++ .../scene/components/physics/3d/SphereCollider.hpp | 1 + .../scene/components/scene/SubSceneCameraAlign.hpp | 2 ++ src/dawn/scene/components/scene/SubSceneController.hpp | 2 ++ src/dawn/scene/components/ui/UIComponent.hpp | 2 ++ src/dawn/scene/components/ui/UIImage.hpp | 4 ++-- src/dawnrose/scene/components/GameCamera.hpp | 4 ++++ src/dawnrose/scene/components/PlayerController.hpp | 1 + 16 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/dawn/scene/components/display/Camera.hpp b/src/dawn/scene/components/display/Camera.hpp index 77112cc6..ab916727 100644 --- a/src/dawn/scene/components/display/Camera.hpp +++ b/src/dawn/scene/components/display/Camera.hpp @@ -28,16 +28,24 @@ namespace Dawn { return cam; } + // @optional StateProperty renderTarget; + // @optional StateProperty fov; + // @optional StateProperty type; + // @optional StateProperty orthoLeft; + // @optional StateProperty orthoRight; + // @optional StateProperty orthoBottom; + // @optional StateProperty orthoTop; - + // @optional StateProperty clipNear; + // @optional StateProperty clipFar; StateEvent eventRenderTargetResized; diff --git a/src/dawn/scene/components/display/MeshRenderer.hpp b/src/dawn/scene/components/display/MeshRenderer.hpp index da673a1f..83f8432e 100644 --- a/src/dawn/scene/components/display/MeshRenderer.hpp +++ b/src/dawn/scene/components/display/MeshRenderer.hpp @@ -15,6 +15,7 @@ namespace Dawn { MeshHost *meshHost = nullptr; public: + // @optional Mesh * mesh = nullptr; /** diff --git a/src/dawn/scene/components/display/PixelPerfectCamera.hpp b/src/dawn/scene/components/display/PixelPerfectCamera.hpp index 4da075e3..e8949af0 100644 --- a/src/dawn/scene/components/display/PixelPerfectCamera.hpp +++ b/src/dawn/scene/components/display/PixelPerfectCamera.hpp @@ -17,6 +17,7 @@ namespace Dawn { void updateDimensions(); public: + // @optional StateProperty scale; /** diff --git a/src/dawn/scene/components/display/SimpleRenderTargetQuad.hpp b/src/dawn/scene/components/display/SimpleRenderTargetQuad.hpp index 4a0f921b..854b0614 100644 --- a/src/dawn/scene/components/display/SimpleRenderTargetQuad.hpp +++ b/src/dawn/scene/components/display/SimpleRenderTargetQuad.hpp @@ -15,6 +15,7 @@ namespace Dawn { std::function evtResized; public: + // @optional StateProperty renderTarget; /** diff --git a/src/dawn/scene/components/physics/2d/BoxCollider.hpp b/src/dawn/scene/components/physics/2d/BoxCollider.hpp index 1c0da4bf..903b6a05 100644 --- a/src/dawn/scene/components/physics/2d/BoxCollider.hpp +++ b/src/dawn/scene/components/physics/2d/BoxCollider.hpp @@ -10,7 +10,9 @@ namespace Dawn { class BoxCollider : public Collider2D { public: + // @optional glm::vec2 min = glm::vec2(-0.5f, -0.5f); + // @optional glm::vec2 max = glm::vec2( 0.5f, 0.5f); BoxCollider(SceneItem *item); diff --git a/src/dawn/scene/components/physics/2d/CharacterController2D.hpp b/src/dawn/scene/components/physics/2d/CharacterController2D.hpp index e7890d94..7b9e9a06 100644 --- a/src/dawn/scene/components/physics/2d/CharacterController2D.hpp +++ b/src/dawn/scene/components/physics/2d/CharacterController2D.hpp @@ -12,7 +12,9 @@ namespace Dawn { void move(glm::vec2 distance); public: + // @optional glm::vec2 velocity; + // @optional float_t friction = 12.0f; CharacterController2D(SceneItem *i); diff --git a/src/dawn/scene/components/physics/3d/CapsuleCollider.hpp b/src/dawn/scene/components/physics/3d/CapsuleCollider.hpp index 881834e4..c0088b0b 100644 --- a/src/dawn/scene/components/physics/3d/CapsuleCollider.hpp +++ b/src/dawn/scene/components/physics/3d/CapsuleCollider.hpp @@ -16,7 +16,9 @@ namespace Dawn { ) override; public: + // @optional float_t height = 1; + // @optional float_t radius = 0.5f; CapsuleCollider(SceneItem *item); diff --git a/src/dawn/scene/components/physics/3d/CharacterController3D.hpp b/src/dawn/scene/components/physics/3d/CharacterController3D.hpp index c8d8477d..729e7dcd 100644 --- a/src/dawn/scene/components/physics/3d/CharacterController3D.hpp +++ b/src/dawn/scene/components/physics/3d/CharacterController3D.hpp @@ -9,8 +9,11 @@ namespace Dawn { class CharacterController3D : public SceneItemComponent { public: + // @optional glm::vec3 velocity = glm::vec3(0, 0, 0); + // @optional glm::vec3 gravity = glm::vec3(0, -1, 0); + // @optional float_t friction = 12.0f; CharacterController3D(SceneItem *item); diff --git a/src/dawn/scene/components/physics/3d/CubeCollider.hpp b/src/dawn/scene/components/physics/3d/CubeCollider.hpp index 03f15650..9cf020d7 100644 --- a/src/dawn/scene/components/physics/3d/CubeCollider.hpp +++ b/src/dawn/scene/components/physics/3d/CubeCollider.hpp @@ -16,7 +16,9 @@ namespace Dawn { ) override; public: + // @optional glm::vec3 min = glm::vec3(-0.5f, -0.5f, -0.5f); + // @optional glm::vec3 max = glm::vec3(0.5f, 0.5f, 0.5f); CubeCollider(SceneItem *item); diff --git a/src/dawn/scene/components/physics/3d/SphereCollider.hpp b/src/dawn/scene/components/physics/3d/SphereCollider.hpp index 31f119fb..c931fee5 100644 --- a/src/dawn/scene/components/physics/3d/SphereCollider.hpp +++ b/src/dawn/scene/components/physics/3d/SphereCollider.hpp @@ -15,6 +15,7 @@ namespace Dawn { ) override; public: + // @optional float_t radius = 1.0f; SphereCollider(SceneItem *item); diff --git a/src/dawn/scene/components/scene/SubSceneCameraAlign.hpp b/src/dawn/scene/components/scene/SubSceneCameraAlign.hpp index 060f41d2..4a393e84 100644 --- a/src/dawn/scene/components/scene/SubSceneCameraAlign.hpp +++ b/src/dawn/scene/components/scene/SubSceneCameraAlign.hpp @@ -20,7 +20,9 @@ namespace Dawn { void realign(); public: + // @optional StateProperty camera; + // @optional StateProperty renderTarget; /** diff --git a/src/dawn/scene/components/scene/SubSceneController.hpp b/src/dawn/scene/components/scene/SubSceneController.hpp index d894ccad..6301cdd0 100644 --- a/src/dawn/scene/components/scene/SubSceneController.hpp +++ b/src/dawn/scene/components/scene/SubSceneController.hpp @@ -9,7 +9,9 @@ namespace Dawn { class SubSceneController : public SceneItemComponent { public: + // @optional Scene *subScene = nullptr; + // @optional bool_t onlyUpdateUnpaused = false; SubSceneController(SceneItem *item); diff --git a/src/dawn/scene/components/ui/UIComponent.hpp b/src/dawn/scene/components/ui/UIComponent.hpp index d7fcdb7c..a5047094 100644 --- a/src/dawn/scene/components/ui/UIComponent.hpp +++ b/src/dawn/scene/components/ui/UIComponent.hpp @@ -36,7 +36,9 @@ namespace Dawn { class UIComponent : public SceneItemComponent, public UIComponentDimensional { protected: + // @optional float_t width = 1; + // @optional float_t height = 1; StateEvent<> eventAlignmentUpdated; diff --git a/src/dawn/scene/components/ui/UIImage.hpp b/src/dawn/scene/components/ui/UIImage.hpp index f0ce0992..ad391f4d 100644 --- a/src/dawn/scene/components/ui/UIImage.hpp +++ b/src/dawn/scene/components/ui/UIImage.hpp @@ -13,9 +13,9 @@ namespace Dawn { Mesh mesh; public: + // @optional struct Color color = COLOR_WHITE; - // StateProperty width; - // StateProperty height; + // @optional StateProperty texture; UIImage(SceneItem *item); diff --git a/src/dawnrose/scene/components/GameCamera.hpp b/src/dawnrose/scene/components/GameCamera.hpp index 8323862f..902d9a73 100644 --- a/src/dawnrose/scene/components/GameCamera.hpp +++ b/src/dawnrose/scene/components/GameCamera.hpp @@ -15,9 +15,13 @@ namespace Dawn { glm::vec2 current = glm::vec2(0, 0); public: + // @optional glm::vec2 lookOffsetScale = glm::vec2(6.0f, 3.0f); + // @optional float_t movementScrollSpeed = 0.5f; + // @optional glm::vec3 zoomOffset = glm::vec3(0, 30.0f, 7.5f); + // @optional PlayerController *player = nullptr; GameCamera(SceneItem *item); diff --git a/src/dawnrose/scene/components/PlayerController.hpp b/src/dawnrose/scene/components/PlayerController.hpp index 661d59fc..09e7641b 100644 --- a/src/dawnrose/scene/components/PlayerController.hpp +++ b/src/dawnrose/scene/components/PlayerController.hpp @@ -12,6 +12,7 @@ namespace Dawn { CharacterController2D *characterController; public: + // @optional float_t moveSpeed = 80.0f; PlayerController(SceneItem *item);