2)is it possible to add some effect on transparent/semi transparent ramp? like somme blur or offset of that can we see through? maybe piloted by a tecture like a similar bump map texture? I think it will make better plastic ramp rendering.

' This function is called by FP for RightFlipper when ball may hit flipper.

' I want to moddify flipper settings in one fuction for all flippers, so....' ... this function will call OnPreHitFlipperSettings with RightFlipperExt as argument.Sub RightFlipper_prehit() OnPreHitFlipperSettings(RightFlipperExt)End Sub

' This function is called by FP for LeftFlipper when ball may hit flipper.' I want to moddify flipper settings in one fuction for all flippers, so....' ... this function will call OnPreHitFlipperSettings with LeftFlipperExt as argument.Sub LeftFlipper_prehit() OnPreHitFlipperSettings(LeftFlipperExt)End Sub

' This function is called by LeftFlipper_prehit or RightFlipper_prehit.' I want to moddify flipper settings in one fuction for all flippers, so ....' .... it will call one of demo versions of OnPreHitFlipperSettings_...something...' [ha ha .... one more jump to go]'' Tips for you:' 1. Unrem one line to test version of OnPreHitFlipperSettings... or rem all if you want to use default FP.' 2. If you want to have ONE OnPreHitFlipperSettings like i do, you can put all code inside OnPreHitFlipperSettings' 3. If you want differen behave for different flippers you can put different code in LeftFlipper_prehit and RightFlipper_prehit' Dont forget to to rename FlipperExt from my examples to LeftFlipperExt and RightFlipperExt or ....' At begin of LeftFlipper_prehit function you can add: Dim FlipperExt: Set FlipperExt = LeftFlipperExtSub OnPreHitFlipperSettings(FlipperExt)' OnPreHitFlipperSettings_weekTip(FlipperExt) OnPreHitFlipperSettings_linearOmega(FlipperExt)' OnPreHitFlipperSettings_massWeekTip(FlipperExt)' OnPreHitFlipperSettings_linearElasticCoef(FlipperExt)' OnPreHitFlipperSettings_bounceControl(FlipperExt)' ---- versions with some debug info when you press F9 instead of F5' OnPreHitFlipperSettings_weekTip_debug(FlipperExt) OnPreHitFlipperSettings_linearOmega_debug(FlipperExt)' OnPreHitFlipperSettings_massWeekTip_debug(FlipperExt)' OnPreHitFlipperSettings_linearElasticCoef_debug(FlipperExt)End Sub

' This subroutine is executed for every newton physics simulation step.' Variable xBAM.NewtonCounter contains "frame counter" increased by 1 every simulation step.' I use it to check ball speed change after hit in all "debug" versions of OnPreHitFlipperSettings'' Tip:' If you don't want to use debug stuffs and debug versions of OnPreHitFlipperSettings:' - remove all line between "some debug stuffs" and "end of "some debug stuffs""' - remove all OnPreHitFlipperSettings_[... somthing ...]_debug subroutinesSub NewtonPhysicsTick() Dim Ball Set Ball = xBAM.BallCloseTo(0,0,0)

If Ball.Exist Then If NewtonCounterWhenBallHitFlipper+1= xBAM.NewtonCounter Then Dim precChange precChange = 0 ' test bellow is needed to avoid division by zero if BallSpeedBeforeHit is near 0 If BallSpeedBeforeHit > 1 Then precChange = CInt(100*((Ball.Speed - BallSpeedBeforeHit) / BallSpeedBeforeHit)) End If

' WeekTip:' If ball hit flipper near tip then set omega to 8, so:' If ContactPoint > 0.6 set Omega to 8.Sub OnPreHitFlipperSettings_weekTip(FlipperExt) If FlipperExt.Hit And FlipperExt.ContactPoint > 0.6 Then FlipperExt.Omega = 8 End IfEnd Sub

' LinearOmega:' Force applied to ball on hid should be ~same on all surface of flipper.' So, ball at tip should be pushed with same forca as ball near center or begin of flipper.Sub OnPreHitFlipperSettings_linearOmega(FlipperExt) If FlipperExt.Hit Then Dim omegaCorrection omegaCorrection = 1.0 - FlipperExt.ContactPoint * 0.7

' ContactPoint may be lower than 0.0 and higher than 1.0, so... ' ... we need to clamp omegaCorrection in range 0.05 to 1.0 If omegaCorrection < 0.05 Then omegaCorrection = 0.05 End If If omegaCorrection > 1.0 Then omegaCorrection = 1.0 End If

FlipperExt.Omega = 70 * omegaCorrection End IfEnd Sub

' MassWeekTip:' If ball hit flipper near tip then set mass to 50, so:' If ContactPoint > 0.6 set mass to 50.Sub OnPreHitFlipperSettings_massWeekTip(FlipperExt) If FlipperExt.Hit And FlipperExt.ContactPoint > 0.6 Then FlipperExt.Mass = 50 End IfEnd Sub

' LinearElasticCoef:' Tip of flipper will be less "bouncy" than center... center will be less bouncy than begin.Sub OnPreHitFlipperSettings_linearElasticCoef(FlipperExt) If FlipperExt.Hit Then Dim elasticCoef elasticCoef = 1.0 - FlipperExt.ContactPoint * 0.9

' ContactPoint may be lower than 0.0 and higher than 1.0, so... ' ... we need to clamp elasticCoef in range 0.05 to 1.0 If elasticCoef < 0.05 Then elasticCoef = 0.05 End If If elasticCoef > 1.0 Then elasticCoef = 1.0 End If

' 0.9 is max elasticCoef, at flipper tip it will be 0.05*0.9 = 0.045... ball should not bounce at tip FlipperExt.SetMaterial 0.9 * elasticCoef End IfEnd Sub

' ContactPoint may be lower than 0.0 and higher than 1.0, so... ' ... we need to clamp omegaCorrection in range 0.05 to 1.0 If omegaCorrection < 0.05 Then omegaCorrection = 0.05 End If If omegaCorrection > 1.0 Then omegaCorrection = 1.0 End If

' ContactPoint may be lower than 0.0 and higher than 1.0, so... ' ... we need to clamp elasticCoef in range 0.05 to 1.0 If elasticCoef < 0.05 Then elasticCoef = 0.05 End If If elasticCoef > 1.0 Then elasticCoef = 1.0 End If

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum