freezy/VisualPinball.Engine

Add Flipper Rubber Dampening when Flipper is in Up-Position

Open

#438 创建于 2022年8月29日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)C# (72 fork)github user discovery
enhancementhelp wantedphysics

仓库指标

Star
 (498 star)
PR 合并指标
 (PR 指标待抓取)

描述

Flippers on newest VPW-Releases have some dampening (only if Flipper is held up and no live catch happened) and when abs(velx) < 2 and vely < 0 and vely > -3.75

This should be implemented.

'######################### Add new FlippersD Profile
'#########################    Adjust these values to increase or lessen the elasticity

dim FlippersD : Set FlippersD = new Dampener
FlippersD.name = "Flippers"
FlippersD.debugOn = False
FlippersD.Print = False	
FlippersD.addpoint 0, 0, 1.1	
FlippersD.addpoint 1, 3.77, 0.99
FlippersD.addpoint 2, 6, 0.99

'######################### Add Dampenf to Dampener Class 
'#########################    Only applies dampener when abs(velx) < 2 and vely < 0 and vely > -3.75  


	public sub Dampenf(aBall, parm)
		dim RealCOR, DesiredCOR, str, coef
		DesiredCor = LinearEnvelope(cor.ballvel(aBall.id), ModIn, ModOut )
		RealCOR = BallSpeed(aBall) / cor.ballvel(aBall.id)
		coef = desiredcor / realcor 
		If abs(aball.velx) < 2 and aball.vely < 0 and aball.vely > -3.75 then 
			aBall.velx = aBall.velx * coef : aBall.vely = aBall.vely * coef
		End If
	End Sub

贡献者指南