You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing a power server that will create multiple rooms and multiple physic worlds. My simple game object wrapping BulletSharp.CollisionObject will be added or removed at the end of frame like below code :
public void Unregister(SimpleGameObject go)
{
if (world.CollisionObjectArray.Contains(go.collision))
{
world.RemoveCollisionObject(go.collision);
go.collision.Dispose();
}
}
Sometime it will throw an exception such as :
Unhandled Exception: System.Exception: Removing object that is not being tracked. Object info: BulletSharp.CollisionObject
at BulletSharp.BulletObjectTracker.RemoveRef(BulletDisposableObject obj)
at BulletSharp.BulletObjectTracker.Remove(BulletDisposableObject obj)
at BulletSharp.BulletDisposableObject.Finalize()
It looks like that physic world lost dependence of collision object while GC calling Finalize() method. What may I do to solve this problem? It also will happen when disposing ray result callback after using RayTest() method :
public bool RaycastAll(Vector3 origin, Vector3 direct, out List<Vector3> hitPoints, out List<CollisionObject> hitObjs, int mask = -1)
{
Vector3 from = origin, to = origin + direct;
AllHitsRayResultCallback callback = new AllHitsRayResultCallback(from, to);
callback.CollisionFilterMask = mask;
world.RayTest(from, to, callback);
hitPoints = callback.HitPointWorld;
hitObjs = callback.CollisionObjects;
return callback.HasHit;
}
The text was updated successfully, but these errors were encountered:
I am developing a power server that will create multiple rooms and multiple physic worlds. My simple game object wrapping
BulletSharp.CollisionObject
will be added or removed at the end of frame like below code :Sometime it will throw an exception such as :
It looks like that physic world lost dependence of collision object while GC calling
Finalize()
method. What may I do to solve this problem? It also will happen when disposing ray result callback after usingRayTest()
method :The text was updated successfully, but these errors were encountered: