diff --git a/SHADE_Application/src/Application/SBApplication.cpp b/SHADE_Application/src/Application/SBApplication.cpp index 3ebcc904..b5e4ef04 100644 --- a/SHADE_Application/src/Application/SBApplication.cpp +++ b/SHADE_Application/src/Application/SBApplication.cpp @@ -181,7 +181,7 @@ namespace Sandbox // Link up SHDebugDraw SHDebugDraw::Init(SHSystemManager::GetSystem()); - auto clip = SHResourceManager::LoadOrGet(77816045); + auto clip = SHResourceManager::LoadOrGet(77816045); auto rig = SHResourceManager::LoadOrGet(77816045); int i = 0; } diff --git a/SHADE_Engine/src/Animation/SHAnimationController.h b/SHADE_Engine/src/Animation/SHAnimationController.h index c6d353e6..29c8226d 100644 --- a/SHADE_Engine/src/Animation/SHAnimationController.h +++ b/SHADE_Engine/src/Animation/SHAnimationController.h @@ -17,7 +17,7 @@ of DigiPen Institute of Technology is prohibited. // Project Includes #include "SH_API.h" #include "Resource/SHHandle.h" -#include "SHAnimationClip.h" +#include "SHAnimationData.h" namespace SHADE { @@ -100,7 +100,7 @@ namespace SHADE /// struct Node { - Handle Clip; + Handle Clip; std::vector Transitions; }; diff --git a/SHADE_Engine/src/Animation/SHAnimationClip.cpp b/SHADE_Engine/src/Animation/SHAnimationData.cpp similarity index 95% rename from SHADE_Engine/src/Animation/SHAnimationClip.cpp rename to SHADE_Engine/src/Animation/SHAnimationData.cpp index 939275d3..07454e4a 100644 --- a/SHADE_Engine/src/Animation/SHAnimationClip.cpp +++ b/SHADE_Engine/src/Animation/SHAnimationData.cpp @@ -1,9 +1,9 @@ /************************************************************************************//*! -\file SHAnimationClip.cpp +\file SHAnimationData.cpp \author Tng Kah Wei, kahwei.tng, 390009620 \par email: kahwei.tng\@digipen.edu \date Nov 20, 2022 -\brief Contains the function definitions of the SHAnimationClip class. +\brief Contains the function definitions of the SHAnimationData class. Copyright (C) 2022 DigiPen Institute of Technology. Reproduction or disclosure of this file or its contents without the prior written consent @@ -12,14 +12,14 @@ of DigiPen Institute of Technology is prohibited. // Pre-compiled Header #include "SHpch.h" // Primary Header -#include "SHAnimationClip.h" +#include "SHAnimationData.h" namespace SHADE { /*-----------------------------------------------------------------------------------*/ /* Constructors */ /*-----------------------------------------------------------------------------------*/ - SHAnimationClip::SHAnimationClip(const SHAnimAsset& asset) + SHAnimationData::SHAnimationData(const SHAnimAsset& asset) : ticksPerSecond { static_cast(asset.ticksPerSecond) } , totalTime { static_cast(asset.duration) / static_cast(asset.ticksPerSecond) } { diff --git a/SHADE_Engine/src/Animation/SHAnimationClip.h b/SHADE_Engine/src/Animation/SHAnimationData.h similarity index 94% rename from SHADE_Engine/src/Animation/SHAnimationClip.h rename to SHADE_Engine/src/Animation/SHAnimationData.h index 8a10ce3a..d770fc0f 100644 --- a/SHADE_Engine/src/Animation/SHAnimationClip.h +++ b/SHADE_Engine/src/Animation/SHAnimationData.h @@ -1,9 +1,9 @@ /************************************************************************************//*! -\file SHAnimationClip.h +\file SHAnimationData.h \author Tng Kah Wei, kahwei.tng, 390009620 \par email: kahwei.tng\@digipen.edu \date Dec 12, 2022 -\brief Contains the definition of the SHAnimationClip struct and related types. +\brief Contains the definition of the SHAnimationData struct and related types. Copyright (C) 2022 DigiPen Institute of Technology. Reproduction or disclosure of this file or its contents without the prior written consent @@ -35,7 +35,7 @@ namespace SHADE /// Represents a animation clip of a 3D animation that is made for a specific model /// rig. /// - class SH_API SHAnimationClip + class SH_API SHAnimationData { public: /*---------------------------------------------------------------------------------*/ @@ -60,7 +60,7 @@ namespace SHADE /// Constructs an SHAnimation Clip from a specified SHAnimAsset. /// /// Animation asset to load. - explicit SHAnimationClip(const SHAnimAsset& asset); + explicit SHAnimationData(const SHAnimAsset& asset); /*---------------------------------------------------------------------------------*/ /* Getter Functions */ diff --git a/SHADE_Engine/src/Animation/SHAnimationSystem.h b/SHADE_Engine/src/Animation/SHAnimationSystem.h index 81b012d3..9c2cd073 100644 --- a/SHADE_Engine/src/Animation/SHAnimationSystem.h +++ b/SHADE_Engine/src/Animation/SHAnimationSystem.h @@ -15,6 +15,7 @@ of DigiPen Institute of Technology is prohibited. #include "SH_API.h" #include "ECS_Base/System/SHSystem.h" #include "ECS_Base/System/SHSystemRoutine.h" +#include "Resource/SHResourceLibrary.h" namespace SHADE { diff --git a/SHADE_Engine/src/Animation/SHAnimatorComponent.cpp b/SHADE_Engine/src/Animation/SHAnimatorComponent.cpp index 5a6e78ce..6bb42576 100644 --- a/SHADE_Engine/src/Animation/SHAnimatorComponent.cpp +++ b/SHADE_Engine/src/Animation/SHAnimatorComponent.cpp @@ -19,7 +19,7 @@ of DigiPen Institute of Technology is prohibited. // Project Includes #include "SHRig.h" #include "Math/SHMatrix.h" -#include "SHAnimationClip.h" +#include "SHAnimationData.h" #include "Graphics/SHVkUtil.h" #include "Graphics/MiddleEnd/Interface/SHGraphicsSystem.h" #include "ECS_Base/Managers/SHSystemManager.h" @@ -37,14 +37,14 @@ namespace SHADE playOnce = false; } - void SHAnimatorComponent::Play(Handle clip) + void SHAnimatorComponent::Play(Handle clip) { currClip = clip; currPlaybackTime = 0.0f; Play(); } - void SHAnimatorComponent::PlayOneShot(Handle clip) + void SHAnimatorComponent::PlayOneShot(Handle clip) { Play(clip); playOnce = true; @@ -86,7 +86,7 @@ namespace SHADE } } - void SHAnimatorComponent::SetClip(Handle newClip) + void SHAnimatorComponent::SetClip(Handle newClip) { // No change if (currClip == newClip) diff --git a/SHADE_Engine/src/Animation/SHAnimatorComponent.h b/SHADE_Engine/src/Animation/SHAnimatorComponent.h index 01f1c2eb..c23ada1e 100644 --- a/SHADE_Engine/src/Animation/SHAnimatorComponent.h +++ b/SHADE_Engine/src/Animation/SHAnimatorComponent.h @@ -22,7 +22,7 @@ of DigiPen Institute of Technology is prohibited. #include "Math/SHMatrix.h" #include "Math/Vector/SHVec3.h" #include "Math/SHQuaternion.h" -#include "SHAnimationClip.h" +#include "SHAnimationData.h" namespace SHADE { @@ -31,7 +31,7 @@ namespace SHADE /*-----------------------------------------------------------------------------------*/ class SHRig; struct SHRigNode; - class SHAnimationClip; + class SHAnimationData; class SHVkBuffer; /*-----------------------------------------------------------------------------------*/ @@ -55,12 +55,12 @@ namespace SHADE /// Plays the specified animation clip from the start. /// /// Animation clip to play. - void Play(Handle clip); + void Play(Handle clip); /// /// Plays the specified animation clip from the start one time only. /// /// Animation clip to play. - void PlayOneShot(Handle clip); + void PlayOneShot(Handle clip); /// /// Plays the currently loaded animation clip from the start. /// @@ -88,7 +88,7 @@ namespace SHADE /// If the clip is the same as the current clip, nothing happens. /// /// Clip to use. - void SetClip(Handle newClip); + void SetClip(Handle newClip); /*---------------------------------------------------------------------------------*/ /* Getter Functions */ @@ -108,7 +108,7 @@ namespace SHADE /// Retrieve the currently set animation clip. /// /// Handle to the currently set animation clip. - Handle GetCurrentClip() const noexcept { return currClip; } + Handle GetCurrentClip() const noexcept { return currClip; } /// /// Checks if an animation is currently playing. /// @@ -131,7 +131,7 @@ namespace SHADE /*---------------------------------------------------------------------------------*/ // Resources Handle rig; - Handle currClip; + Handle currClip; // Playback Tracking float currPlaybackTime = 0.0f; bool isPlaying = true; @@ -141,7 +141,7 @@ namespace SHADE // Buffer std::vector boneMatrices; // Caches - std::unordered_map channelMap; + std::unordered_map channelMap; /*---------------------------------------------------------------------------------*/ /* Helper Functions */ diff --git a/SHADE_Engine/src/Animation/SHAnimatorComponent.hpp b/SHADE_Engine/src/Animation/SHAnimatorComponent.hpp index 9c6a5d3a..cf8f573b 100644 --- a/SHADE_Engine/src/Animation/SHAnimatorComponent.hpp +++ b/SHADE_Engine/src/Animation/SHAnimatorComponent.hpp @@ -15,7 +15,7 @@ of DigiPen Institute of Technology is prohibited. // Project Includes #include "SHRig.h" #include "Math/SHMatrix.h" -#include "SHAnimationClip.h" +#include "SHAnimationData.h" #include "Graphics/SHVkUtil.h" #include "Graphics/MiddleEnd/Interface/SHGraphicsSystem.h" #include "ECS_Base/Managers/SHSystemManager.h" diff --git a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp index 561adcf4..ad91a9a1 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp +++ b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp @@ -644,13 +644,13 @@ namespace SHADE SHEditorWindowManager::GetEditorWindow()->SetScrollTo(assetID); } } - Handle const& clip = component->GetCurrentClip(); - const auto CLIP_NAME = clip ? SHResourceManager::GetAssetName(clip).value_or("") : ""; + Handle const& clip = component->GetCurrentClip(); + const auto CLIP_NAME = clip ? SHResourceManager::GetAssetName(clip).value_or("") : ""; SHEditorWidgets::DragDropReadOnlyField("Clip", CLIP_NAME, [component]() { - Handle const& clip = component->GetCurrentClip(); - return SHResourceManager::GetAssetID(clip).value_or(0); + Handle const& clip = component->GetCurrentClip(); + return SHResourceManager::GetAssetID(clip).value_or(0); }, [component](AssetID const& id) { @@ -659,13 +659,13 @@ namespace SHADE SHLOG_WARNING("Attempted to assign non mesh asset to Renderable Mesh property!") return; } - component->SetClip(SHResourceManager::LoadOrGet(id)); + component->SetClip(SHResourceManager::LoadOrGet(id)); }, SHDragDrop::DRAG_RESOURCE); if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) { - if (Handle const& clip = component->GetCurrentClip()) + if (Handle const& clip = component->GetCurrentClip()) { - AssetID assetID = SHResourceManager::GetAssetID(clip).value_or(0); + AssetID assetID = SHResourceManager::GetAssetID(clip).value_or(0); SHEditorWindowManager::GetEditorWindow()->SetScrollTo(assetID); } } diff --git a/SHADE_Engine/src/Resource/SHResourceManager.h b/SHADE_Engine/src/Resource/SHResourceManager.h index 4188bde9..499ded4b 100644 --- a/SHADE_Engine/src/Resource/SHResourceManager.h +++ b/SHADE_Engine/src/Resource/SHResourceManager.h @@ -28,7 +28,7 @@ of DigiPen Institute of Technology is prohibited. #include "Graphics/MiddleEnd/Materials/SHMaterialSpec.h" #include "Assets/Asset Types/SHMaterialAsset.h" #include "Graphics/MiddleEnd/TextRendering/SHFont.h" -#include "Animation/SHAnimationClip.h" +#include "Animation/SHAnimationData.h" #include "Animation/SHRig.h" namespace SHADE @@ -53,7 +53,7 @@ namespace SHADE template<> struct SHResourceLoader { using AssetType = SHMaterialAsset; }; template<> struct SHResourceLoader { using AssetType = SHMaterialSpec; }; template<> struct SHResourceLoader { using AssetType = SHFontAsset; }; - template<> struct SHResourceLoader { using AssetType = SHModelAsset; }; + template<> struct SHResourceLoader { using AssetType = SHModelAsset; }; template<> struct SHResourceLoader { using AssetType = SHModelAsset; }; /// diff --git a/SHADE_Engine/src/Resource/SHResourceManager.hpp b/SHADE_Engine/src/Resource/SHResourceManager.hpp index 231615a5..82a4eb01 100644 --- a/SHADE_Engine/src/Resource/SHResourceManager.hpp +++ b/SHADE_Engine/src/Resource/SHResourceManager.hpp @@ -41,7 +41,7 @@ namespace SHADE !std::is_same_v && !std::is_same_v && !std::is_same_v && - !std::is_same_v && + !std::is_same_v && !std::is_same_v ) { @@ -355,7 +355,7 @@ namespace SHADE loadedAssetData.emplace_back(assetId); return resourceHub.Create(assetData.rig, rigNodeStore); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) { loadedAssetData.emplace_back(assetId); return resourceHub.Create(*assetData.anims[0]); diff --git a/SHADE_Engine/src/Serialization/SHYAMLConverters.h b/SHADE_Engine/src/Serialization/SHYAMLConverters.h index 9fceb10d..658faddc 100644 --- a/SHADE_Engine/src/Serialization/SHYAMLConverters.h +++ b/SHADE_Engine/src/Serialization/SHYAMLConverters.h @@ -400,7 +400,7 @@ namespace YAML { YAML::Node node; node[RIG_YAML_TAG.data()] = SHResourceManager::GetAssetID(rhs.GetRig()).value_or(0); - node[CLIP_YAML_TAG.data()] = SHResourceManager::GetAssetID(rhs.GetCurrentClip()).value_or(0); + node[CLIP_YAML_TAG.data()] = SHResourceManager::GetAssetID(rhs.GetCurrentClip()).value_or(0); return node; } static bool decode(YAML::Node const& node, SHAnimatorComponent& rhs) @@ -411,7 +411,7 @@ namespace YAML } if (node[CLIP_YAML_TAG.data()].IsDefined()) { - rhs.SetClip(SHResourceManager::LoadOrGet(node[CLIP_YAML_TAG.data()].as())); + rhs.SetClip(SHResourceManager::LoadOrGet(node[CLIP_YAML_TAG.data()].as())); } return true; }