From 94c4467d96a1a67b3e0ff39f60534f7cafb9c970 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Thu, 1 Aug 2024 10:29:00 +0200 Subject: [PATCH] [Core] Allow different gravity vectors --- Sofa/framework/Core/src/sofa/core/objectmodel/Context.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/Context.cpp b/Sofa/framework/Core/src/sofa/core/objectmodel/Context.cpp index 1bc2b619271..108c09a24c7 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/Context.cpp +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/Context.cpp @@ -136,7 +136,10 @@ void Context::copyContext(const Context& c) void Context::copySimulationContext(const Context& c) { - worldGravity_.setValue(c.getGravity()); ///< Gravity IN THE WORLD COORDINATE SYSTEM. + if (!worldGravity_.isSet()) + { + worldGravity_.setValue(c.getGravity()); ///< Gravity IN THE WORLD COORDINATE SYSTEM. + } setDt(c.getDt()); setTime(c.getTime()); setAnimate(c.getAnimate());