From 4ad23a605f7b75d246264aab3e8fef3b326dbfb4 Mon Sep 17 00:00:00 2001 From: Diren D Bharwani Date: Sat, 12 Nov 2022 17:04:09 +0800 Subject: [PATCH] Fixed compilation issues from merge --- Assets/Scenes/M2Scene.shade | 10 +++++----- SHADE_Engine/src/Physics/SHPhysicsWorld.cpp | 5 +++++ SHADE_Engine/src/Scripting/SHScriptEngine.cpp | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Assets/Scenes/M2Scene.shade b/Assets/Scenes/M2Scene.shade index eed9526e..b5edc743 100644 --- a/Assets/Scenes/M2Scene.shade +++ b/Assets/Scenes/M2Scene.shade @@ -36,8 +36,8 @@ RigidBody Component: Type: Static Mass: 1 - Drag: 0 - Angular Drag: 0 + Drag: 0.00999999978 + Angular Drag: 0.00999999978 Use Gravity: true Interpolate: true Freeze Position X: false @@ -234,7 +234,7 @@ Components: Transform Component: Translate: {x: -4.49353218, y: 2.57871056, z: -5} - Rotate: {x: -0.463157475, y: -0.553180635, z: 0.0868046582} + Rotate: {x: 0, y: 0, z: 0} Scale: {x: 0.99998343, y: 0.999987662, z: 0.999981642} RigidBody Component: Type: Dynamic @@ -252,8 +252,8 @@ Collider Component: Colliders: - Is Trigger: false - Type: Sphere - Radius: 1 + Type: Box + Half Extents: {x: 1, y: 1, z: 1} Friction: 0.400000006 Bounciness: 0 Density: 1 diff --git a/SHADE_Engine/src/Physics/SHPhysicsWorld.cpp b/SHADE_Engine/src/Physics/SHPhysicsWorld.cpp index 1326ea3e..85e76702 100644 --- a/SHADE_Engine/src/Physics/SHPhysicsWorld.cpp +++ b/SHADE_Engine/src/Physics/SHPhysicsWorld.cpp @@ -35,7 +35,12 @@ namespace SHADE rp3dWorldSettings.defaultPositionSolverNbIterations = settings.numPositionSolverIterations; rp3dWorldSettings.isSleepingEnabled = settings.sleepingEnabled; + // These are my preferred default values. QoL for modifying these. + rp3dWorldSettings.defaultBounciness = 0.0f; + rp3dWorldSettings.defaultFrictionCoefficient = 0.4f; + world = factory.createPhysicsWorld(rp3dWorldSettings); + world->setContactsPositionCorrectionTechnique(rp3d::ContactsPositionCorrectionTechnique::SPLIT_IMPULSES); } void SHPhysicsWorldState::DestroyWorld(rp3d::PhysicsCommon& factory) diff --git a/SHADE_Engine/src/Scripting/SHScriptEngine.cpp b/SHADE_Engine/src/Scripting/SHScriptEngine.cpp index 59127994..8d08e89e 100644 --- a/SHADE_Engine/src/Scripting/SHScriptEngine.cpp +++ b/SHADE_Engine/src/Scripting/SHScriptEngine.cpp @@ -26,6 +26,7 @@ of DigiPen Institute of Technology is prohibited. #include "Events/SHEventManager.hpp" #include "Physics/System/SHPhysicsSystem.h" #include "Physics/SHPhysicsEvents.h" +#include "Scene/SHSceneGraphEvents.h" #include "Assets/SHAssetMacros.h"