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: sa...@eightvirtues.com 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user