freezy/VisualPinball.Engine

Use LivecatchBounceMultiplier to reduce angular momentum instead of nulling it.

Open

#439 geöffnet am 29. Aug. 2022

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (1 zugewiesene Person)C# (72 Forks)github user discovery
enhancementhelp wantedphysics

Repository-Metriken

Stars
 (498 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Currently, if a livecatch happens, angular momentum (only for x and y) is nulled, while livecatchbounceMultiplier is only used on velocity.

It could be tested, if the livecatches feel better, when the liveCatchBounceMultiplier (which is for example 0.2 for a slightly inaccurate livecatch) is not only applied to velocity, but also to the angular momentum.

	ball.Velocity -= collEvent.HitNormal * normalSpeed * liveCatchBounceMultiplier;
	ball.AngularMomentum.x = 0;
	ball.AngularMomentum.y = 0;

-->

	ball.Velocity -= collEvent.HitNormal * normalSpeed * liveCatchBounceMultiplier;
	ball.AngularMomentum.x *= liveCatchBounceMultiplier;
	ball.AngularMomentum.y *= liveCatchBounceMultiplier;

possibly only angular momentum in the direction of the collision-normal could be reduced. (like for velocity, or the same amount of the overall velocity reduction, otherwise calculation would be quite hard.)

Contributor Guide