[Gambas-user] -Inf

Randall Morgan rmorgan62 at ...626...
Mon May 19 12:11:06 CEST 2014


JAT: Id be checking for an over or under flow on one of the math
functions....


On Sun, May 18, 2014 at 7:24 PM, Kevin Fishburne <
kevinfishburne at ...1887...> wrote:

> I have an interpolation algorithm that continually moves the "current"
> value toward its "target" value in increments increased by the
> "distance" between the current and target values. Recently when
> assigning random values to the target values the current values
> eventually become negative infinity (-Inf), which seems to disregard
> further modification. Here's the code:
>
> OrientationDistance = Abs(Client.PlayerData[p].Limb.Torso.Current[Axis]
> - Client.PlayerData[p].Limb.Torso.Target[Axis]) *
> OrientationDistanceCoefficient
> If Client.PlayerData[p].Limb.Torso.Current[Axis] <
> Client.PlayerData[p].Limb.Torso.Target[Axis] Then
>      Client.PlayerData[p].Limb.Torso.Velocity[Axis] =
> (Client.PlayerData[p].Limb.Torso.Velocity[Axis] +
> OrientationAcceleration) * OrientationDistance
>      If Client.PlayerData[p].Limb.Torso.Velocity[Axis] >
> OrientationVelocityMaximum Then
> Client.PlayerData[p].Limb.Torso.Velocity[Axis] = OrientationVelocityMaximum
> Else
>      Client.PlayerData[p].Limb.Torso.Velocity[Axis] =
> (Client.PlayerData[p].Limb.Torso.Velocity[Axis] -
> OrientationAcceleration) * OrientationDistance
>      If Client.PlayerData[p].Limb.Torso.Velocity[Axis] < -
> OrientationVelocityMaximum Then
> Client.PlayerData[p].Limb.Torso.Velocity[Axis] = -
> OrientationVelocityMaximum
> Endif
> Client.PlayerData[p].Limb.Torso.Current[Axis] +=
> Client.PlayerData[p].Limb.Torso.Velocity[Axis]
>
> Any ideas what could be causing this? I don't even know what negative
> infinity means, though it's obviously something mathematicians found
> useful to solve a particular problem. In my case it botches my player
> animations by making limbs disappear. Thanks, everyone.
>
> --
> Kevin Fishburne
> Eight Virtues
> www: http://sales.eightvirtues.com
> e-mail: sales at ...1887...
> phone: (770) 853-6271
>
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform
> available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?



More information about the User mailing list