diff --git a/Assets/Scripts/RaccoonShowcase.cs b/Assets/Scripts/RaccoonShowcase.cs index 1da191fd..424a8a3e 100644 --- a/Assets/Scripts/RaccoonShowcase.cs +++ b/Assets/Scripts/RaccoonShowcase.cs @@ -23,6 +23,7 @@ public class RaccoonShowcase : Script [Range(-5, 5)] public List intList = new List(new int[] { 2, 8, 2, 6, 8, 0, 1 }); public List enumList = new List(new Light.Type[] { Light.Type.Point, Light.Type.Directional, Light.Type.Ambient }); + public List nullList; public FontAsset fontAsset; public MeshAsset mesh; public MaterialAsset matAsset; diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index 03ca0b3d..bd1d60cd 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -61,8 +61,13 @@ namespace SHADE SHVkInstance::Init(true, false, true); #endif - // Get Physical Device and Construct Logical Device + // Get Physical Device physicalDevice = SHVkInstance::CreatePhysicalDevice(SH_PHYSICAL_DEVICE_TYPE::BEST); + if (!physicalDevice->GetVkPhysicalDevice()) + { + throw std::runtime_error("[Graphics System] No supported Vulkan 1.3 compatible GPU was detected!"); + } + // Construct Logical Device device = SHVkInstance::CreateLogicalDevice({ SHQueueParams(SH_Q_FAM::GRAPHICS, SH_QUEUE_SELECT::DEDICATED), SHQueueParams(SH_Q_FAM::TRANSFER, SH_QUEUE_SELECT::DEDICATED) }, physicalDevice); // Construct surface diff --git a/SHADE_Engine/src/Physics/PhysicsObject/SHPhysicsObjectManager.cpp b/SHADE_Engine/src/Physics/PhysicsObject/SHPhysicsObjectManager.cpp index bd68de82..7c111a2d 100644 --- a/SHADE_Engine/src/Physics/PhysicsObject/SHPhysicsObjectManager.cpp +++ b/SHADE_Engine/src/Physics/PhysicsObject/SHPhysicsObjectManager.cpp @@ -250,9 +250,7 @@ namespace SHADE } // A static rigid body is implicitly created on creation of a physics object. - // We only need to sync rigid bodies here in the event it is non-static. - - physicsObject->SyncRigidBody(*componentGroup.rigidBodyComponent); + // Nothing is needed here. } void SHPhysicsObjectManager::addCollider(const QueueCommand&, SHPhysicsObject* physicsObject, const PhysicsComponentGroup& componentGroup) @@ -269,7 +267,7 @@ namespace SHADE //for (int i = 0; i < NUM_SHAPES; ++i) // physicsObject->AddCollisionShape(i); - //physicsObject->SyncColliders(*componentGroup.colliderComponent); + physicsObject->SyncColliders(*componentGroup.colliderComponent); } void SHPhysicsObjectManager::removeRigidBody(const QueueCommand&, SHPhysicsObject* physicsObject, const PhysicsComponentGroup& componentGroup) diff --git a/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp b/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp index 89be2614..2df5c496 100644 --- a/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp +++ b/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp @@ -411,7 +411,14 @@ namespace SHADE objectManager.AddRigidBody(EID); if (SHComponentManager::HasComponent(EID)) + { objectManager.AddCollider(EID); + + auto* COLLIDER = SHComponentManager::GetComponent(EID); + for (size_t i = 0; i < COLLIDER->GetCollisionShapes().size(); ++i) + objectManager.AddCollisionShape(EID, i); + } + }; //////////////////////////////// diff --git a/SHADE_Engine/src/Physics/System/SHPhysicsSystemRoutines.cpp b/SHADE_Engine/src/Physics/System/SHPhysicsSystemRoutines.cpp index 24bd2f81..1d070f00 100644 --- a/SHADE_Engine/src/Physics/System/SHPhysicsSystemRoutines.cpp +++ b/SHADE_Engine/src/Physics/System/SHPhysicsSystemRoutines.cpp @@ -255,6 +255,8 @@ namespace SHADE // Sync transforms & physics components transforms if (transformComponent && transformComponent->HasChanged()) { + physicsObject.GetRigidBody()->setIsSleeping(false); + preUpdateSyncTransform ( physicsObject diff --git a/SHADE_Managed/src/Editor/Editor.cxx b/SHADE_Managed/src/Editor/Editor.cxx index 29e3da36..80c73d4f 100644 --- a/SHADE_Managed/src/Editor/Editor.cxx +++ b/SHADE_Managed/src/Editor/Editor.cxx @@ -189,6 +189,12 @@ namespace SHADE System::Type^ listType = field->FieldType->GenericTypeArguments[0]; RangeAttribute^ rangeAttrib = hasAttribute(field); System::Collections::IList^ iList = safe_cast(field->GetValue(object)); + if (iList == nullptr) + { + // Create if the list does not exist + iList = safe_cast(System::Activator::CreateInstance(field->FieldType)); + field->SetValue(object, iList); + } if (SHEditorUI::CollapsingHeader(Convert::ToNative(field->Name), &isHovered)) {