diff --git a/Dev/Cpp/Effekseer/Effekseer/Effekseer.Instance.cpp b/Dev/Cpp/Effekseer/Effekseer/Effekseer.Instance.cpp index 983f8d7c03..752695b5dd 100644 --- a/Dev/Cpp/Effekseer/Effekseer/Effekseer.Instance.cpp +++ b/Dev/Cpp/Effekseer/Effekseer/Effekseer.Instance.cpp @@ -775,7 +775,14 @@ void Instance::UpdateTransform(float deltaFrame) SIMD::Vec3f vel = SIMD::Vec3f::Transform(prevLocalVelocity_, r) + (velocity_modify_global_ + acc_global_sum); InstanceGlobal* instanceGlobal = m_pContainer->GetRootInstance(); - const auto result = CollisionsFunctions::Update(collisionState_, m_pEffectNode->Collisions, pos, prevGlobalPosition_, vel, instanceGlobal->EffectGlobalMatrix.GetTranslation()); + const auto result = CollisionsFunctions::Update( + collisionState_, + m_pEffectNode->Collisions, + pos, + prevGlobalPosition_, + vel, + instanceGlobal->EffectGlobalMatrix.GetTranslation(), + m_pEffectNode->GetEffect()->GetMaginification()); location_modify_global_ -= std::get<1>(result); acc_global_sum += std::get<0>(result); } diff --git a/Dev/Cpp/Effekseer/Effekseer/Parameter/Collisions.cpp b/Dev/Cpp/Effekseer/Effekseer/Parameter/Collisions.cpp index 0c6677a4ed..2f7396676a 100644 --- a/Dev/Cpp/Effekseer/Effekseer/Parameter/Collisions.cpp +++ b/Dev/Cpp/Effekseer/Effekseer/Parameter/Collisions.cpp @@ -31,7 +31,8 @@ std::tuple CollisionsFunctions::Update( const SIMD::Vec3f& next_position_global, const SIMD::Vec3f& position_global, const SIMD::Vec3f& velocity_global, - const SIMD::Vec3f& position_center_local) + const SIMD::Vec3f& position_center_local, + float magnification) { if (!parameter.IsEnabled) { @@ -48,10 +49,12 @@ std::tuple CollisionsFunctions::Update( current_position -= position_center_local; } - if (next_position.GetY() < parameter.Height && current_position.GetY() >= parameter.Height) + const auto height = parameter.Height * magnification; + + if (next_position.GetY() < height && current_position.GetY() >= height) { auto diff = next_position - current_position; - auto pos_diff = diff * (current_position.GetY() - parameter.Height) / diff.GetY(); + auto pos_diff = diff * (current_position.GetY() - height) / diff.GetY(); return {SIMD::Vec3f(0, -velocity_global.GetY() * (1.0f + parameter.Bounce), 0), pos_diff}; } else diff --git a/Dev/Cpp/Effekseer/Effekseer/Parameter/Collisions.h b/Dev/Cpp/Effekseer/Effekseer/Parameter/Collisions.h index f40a51af36..cb2f12448b 100644 --- a/Dev/Cpp/Effekseer/Effekseer/Parameter/Collisions.h +++ b/Dev/Cpp/Effekseer/Effekseer/Parameter/Collisions.h @@ -33,7 +33,8 @@ struct CollisionsFunctions const SIMD::Vec3f& next_position_global, const SIMD::Vec3f& position_global, const SIMD::Vec3f& velocity_global, - const SIMD::Vec3f& position_center_local); + const SIMD::Vec3f& position_center_local, + float magnificationScale); }; } // namespace Effekseer