Merge branch 'main' into SP3-141-Camera-System
This commit is contained in:
commit
eb54b49a5e
|
@ -274,8 +274,27 @@ namespace SHADE
|
||||||
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
SHEditorWidgets::BeginPanel("Offset", { ImGui::GetContentRegionAvail().x, 30.0f });
|
SHEditorWidgets::BeginPanel("Offsets",{ ImGui::GetContentRegionAvail().x, 30.0f });
|
||||||
SHEditorWidgets::DragVec3("Position", { "X", "Y", "Z" }, [&collider] {return collider->GetPositionOffset(); }, [&collider](SHVec3 const& vec) {collider->SetPositionOffset(vec); });
|
SHEditorWidgets::DragVec3("Position", { "X", "Y", "Z" }, [&collider] {return collider->GetPositionOffset(); }, [&collider](SHVec3 const& vec) {collider->SetPositionOffset(vec); });
|
||||||
|
SHEditorWidgets::DragVec3("Rotation", { "X", "Y", "Z" },
|
||||||
|
[&collider]
|
||||||
|
{
|
||||||
|
auto offset = collider->GetRotationOffset();
|
||||||
|
offset.x = SHMath::RadiansToDegrees(offset.x);
|
||||||
|
offset.y = SHMath::RadiansToDegrees(offset.y);
|
||||||
|
offset.z = SHMath::RadiansToDegrees(offset.z);
|
||||||
|
return offset;
|
||||||
|
},
|
||||||
|
[&collider](SHVec3 const& vec)
|
||||||
|
{
|
||||||
|
const SHVec3 vecInRad
|
||||||
|
{
|
||||||
|
SHMath::DegreesToRadians(vec.x)
|
||||||
|
, SHMath::DegreesToRadians(vec.y)
|
||||||
|
, SHMath::DegreesToRadians(vec.z)
|
||||||
|
};
|
||||||
|
collider->SetRotationOffset(vecInRad);
|
||||||
|
});
|
||||||
SHEditorWidgets::EndPanel();
|
SHEditorWidgets::EndPanel();
|
||||||
}
|
}
|
||||||
if (ImGui::Button(std::format("{} Remove Collider #{}", ICON_MD_REMOVE, i).data()))
|
if (ImGui::Button(std::format("{} Remove Collider #{}", ICON_MD_REMOVE, i).data()))
|
||||||
|
@ -358,6 +377,7 @@ namespace SHADE
|
||||||
[component](AssetID const& id)
|
[component](AssetID const& id)
|
||||||
{
|
{
|
||||||
component->SetMesh(SHResourceManager::LoadOrGet<SHMesh>(id));
|
component->SetMesh(SHResourceManager::LoadOrGet<SHMesh>(id));
|
||||||
|
SHResourceManager::FinaliseChanges();
|
||||||
}, SHDragDrop::DRAG_RESOURCE);
|
}, SHDragDrop::DRAG_RESOURCE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -175,19 +175,37 @@ namespace SHADE
|
||||||
ImGui::BeginDisabled(editor->editorState == SHEditor::State::PLAY);
|
ImGui::BeginDisabled(editor->editorState == SHEditor::State::PLAY);
|
||||||
if(ImGui::SmallButton(ICON_MD_PLAY_ARROW))
|
if(ImGui::SmallButton(ICON_MD_PLAY_ARROW))
|
||||||
{
|
{
|
||||||
|
const SHEditorStateChangeEvent STATE_CHANGE_EVENT
|
||||||
|
{
|
||||||
|
.previousState = editor->editorState
|
||||||
|
};
|
||||||
editor->editorState = SHEditor::State::PLAY;
|
editor->editorState = SHEditor::State::PLAY;
|
||||||
|
|
||||||
|
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_PLAY_EVENT);
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
ImGui::BeginDisabled(editor->editorState == SHEditor::State::PAUSE);
|
ImGui::BeginDisabled(editor->editorState == SHEditor::State::PAUSE);
|
||||||
if(ImGui::SmallButton(ICON_MD_PAUSE))
|
if(ImGui::SmallButton(ICON_MD_PAUSE))
|
||||||
{
|
{
|
||||||
|
const SHEditorStateChangeEvent STATE_CHANGE_EVENT
|
||||||
|
{
|
||||||
|
.previousState = editor->editorState
|
||||||
|
};
|
||||||
editor->editorState = SHEditor::State::PAUSE;
|
editor->editorState = SHEditor::State::PAUSE;
|
||||||
|
|
||||||
|
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_PAUSE_EVENT);
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
ImGui::BeginDisabled(editor->editorState == SHEditor::State::STOP);
|
ImGui::BeginDisabled(editor->editorState == SHEditor::State::STOP);
|
||||||
if(ImGui::SmallButton(ICON_MD_STOP))
|
if(ImGui::SmallButton(ICON_MD_STOP))
|
||||||
{
|
{
|
||||||
|
const SHEditorStateChangeEvent STATE_CHANGE_EVENT
|
||||||
|
{
|
||||||
|
.previousState = editor->editorState
|
||||||
|
};
|
||||||
editor->editorState = SHEditor::State::STOP;
|
editor->editorState = SHEditor::State::STOP;
|
||||||
|
|
||||||
|
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_STOP_EVENT);
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
ImGui::EndMenuBar();
|
ImGui::EndMenuBar();
|
||||||
|
|
|
@ -20,4 +20,10 @@ namespace SHADE
|
||||||
float menuBarHeight = 20.0f;
|
float menuBarHeight = 20.0f;
|
||||||
std::vector<std::filesystem::path> layoutPaths;
|
std::vector<std::filesystem::path> layoutPaths;
|
||||||
};//class SHEditorMenuBar
|
};//class SHEditorMenuBar
|
||||||
|
|
||||||
|
struct SHEditorStateChangeEvent
|
||||||
|
{
|
||||||
|
SHEditor::State previousState;
|
||||||
|
};
|
||||||
|
|
||||||
}//namespace SHADE
|
}//namespace SHADE
|
|
@ -13,4 +13,7 @@ constexpr SHEventIdentifier SH_COMPONENT_REMOVED_EVENT { 4 };
|
||||||
constexpr SHEventIdentifier SH_SCENEGRAPH_CHANGE_PARENT_EVENT { 5 };
|
constexpr SHEventIdentifier SH_SCENEGRAPH_CHANGE_PARENT_EVENT { 5 };
|
||||||
constexpr SHEventIdentifier SH_PHYSICS_COLLIDER_ADDED_EVENT { 6 };
|
constexpr SHEventIdentifier SH_PHYSICS_COLLIDER_ADDED_EVENT { 6 };
|
||||||
constexpr SHEventIdentifier SH_PHYSICS_COLLIDER_REMOVED_EVENT { 7 };
|
constexpr SHEventIdentifier SH_PHYSICS_COLLIDER_REMOVED_EVENT { 7 };
|
||||||
|
constexpr SHEventIdentifier SH_EDITOR_ON_PLAY_EVENT { 8 };
|
||||||
|
constexpr SHEventIdentifier SH_EDITOR_ON_PAUSE_EVENT { 9 };
|
||||||
|
constexpr SHEventIdentifier SH_EDITOR_ON_STOP_EVENT { 10 };
|
||||||
|
|
||||||
|
|
|
@ -74,11 +74,12 @@ namespace SHADE
|
||||||
|
|
||||||
void SHBatch::Remove(const SHRenderable* renderable)
|
void SHBatch::Remove(const SHRenderable* renderable)
|
||||||
{
|
{
|
||||||
// Check if we have a SubBatch with the same mesh yet
|
// Check if we have a SubBatch with the existing mesh yet (if changed, we use the old mesh)
|
||||||
|
Handle<SHMesh> prevSubBatchMesh = renderable->HasMeshChanged() ? renderable->GetPrevMesh() : renderable->GetMesh();
|
||||||
auto subBatch = std::find_if(subBatches.begin(), subBatches.end(), [&](const SHSubBatch& batch)
|
auto subBatch = std::find_if(subBatches.begin(), subBatches.end(), [&](const SHSubBatch& batch)
|
||||||
{
|
{
|
||||||
return batch.Mesh == renderable->GetMesh();
|
return batch.Mesh == prevSubBatchMesh;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Attempt to remove if it exists
|
// Attempt to remove if it exists
|
||||||
if (subBatch == subBatches.end())
|
if (subBatch == subBatches.end())
|
||||||
|
@ -88,9 +89,7 @@ namespace SHADE
|
||||||
|
|
||||||
// Check if other renderables in subBatches contain the same material instance
|
// Check if other renderables in subBatches contain the same material instance
|
||||||
bool matUnused = true;
|
bool matUnused = true;
|
||||||
|
|
||||||
Handle<SHMaterialInstance> matToCheck = renderable->HasMaterialChanged() ? renderable->GetPrevMaterial() : renderable->GetMaterial();
|
Handle<SHMaterialInstance> matToCheck = renderable->HasMaterialChanged() ? renderable->GetPrevMaterial() : renderable->GetMaterial();
|
||||||
|
|
||||||
for (const auto& sb : subBatches)
|
for (const auto& sb : subBatches)
|
||||||
{
|
{
|
||||||
// Check material usage
|
// Check material usage
|
||||||
|
|
|
@ -37,9 +37,9 @@ namespace SHADE
|
||||||
|
|
||||||
// Check if we have a batch with the same pipeline first
|
// Check if we have a batch with the same pipeline first
|
||||||
auto batch = std::find_if(batches.begin(), batches.end(), [&](const SHBatch& batch)
|
auto batch = std::find_if(batches.begin(), batches.end(), [&](const SHBatch& batch)
|
||||||
{
|
{
|
||||||
return batch.GetPipeline() == PIPELINE;
|
return batch.GetPipeline() == PIPELINE;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Create one if not found
|
// Create one if not found
|
||||||
|
|
|
@ -106,10 +106,7 @@ namespace SHADE
|
||||||
descPool = device->CreateDescriptorPools();
|
descPool = device->CreateDescriptorPools();
|
||||||
|
|
||||||
// Create generic command buffer
|
// Create generic command buffer
|
||||||
//transferCmdPool = device->CreateCommandPool(SH_QUEUE_FAMILY_ARRAY_INDEX::GRAPHICS, SH_CMD_POOL_RESET::POOL_BASED, true);
|
|
||||||
graphicsCmdPool = device->CreateCommandPool(SH_QUEUE_FAMILY_ARRAY_INDEX::GRAPHICS, SH_CMD_POOL_RESET::POOL_BASED, true);
|
graphicsCmdPool = device->CreateCommandPool(SH_QUEUE_FAMILY_ARRAY_INDEX::GRAPHICS, SH_CMD_POOL_RESET::POOL_BASED, true);
|
||||||
transferCmdBuffer = graphicsCmdPool->RequestCommandBuffer(SH_CMD_BUFFER_TYPE::PRIMARY);
|
|
||||||
graphicsTexCmdBuffer = graphicsCmdPool->RequestCommandBuffer(SH_CMD_BUFFER_TYPE::PRIMARY);
|
|
||||||
|
|
||||||
// Load Built In Shaders
|
// Load Built In Shaders
|
||||||
static constexpr AssetID VS_DEFAULT = 39210065; defaultVertShader = SHResourceManager::LoadOrGet<SHVkShaderModule>(VS_DEFAULT);
|
static constexpr AssetID VS_DEFAULT = 39210065; defaultVertShader = SHResourceManager::LoadOrGet<SHVkShaderModule>(VS_DEFAULT);
|
||||||
|
@ -621,10 +618,14 @@ namespace SHADE
|
||||||
|
|
||||||
void SHGraphicsSystem::BuildMeshBuffers()
|
void SHGraphicsSystem::BuildMeshBuffers()
|
||||||
{
|
{
|
||||||
|
transferCmdBuffer = graphicsCmdPool->RequestCommandBuffer(SH_CMD_BUFFER_TYPE::PRIMARY);
|
||||||
|
device->WaitIdle();
|
||||||
transferCmdBuffer->BeginRecording();
|
transferCmdBuffer->BeginRecording();
|
||||||
meshLibrary.BuildBuffers(device, transferCmdBuffer);
|
meshLibrary.BuildBuffers(device, transferCmdBuffer);
|
||||||
transferCmdBuffer->EndRecording();
|
transferCmdBuffer->EndRecording();
|
||||||
graphicsQueue->SubmitCommandBuffer({ transferCmdBuffer });
|
graphicsQueue->SubmitCommandBuffer({ transferCmdBuffer });
|
||||||
|
device->WaitIdle();
|
||||||
|
transferCmdBuffer.Free(); transferCmdBuffer = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
@ -649,10 +650,14 @@ namespace SHADE
|
||||||
|
|
||||||
void SHGraphicsSystem::BuildTextures()
|
void SHGraphicsSystem::BuildTextures()
|
||||||
{
|
{
|
||||||
|
graphicsTexCmdBuffer = graphicsCmdPool->RequestCommandBuffer(SH_CMD_BUFFER_TYPE::PRIMARY);
|
||||||
|
device->WaitIdle();
|
||||||
texLibrary.BuildTextures
|
texLibrary.BuildTextures
|
||||||
(
|
(
|
||||||
device, graphicsTexCmdBuffer, graphicsQueue, descPool
|
device, graphicsTexCmdBuffer, graphicsQueue, descPool
|
||||||
);
|
);
|
||||||
|
device->WaitIdle();
|
||||||
|
graphicsTexCmdBuffer.Free(); graphicsTexCmdBuffer = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma endregion ADD_REMOVE
|
#pragma endregion ADD_REMOVE
|
||||||
|
@ -692,6 +697,7 @@ namespace SHADE
|
||||||
void SHGraphicsSystem::EndRoutine::Execute(double) noexcept
|
void SHGraphicsSystem::EndRoutine::Execute(double) noexcept
|
||||||
{
|
{
|
||||||
reinterpret_cast<SHGraphicsSystem*>(system)->EndRender();
|
reinterpret_cast<SHGraphicsSystem*>(system)->EndRender();
|
||||||
|
SHResourceManager::FinaliseChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
|
@ -709,8 +715,13 @@ namespace SHADE
|
||||||
if (!renderable.HasChanged())
|
if (!renderable.HasChanged())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Remove from old material's SuperBatch
|
if (!renderable.GetMesh())
|
||||||
Handle<SHMaterialInstance> prevMaterial = renderable.GetPrevMaterial();
|
{
|
||||||
|
SHLOG_CRITICAL("NULL Mesh provided!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove from the SuperBatch it is previously in (prevMat if mat has changed)
|
||||||
|
Handle<SHMaterialInstance> prevMaterial = renderable.HasMaterialChanged() ? renderable.GetPrevMaterial() : renderable.GetMaterial();
|
||||||
if (prevMaterial)
|
if (prevMaterial)
|
||||||
{
|
{
|
||||||
Handle<SHSuperBatch> oldSuperBatch = prevMaterial->GetBaseMaterial()->GetPipeline()->GetPipelineState().GetSubpass()->GetSuperBatch();
|
Handle<SHSuperBatch> oldSuperBatch = prevMaterial->GetBaseMaterial()->GetPipeline()->GetPipelineState().GetSubpass()->GetSuperBatch();
|
||||||
|
|
|
@ -185,7 +185,7 @@ RTTR_REGISTRATION
|
||||||
using namespace rttr;
|
using namespace rttr;
|
||||||
|
|
||||||
registration::class_<SHTransformComponent>("Transform Component")
|
registration::class_<SHTransformComponent>("Transform Component")
|
||||||
.property("Translate" ,&SHTransformComponent::GetLocalPosition ,&SHTransformComponent::SetLocalPosition ) (metadata(META::tooltip, "Translate"))
|
.property("Translate" ,&SHTransformComponent::GetLocalPosition ,&SHTransformComponent::SetLocalPosition ) (metadata(META::tooltip, "Translate"))
|
||||||
.property("Rotate" ,&SHTransformComponent::GetLocalRotation ,select_overload<void(const SHVec3&)>(&SHTransformComponent::SetLocalRotation) ) (metadata(META::tooltip, "Rotate"), metadata(META::angleInRad, true))
|
.property("Rotate" ,&SHTransformComponent::GetLocalRotation ,select_overload<void(const SHVec3&)>(&SHTransformComponent::SetLocalRotation)) (metadata(META::tooltip, "Rotate"), metadata(META::angleInRad, true))
|
||||||
.property("Scale" ,&SHTransformComponent::GetLocalScale ,&SHTransformComponent::SetLocalScale ) (metadata(META::tooltip, "Scale"));
|
.property("Scale" ,&SHTransformComponent::GetLocalScale ,&SHTransformComponent::SetLocalScale ) (metadata(META::tooltip, "Scale"));
|
||||||
}
|
}
|
|
@ -17,6 +17,7 @@
|
||||||
#include "Math/Geometry/SHBoundingSphere.h"
|
#include "Math/Geometry/SHBoundingSphere.h"
|
||||||
#include "Math/Transform/SHTransformComponent.h"
|
#include "Math/Transform/SHTransformComponent.h"
|
||||||
#include "Math/SHMathHelpers.h"
|
#include "Math/SHMathHelpers.h"
|
||||||
|
#include "Reflection/SHReflectionMetadata.h"
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
{
|
{
|
||||||
|
@ -158,6 +159,11 @@ namespace SHADE
|
||||||
return positionOffset;
|
return positionOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SHVec3& SHCollider::GetRotationOffset() const noexcept
|
||||||
|
{
|
||||||
|
return rotationOffset;
|
||||||
|
}
|
||||||
|
|
||||||
SHShape* SHCollider::GetShape() noexcept
|
SHShape* SHCollider::GetShape() noexcept
|
||||||
{
|
{
|
||||||
dirty = true;
|
dirty = true;
|
||||||
|
@ -275,6 +281,12 @@ namespace SHADE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SHCollider::SetRotationOffset(const SHVec3& rotOffset) noexcept
|
||||||
|
{
|
||||||
|
dirty = true;
|
||||||
|
rotationOffset = rotOffset;
|
||||||
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
/* Private Function Member Definitions */
|
/* Private Function Member Definitions */
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
|
@ -316,5 +328,6 @@ RTTR_REGISTRATION
|
||||||
);
|
);
|
||||||
|
|
||||||
registration::class_<SHCollider>("Collider")
|
registration::class_<SHCollider>("Collider")
|
||||||
.property("Position Offset", &SHCollider::GetPositionOffset, &SHCollider::SetPositionOffset);
|
.property("Position Offset", &SHCollider::GetPositionOffset, &SHCollider::SetPositionOffset)
|
||||||
|
.property("Rotation Offset", &SHCollider::GetRotationOffset, &SHCollider::SetRotationOffset) (metadata(META::angleInRad, true));
|
||||||
}
|
}
|
|
@ -80,6 +80,7 @@ namespace SHADE
|
||||||
[[nodiscard]] const SHPhysicsMaterial& GetMaterial () const noexcept;
|
[[nodiscard]] const SHPhysicsMaterial& GetMaterial () const noexcept;
|
||||||
|
|
||||||
[[nodiscard]] const SHVec3& GetPositionOffset () const noexcept;
|
[[nodiscard]] const SHVec3& GetPositionOffset () const noexcept;
|
||||||
|
[[nodiscard]] const SHVec3& GetRotationOffset () const noexcept;
|
||||||
|
|
||||||
[[nodiscard]] SHShape* GetShape () noexcept;
|
[[nodiscard]] SHShape* GetShape () noexcept;
|
||||||
|
|
||||||
|
@ -96,7 +97,8 @@ namespace SHADE
|
||||||
void SetDensity (float density) noexcept;
|
void SetDensity (float density) noexcept;
|
||||||
void SetMaterial (const SHPhysicsMaterial& newMaterial) noexcept;
|
void SetMaterial (const SHPhysicsMaterial& newMaterial) noexcept;
|
||||||
|
|
||||||
void SetPositionOffset (const SHVec3& posOffset) noexcept;
|
void SetPositionOffset (const SHVec3& posOffset) noexcept;
|
||||||
|
void SetRotationOffset (const SHVec3& rotOffset) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
@ -110,6 +112,7 @@ namespace SHADE
|
||||||
SHShape* shape;
|
SHShape* shape;
|
||||||
SHPhysicsMaterial material;
|
SHPhysicsMaterial material;
|
||||||
SHVec3 positionOffset;
|
SHVec3 positionOffset;
|
||||||
|
SHVec3 rotationOffset;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* Function Members */
|
/* Function Members */
|
||||||
|
|
|
@ -130,6 +130,8 @@ namespace SHADE
|
||||||
|
|
||||||
int SHPhysicsObject::AddCollider(SHCollider* collider)
|
int SHPhysicsObject::AddCollider(SHCollider* collider)
|
||||||
{
|
{
|
||||||
|
const rp3d::Transform OFFSETS{ collider->GetPositionOffset(), collider->GetRotationOffset() };
|
||||||
|
|
||||||
switch (collider->GetType())
|
switch (collider->GetType())
|
||||||
{
|
{
|
||||||
case SHCollider::Type::BOX:
|
case SHCollider::Type::BOX:
|
||||||
|
@ -137,7 +139,7 @@ namespace SHADE
|
||||||
const auto* box = reinterpret_cast<SHBoundingBox*>(collider->GetShape());
|
const auto* box = reinterpret_cast<SHBoundingBox*>(collider->GetShape());
|
||||||
rp3d::BoxShape* newBox = factory->createBoxShape(box->GetHalfExtents());
|
rp3d::BoxShape* newBox = factory->createBoxShape(box->GetHalfExtents());
|
||||||
|
|
||||||
rp3dBody->addCollider(newBox, rp3d::Transform{ collider->GetPositionOffset(), SHQuaternion::Identity });
|
rp3dBody->addCollider(newBox, OFFSETS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SHCollider::Type::SPHERE:
|
case SHCollider::Type::SPHERE:
|
||||||
|
@ -145,7 +147,7 @@ namespace SHADE
|
||||||
const auto* sphere = reinterpret_cast<SHBoundingSphere*>(collider->GetShape());
|
const auto* sphere = reinterpret_cast<SHBoundingSphere*>(collider->GetShape());
|
||||||
rp3d::SphereShape* newSphere = factory->createSphereShape(sphere->GetRadius());
|
rp3d::SphereShape* newSphere = factory->createSphereShape(sphere->GetRadius());
|
||||||
|
|
||||||
rp3dBody->addCollider(newSphere, rp3d::Transform{ collider->GetPositionOffset(), SHQuaternion::Identity });
|
rp3dBody->addCollider(newSphere, OFFSETS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// TODO(Diren): Add more collider shapes
|
// TODO(Diren): Add more collider shapes
|
||||||
|
@ -182,7 +184,7 @@ namespace SHADE
|
||||||
rp3dCollider->setIsTrigger(collider.IsTrigger());
|
rp3dCollider->setIsTrigger(collider.IsTrigger());
|
||||||
|
|
||||||
// Update offsets
|
// Update offsets
|
||||||
rp3dCollider->setLocalToBodyTransform(rp3d::Transform(collider.GetPositionOffset(), SHQuaternion::Identity));
|
rp3dCollider->setLocalToBodyTransform(rp3d::Transform(collider.GetPositionOffset(), collider.GetRotationOffset()));
|
||||||
|
|
||||||
switch (collider.GetType())
|
switch (collider.GetType())
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
#include "ECS_Base/Managers/SHComponentManager.h"
|
#include "ECS_Base/Managers/SHComponentManager.h"
|
||||||
#include "ECS_Base/Managers/SHEntityManager.h"
|
#include "ECS_Base/Managers/SHEntityManager.h"
|
||||||
#include "ECS_Base/Managers/SHSystemManager.h"
|
#include "ECS_Base/Managers/SHSystemManager.h"
|
||||||
#include "Editor/SHEditor.h"
|
|
||||||
#include "Math/SHMathHelpers.h"
|
#include "Math/SHMathHelpers.h"
|
||||||
#include "Math/Transform/SHTransformComponent.h"
|
#include "Math/Transform/SHTransformComponent.h"
|
||||||
#include "Scene/SHSceneManager.h"
|
#include "Scene/SHSceneManager.h"
|
||||||
|
@ -212,6 +211,12 @@ namespace SHADE
|
||||||
const std::shared_ptr REMOVE_COMPONENT_RECEIVER { std::make_shared<SHEventReceiverSpec<SHPhysicsSystem>>(this, &SHPhysicsSystem::RemovePhysicsComponent) };
|
const std::shared_ptr REMOVE_COMPONENT_RECEIVER { std::make_shared<SHEventReceiverSpec<SHPhysicsSystem>>(this, &SHPhysicsSystem::RemovePhysicsComponent) };
|
||||||
const ReceiverPtr REMOVE_COMPONENT_RECEIVER_PTR = std::dynamic_pointer_cast<SHEventReceiver>(REMOVE_COMPONENT_RECEIVER);
|
const ReceiverPtr REMOVE_COMPONENT_RECEIVER_PTR = std::dynamic_pointer_cast<SHEventReceiver>(REMOVE_COMPONENT_RECEIVER);
|
||||||
SHEventManager::SubscribeTo(SH_COMPONENT_REMOVED_EVENT, REMOVE_COMPONENT_RECEIVER_PTR);
|
SHEventManager::SubscribeTo(SH_COMPONENT_REMOVED_EVENT, REMOVE_COMPONENT_RECEIVER_PTR);
|
||||||
|
|
||||||
|
#ifdef SHEDITOR
|
||||||
|
const std::shared_ptr EDITOR_STOP_RECEIVER { std::make_shared<SHEventReceiverSpec<SHPhysicsSystem>>(this, &SHPhysicsSystem::ResetWorld) };
|
||||||
|
const ReceiverPtr EDITOR_STOP_RECEIVER_PTR = std::dynamic_pointer_cast<SHEventReceiver>(EDITOR_STOP_RECEIVER);
|
||||||
|
SHEventManager::SubscribeTo(SH_EDITOR_ON_STOP_EVENT, EDITOR_STOP_RECEIVER_PTR);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void SHPhysicsSystem::Exit()
|
void SHPhysicsSystem::Exit()
|
||||||
|
@ -289,16 +294,6 @@ namespace SHADE
|
||||||
|
|
||||||
if (rigidBodyComponent)
|
if (rigidBodyComponent)
|
||||||
{
|
{
|
||||||
// Clear all forces and velocities if editor is stopped
|
|
||||||
if (SHSystemManager::GetSystem<SHEditor>()->editorState == SHEditor::State::STOP)
|
|
||||||
{
|
|
||||||
auto* rp3dRigidBody = reinterpret_cast<rp3d::RigidBody*>(physicsObject.rp3dBody);
|
|
||||||
rp3dRigidBody->resetForce();
|
|
||||||
rp3dRigidBody->resetTorque();
|
|
||||||
rp3dRigidBody->setLinearVelocity(SHVec3::Zero);
|
|
||||||
rp3dRigidBody->setAngularVelocity(SHVec3::Zero);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sync active states
|
// Sync active states
|
||||||
const bool COMPONENT_ACTIVE = rigidBodyComponent->isActive;
|
const bool COMPONENT_ACTIVE = rigidBodyComponent->isActive;
|
||||||
SyncActiveStates(physicsObject, COMPONENT_ACTIVE);
|
SyncActiveStates(physicsObject, COMPONENT_ACTIVE);
|
||||||
|
@ -324,11 +319,11 @@ namespace SHADE
|
||||||
|
|
||||||
void SHPhysicsSystem::PhysicsFixedUpdate::Execute(double dt) noexcept
|
void SHPhysicsSystem::PhysicsFixedUpdate::Execute(double dt) noexcept
|
||||||
{
|
{
|
||||||
auto* physicsSystem = reinterpret_cast<SHPhysicsSystem*>(GetSystem());
|
auto* physicsSystem = reinterpret_cast<SHPhysicsSystem*>(GetSystem());
|
||||||
auto scriptSys = SHSystemManager::GetSystem<SHScriptEngine>();
|
auto* scriptingSystem = SHSystemManager::GetSystem<SHScriptEngine>();
|
||||||
if (!scriptSys)
|
if (scriptingSystem == nullptr)
|
||||||
{
|
{
|
||||||
SHLOG_WARNING("[SHPhysicsSystem] Unable to invoke FixedUpdate() on scripts due to missing SHScriptEngine!");
|
SHLOGV_WARNING("Unable to invoke FixedUpdate() on scripts due to missing SHScriptEngine!");
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedTimeStep = 1.0 / physicsSystem->fixedDT;
|
fixedTimeStep = 1.0 / physicsSystem->fixedDT;
|
||||||
|
@ -337,10 +332,9 @@ namespace SHADE
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (accumulatedTime > fixedTimeStep)
|
while (accumulatedTime > fixedTimeStep)
|
||||||
{
|
{
|
||||||
if (scriptSys)
|
if (scriptingSystem != nullptr)
|
||||||
{
|
scriptingSystem->ExecuteFixedUpdates();
|
||||||
scriptSys->ExecuteFixedUpdates();
|
|
||||||
}
|
|
||||||
physicsSystem->world->update(static_cast<rp3d::decimal>(fixedTimeStep));
|
physicsSystem->world->update(static_cast<rp3d::decimal>(fixedTimeStep));
|
||||||
|
|
||||||
accumulatedTime -= fixedTimeStep;
|
accumulatedTime -= fixedTimeStep;
|
||||||
|
@ -356,6 +350,11 @@ namespace SHADE
|
||||||
void SHPhysicsSystem::PhysicsPostUpdate::Execute(double) noexcept
|
void SHPhysicsSystem::PhysicsPostUpdate::Execute(double) noexcept
|
||||||
{
|
{
|
||||||
auto* physicsSystem = reinterpret_cast<SHPhysicsSystem*>(GetSystem());
|
auto* physicsSystem = reinterpret_cast<SHPhysicsSystem*>(GetSystem());
|
||||||
|
auto* scriptingSystem = SHSystemManager::GetSystem<SHScriptEngine>();
|
||||||
|
if (scriptingSystem == nullptr)
|
||||||
|
{
|
||||||
|
SHLOGV_WARNING("Unable to invoke collision and trigger script events due to missing SHScriptEngine!");
|
||||||
|
}
|
||||||
|
|
||||||
// Interpolate transforms for rendering
|
// Interpolate transforms for rendering
|
||||||
if (physicsSystem->worldUpdated)
|
if (physicsSystem->worldUpdated)
|
||||||
|
@ -363,15 +362,8 @@ namespace SHADE
|
||||||
physicsSystem->SyncTransforms();
|
physicsSystem->SyncTransforms();
|
||||||
|
|
||||||
// Collision & Trigger messages
|
// Collision & Trigger messages
|
||||||
auto scriptSys = SHSystemManager::GetSystem<SHScriptEngine>();
|
if (scriptingSystem != nullptr)
|
||||||
if (scriptSys)
|
scriptingSystem->ExecuteCollisionFunctions();
|
||||||
{
|
|
||||||
scriptSys->ExecuteCollisionFunctions();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SHLOG_WARNING("[SHPhysicsSystem] Unable to invoke collision and trigger script events due to missing SHScriptEngine!");
|
|
||||||
}
|
|
||||||
|
|
||||||
physicsSystem->ClearInvalidCollisions();
|
physicsSystem->ClearInvalidCollisions();
|
||||||
}
|
}
|
||||||
|
@ -630,19 +622,17 @@ namespace SHADE
|
||||||
auto* rigidBodyComponent = SHComponentManager::GetComponent_s<SHRigidBodyComponent>(ENTITY_ID);
|
auto* rigidBodyComponent = SHComponentManager::GetComponent_s<SHRigidBodyComponent>(ENTITY_ID);
|
||||||
auto* colliderComponent = SHComponentManager::GetComponent_s<SHColliderComponent>(ENTITY_ID);
|
auto* colliderComponent = SHComponentManager::GetComponent_s<SHColliderComponent>(ENTITY_ID);
|
||||||
|
|
||||||
SHASSERT(physicsObject != nullptr, "Physics object " + std::to_string(ENTITY_ID) + " has been lost from the world!")
|
// Wake up all physics objects
|
||||||
|
for (auto& [entityID, object] : map)
|
||||||
if (REMOVED_ID == RIGID_BODY_ID)
|
|
||||||
{
|
{
|
||||||
// Wake up all physics objects
|
if (SHComponentManager::HasComponent<SHRigidBodyComponent>(entityID))
|
||||||
for (auto& [entityID, object] : map)
|
reinterpret_cast<rp3d::RigidBody*>(object.rp3dBody)->setIsSleeping(false);
|
||||||
{
|
}
|
||||||
if (SHComponentManager::HasComponent<SHRigidBodyComponent>(entityID))
|
|
||||||
reinterpret_cast<rp3d::RigidBody*>(object.rp3dBody)->setIsSleeping(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (REMOVED_ID == RIGID_BODY_ID && physicsObject != nullptr)
|
||||||
|
{
|
||||||
world->destroyRigidBody(reinterpret_cast<rp3d::RigidBody*>(physicsObject->rp3dBody));
|
world->destroyRigidBody(reinterpret_cast<rp3d::RigidBody*>(physicsObject->rp3dBody));
|
||||||
physicsObject->rp3dBody = nullptr;
|
physicsObject->rp3dBody = nullptr;
|
||||||
|
|
||||||
if (colliderComponent != nullptr)
|
if (colliderComponent != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -657,7 +647,7 @@ namespace SHADE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (REMOVED_ID == COLLIDER_ID)
|
if (REMOVED_ID == COLLIDER_ID && physicsObject != nullptr)
|
||||||
{
|
{
|
||||||
// Remove all colliders
|
// Remove all colliders
|
||||||
const int NUM_COLLIDERS = static_cast<int>(physicsObject->rp3dBody->getNbColliders());
|
const int NUM_COLLIDERS = static_cast<int>(physicsObject->rp3dBody->getNbColliders());
|
||||||
|
@ -673,11 +663,30 @@ namespace SHADE
|
||||||
physicsObject->rp3dBody = nullptr;
|
physicsObject->rp3dBody = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (physicsObject->rp3dBody == nullptr)
|
if (physicsObject != nullptr && physicsObject->rp3dBody == nullptr)
|
||||||
DestroyPhysicsObject(ENTITY_ID);
|
DestroyPhysicsObject(ENTITY_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EVENT_DATA->handle;
|
return EVENT_DATA->handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SHEventHandle SHPhysicsSystem::ResetWorld(SHEventPtr editorStopEvent)
|
||||||
|
{
|
||||||
|
// TODO(Diren): Rebuild world based on how scene reloading is done
|
||||||
|
|
||||||
|
for (auto& [entityID, physicsObject] : map)
|
||||||
|
{
|
||||||
|
if (SHComponentManager::HasComponent<SHRigidBodyComponent>(entityID))
|
||||||
|
{
|
||||||
|
auto* rp3dRigidBody = reinterpret_cast<rp3d::RigidBody*>(physicsObject.rp3dBody);
|
||||||
|
rp3dRigidBody->resetForce();
|
||||||
|
rp3dRigidBody->resetTorque();
|
||||||
|
rp3dRigidBody->setLinearVelocity(SHVec3::Zero);
|
||||||
|
rp3dRigidBody->setAngularVelocity(SHVec3::Zero);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return editorStopEvent->handle;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace SHADE
|
} // namespace SHADE
|
|
@ -189,6 +189,7 @@ namespace SHADE
|
||||||
|
|
||||||
SHEventHandle AddPhysicsComponent (SHEventPtr addComponentEvent);
|
SHEventHandle AddPhysicsComponent (SHEventPtr addComponentEvent);
|
||||||
SHEventHandle RemovePhysicsComponent (SHEventPtr removeComponentEvent);
|
SHEventHandle RemovePhysicsComponent (SHEventPtr removeComponentEvent);
|
||||||
|
SHEventHandle ResetWorld (SHEventPtr editorStopEvent);
|
||||||
|
|
||||||
template <typename RP3DCollisionPair, typename = std::enable_if_t
|
template <typename RP3DCollisionPair, typename = std::enable_if_t
|
||||||
<std::is_same_v<RP3DCollisionPair, rp3d::CollisionCallback::ContactPair>
|
<std::is_same_v<RP3DCollisionPair, rp3d::CollisionCallback::ContactPair>
|
||||||
|
|
|
@ -21,9 +21,11 @@ namespace SHADE
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
SHResourceHub SHResourceManager::resourceHub;
|
SHResourceHub SHResourceManager::resourceHub;
|
||||||
std::unordered_map<std::type_index, std::unordered_map<AssetID, Handle<void>>> SHResourceManager::handlesMap;
|
std::unordered_map<std::type_index, std::unordered_map<AssetID, Handle<void>>> SHResourceManager::handlesMap;
|
||||||
std::unordered_map<std::type_index, SHADE::SHResourceManager::HandleAssetMap> SHResourceManager::assetIdMap;
|
std::unordered_map<std::type_index, SHResourceManager::HandleAssetMap> SHResourceManager::assetIdMap;
|
||||||
std::unordered_map<std::type_index, std::function<void(AssetID)>> SHResourceManager::typedFreeFuncMap;
|
std::unordered_map<std::type_index, std::function<void(AssetID)>> SHResourceManager::typedFreeFuncMap;
|
||||||
std::vector<AssetID> SHResourceManager::loadedAssetData;
|
std::vector<AssetID> SHResourceManager::loadedAssetData;
|
||||||
|
bool SHResourceManager::textureChanged = false;
|
||||||
|
bool SHResourceManager::meshChanged = false;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
/* Function Definitions */
|
/* Function Definitions */
|
||||||
|
@ -63,8 +65,17 @@ namespace SHADE
|
||||||
SHGraphicsSystem* gfxSystem = SHSystemManager::GetSystem<SHGraphicsSystem>();
|
SHGraphicsSystem* gfxSystem = SHSystemManager::GetSystem<SHGraphicsSystem>();
|
||||||
if (gfxSystem == nullptr)
|
if (gfxSystem == nullptr)
|
||||||
throw std::runtime_error("[SHResourceManager] Attempted to load graphics resource without a SHGraphicsSystem installed.");
|
throw std::runtime_error("[SHResourceManager] Attempted to load graphics resource without a SHGraphicsSystem installed.");
|
||||||
gfxSystem->BuildMeshBuffers();
|
|
||||||
gfxSystem->BuildTextures();
|
if (meshChanged)
|
||||||
|
{
|
||||||
|
gfxSystem->BuildMeshBuffers();
|
||||||
|
meshChanged = false;
|
||||||
|
}
|
||||||
|
if (textureChanged)
|
||||||
|
{
|
||||||
|
gfxSystem->BuildTextures();
|
||||||
|
textureChanged = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Free CPU Resources
|
// Free CPU Resources
|
||||||
for (auto assetId : loadedAssetData)
|
for (auto assetId : loadedAssetData)
|
||||||
|
|
|
@ -28,33 +28,15 @@ of DigiPen Institute of Technology is prohibited.
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Template structs that maps a resource to their loaded asset representation type.
|
||||||
|
/// </summary>
|
||||||
template<typename T = void>
|
template<typename T = void>
|
||||||
struct SHResourceLoader
|
struct SHResourceLoader { using AssetType = void; };
|
||||||
{
|
template<> struct SHResourceLoader<SHMesh> { using AssetType = SHMeshAsset; };
|
||||||
using AssetType = void;
|
template<> struct SHResourceLoader<SHTexture> { using AssetType = SHTextureAsset; };
|
||||||
};
|
template<> struct SHResourceLoader<SHVkShaderModule> { using AssetType = SHShaderAsset; };
|
||||||
|
template<> struct SHResourceLoader<SHMaterial> { using AssetType = SHMaterialAsset; };
|
||||||
template<>
|
|
||||||
struct SHResourceLoader<SHMesh>
|
|
||||||
{
|
|
||||||
using AssetType = SHMeshAsset;
|
|
||||||
};
|
|
||||||
template<>
|
|
||||||
struct SHResourceLoader<SHTexture>
|
|
||||||
{
|
|
||||||
using AssetType = SHTextureAsset;
|
|
||||||
};
|
|
||||||
template<>
|
|
||||||
struct SHResourceLoader<SHVkShaderModule>
|
|
||||||
{
|
|
||||||
using AssetType = SHShaderAsset;
|
|
||||||
};
|
|
||||||
template<>
|
|
||||||
struct SHResourceLoader<SHMaterial>
|
|
||||||
{
|
|
||||||
using AssetType = SHMaterialAsset;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Static class responsible for loading and caching runtime resources from their
|
/// Static class responsible for loading and caching runtime resources from their
|
||||||
|
@ -97,7 +79,7 @@ namespace SHADE
|
||||||
/// <param name="assetId">Handle to the resource to unload.</param>
|
/// <param name="assetId">Handle to the resource to unload.</param>
|
||||||
static void Unload(AssetID assetId);
|
static void Unload(AssetID assetId);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Needs to be called to finalise all changes to loads.
|
/// Needs to be called to finalise all changes to loads, unless at runtime.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static void FinaliseChanges();
|
static void FinaliseChanges();
|
||||||
|
|
||||||
|
@ -147,6 +129,9 @@ namespace SHADE
|
||||||
static std::unordered_map<std::type_index, std::function<void(AssetID)>> typedFreeFuncMap;
|
static std::unordered_map<std::type_index, std::function<void(AssetID)>> typedFreeFuncMap;
|
||||||
// Pointers to temp CPU resources
|
// Pointers to temp CPU resources
|
||||||
static std::vector<AssetID> loadedAssetData;
|
static std::vector<AssetID> loadedAssetData;
|
||||||
|
// Dirty Flags
|
||||||
|
static bool meshChanged;
|
||||||
|
static bool textureChanged;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* Helper Functions */
|
/* Helper Functions */
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace SHADE
|
||||||
}
|
}
|
||||||
|
|
||||||
auto handle = load<ResourceType>(assetId, *assetData);
|
auto handle = load<ResourceType>(assetId, *assetData);
|
||||||
Handle genericHandle = Handle();
|
Handle genericHandle = Handle(handle);
|
||||||
typedHandleMap.get().emplace(assetId, genericHandle);
|
typedHandleMap.get().emplace(assetId, genericHandle);
|
||||||
typedAssetIdMap.get().emplace(genericHandle, assetId);
|
typedAssetIdMap.get().emplace(genericHandle, assetId);
|
||||||
return handle;
|
return handle;
|
||||||
|
@ -139,6 +139,7 @@ namespace SHADE
|
||||||
if constexpr (std::is_same_v<ResourceType, SHMesh>)
|
if constexpr (std::is_same_v<ResourceType, SHMesh>)
|
||||||
{
|
{
|
||||||
loadedAssetData.emplace_back(assetId);
|
loadedAssetData.emplace_back(assetId);
|
||||||
|
meshChanged = true;
|
||||||
|
|
||||||
return gfxSystem->AddMesh
|
return gfxSystem->AddMesh
|
||||||
(
|
(
|
||||||
|
@ -155,6 +156,7 @@ namespace SHADE
|
||||||
else if constexpr (std::is_same_v<ResourceType, SHTexture>)
|
else if constexpr (std::is_same_v<ResourceType, SHTexture>)
|
||||||
{
|
{
|
||||||
loadedAssetData.emplace_back(assetId);
|
loadedAssetData.emplace_back(assetId);
|
||||||
|
textureChanged = true;
|
||||||
|
|
||||||
return gfxSystem->AddTexture
|
return gfxSystem->AddTexture
|
||||||
(
|
(
|
||||||
|
|
|
@ -72,6 +72,10 @@ namespace SHADE
|
||||||
}
|
}
|
||||||
return node->IsActive();
|
return node->IsActive();
|
||||||
}
|
}
|
||||||
|
Entity GameObject::EntityId::get()
|
||||||
|
{
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* GameObject Property Functions */
|
/* GameObject Property Functions */
|
||||||
|
|
|
@ -86,6 +86,13 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
bool get();
|
bool get();
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Native Entity ID value for this GameObject.
|
||||||
|
/// </summary>
|
||||||
|
property Entity EntityId
|
||||||
|
{
|
||||||
|
Entity get();
|
||||||
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
/* GameObject Property Functions */
|
/* GameObject Property Functions */
|
||||||
|
|
|
@ -38,7 +38,6 @@ public class PhysicsTest : Script
|
||||||
RigidBody.AddForce(Force);
|
RigidBody.AddForce(Force);
|
||||||
Debug.Log($"Jump!");
|
Debug.Log($"Jump!");
|
||||||
}
|
}
|
||||||
Debug.Log($"{Transform.LocalPosition.y}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void fixedUpdate()
|
protected override void fixedUpdate()
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue