Skip to content

Commit

Permalink
tentative fix for MSVC CI issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamakaio committed Jun 13, 2024
1 parent a4cfcb9 commit fc9945e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ IF(MSVC)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<CONFIG> CACHE PATH "")
# Force multiprocessor compilation for all projects
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
# Force dynamic runtime library to be in debug mode in debug mode.
add_compile_options($<$<CONFIG:Debug>:$<$<CXX_COMPILER_ID:MSVC>:/MDd>>)
# Don't generate a blah.manifest file for each build target.
add_link_options(LINKER:/MANIFEST:NO)
ELSEIF(UNIX)
Expand Down
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 fc9945e

Please sign in to comment.