SceneContainer::getBinRange() - Bad Range
by JohnT · in Torque X 2D · 06/22/2008 (3:53 pm) · 3 replies
I am carrying this forward from the General Discussion area since I believe this to be a bug in the engine.
The problem is that I keep receiving an Assert while using the RigidComponent while also moving the object in code. The Assert appears to be originating from SceneContainer.cs at line 748
Assert.Fatal(max >= min, "SceneContainer::getBinRange() - Bad Range!");
Primarily the Assert happens when I am moving the object using the following to move in a forward direction and fire a weapon at it. When I step into the code after hitting Retry I get NaN for max and min.
obj.Scene.Position += new Vector3(obj.Scene.Transform.Forward.X*10, obj.Scene.Transform.Forward.Y*10, 0);
I should mention that I am running on a quad core processor and I am seeing all processors working so I am assuming that this could be a mult-threading issue.
The problem is that I keep receiving an Assert while using the RigidComponent while also moving the object in code. The Assert appears to be originating from SceneContainer.cs at line 748
Assert.Fatal(max >= min, "SceneContainer::getBinRange() - Bad Range!");
Primarily the Assert happens when I am moving the object using the following to move in a forward direction and fire a weapon at it. When I step into the code after hitting Retry I get NaN for max and min.
obj.Scene.Position += new Vector3(obj.Scene.Transform.Forward.X*10, obj.Scene.Transform.Forward.Y*10, 0);
I should mention that I am running on a quad core processor and I am seeing all processors working so I am assuming that this could be a mult-threading issue.
About the author
#2
I'll give that a try and see if the Asserts come up less often.
06/22/2008 (4:28 pm)
Thanks, sounds like a good idea.I'll give that a try and see if the Asserts come up less often.
#3
06/22/2008 (6:16 pm)
Yeah, I pretty much pulled that advice right out of the source/// <summary>
/// The velocity of the object. This property should be used to move an object
/// instead of the scene group's Position property so the object can resolve collisions
/// properly. Movement will also be smoother. This value will be changing constantly as
/// the object collides with other objects. To force it to stay the same, set Kinetic to
/// true.
/// </summary>
public Vector3 Velocity
{
get { return _rigidBody.Velocity; }
set { _rigidBody.Velocity = value; }
}
Torque 3D Owner Will O-Reagan
Modern Intrigues
You might try using Velocity to move the object, then it might play better with the rigid physics, who knows.