[Gambas-user] -Inf

Kevin Fishburne kevinfishburne at ...1887...
Mon May 19 04:24:41 CEST 2014


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





More information about the User mailing list