From 8e9f44ac217c59e42203bed6c523c34226bfa49c Mon Sep 17 00:00:00 2001 From: Lamakaio Date: Tue, 11 Jun 2024 18:24:38 +0200 Subject: [PATCH] more fixes for windows builds ... --- 3rdparty/CMakeLists.txt | 2 ++ src/ospjolt/activescene/joltinteg_fn.cpp | 2 +- src/testapp/sessions/jolt.cpp | 9 +++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 5b13db0f..d55b7689 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -251,4 +251,6 @@ SET(CUSTOM_CONFIGURATION ON CACHE BOOL "" FORCE) #ADD_SUBDIRECTORY(RmlUi EXCLUDE_FROM_ALL) SET(ENABLE_ALL_WARNINGS OFF CACHE BOOL "" FORCE) SET(USE_STATIC_MSVC_RUNTIME_LIBRARY ON CACHE BOOL "" FORCE) +SET(DEBUG_RENDERER_IN_DEBUG_AND_RELEASE OFF CACHE BOOL "" FORCE) +SET(DISABLE_CUSTOM_ALLOCATOR ON CACHE BOOL "" FORCE) ADD_SUBDIRECTORY(JoltPhysics/Build EXCLUDE_FROM_ALL) diff --git a/src/ospjolt/activescene/joltinteg_fn.cpp b/src/ospjolt/activescene/joltinteg_fn.cpp index ceea14a2..5025da32 100644 --- a/src/ospjolt/activescene/joltinteg_fn.cpp +++ b/src/ospjolt/activescene/joltinteg_fn.cpp @@ -135,7 +135,7 @@ Ref SysJolt::create_primitive(ACtxJoltWorld &rCtxWorld, osp::EShape shape return RotatedTranslatedShapeSettings( Vec3Arg::sZero(), Quat::sRotation(Vec3::sAxisX(), JPH_PI/2), - new CylinderShapeSettings(scale.GetY(), 2.0f * scale.GetX()) + new CylinderShapeSettings(scale.GetZ(), 2.0f * scale.GetX()) ).Create().Get(); default: diff --git a/src/testapp/sessions/jolt.cpp b/src/testapp/sessions/jolt.cpp index ec2f56e4..76d5d306 100644 --- a/src/testapp/sessions/jolt.cpp +++ b/src/testapp/sessions/jolt.cpp @@ -209,7 +209,8 @@ Session setup_phys_shapes_jolt( std::size_t numBodies = rPhysShapes.m_spawnRequest.size(); - JPH::BodyID addedBodies[numBodies]; + std::vector addedBodies; + addedBodies.reserve(numBodies); for (std::size_t i = 0; i < numBodies; ++i) { @@ -246,7 +247,7 @@ Session setup_phys_shapes_jolt( JPH::BodyID joltBodyId = BToJolt(bodyId); bodyInterface.CreateBodyWithID(joltBodyId, bodyCreation); - addedBodies[i] = joltBodyId; + addedBodies.push_back(joltBodyId); rJolt.m_bodyToEnt[bodyId] = root; rJolt.m_bodyFactors[bodyId] = joltFactors; @@ -254,8 +255,8 @@ Session setup_phys_shapes_jolt( } //Bodies are added all at once for performance reasons. - BodyInterface::AddState addState = bodyInterface.AddBodiesPrepare(addedBodies, numBodies); - bodyInterface.AddBodiesFinalize(addedBodies, numBodies, addState, EActivation::Activate); + BodyInterface::AddState addState = bodyInterface.AddBodiesPrepare(addedBodies.data(), numBodies); + bodyInterface.AddBodiesFinalize(addedBodies.data(), numBodies, addState, EActivation::Activate); }); return out;