Skip to content

Commit

Permalink
more fixes for windows builds ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamakaio committed Jun 11, 2024
1 parent 780c3c9 commit 8e9f44a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion src/ospjolt/activescene/joltinteg_fn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Ref<Shape> 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:
Expand Down
9 changes: 5 additions & 4 deletions src/testapp/sessions/jolt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ Session setup_phys_shapes_jolt(

std::size_t numBodies = rPhysShapes.m_spawnRequest.size();

JPH::BodyID addedBodies[numBodies];
std::vector<JPH::BodyID> addedBodies;
addedBodies.reserve(numBodies);

for (std::size_t i = 0; i < numBodies; ++i)
{
Expand Down Expand Up @@ -246,16 +247,16 @@ 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;
rJolt.m_entToBody.emplace(root, bodyId);

}
//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;
Expand Down

0 comments on commit 8e9f44a

Please sign in to comment.