public void StoreIslandActivationState(CollisionWorld colWorld) { // put the islandId ('find' value) into m_tag { int index = 0; int i; CollisionObject[] collisionObjects = colWorld.GetCollisionObjectArray().GetRawArray(); int length = colWorld.GetCollisionObjectArray().Count; for (i = 0; i < length; i++) { CollisionObject collisionObject = collisionObjects[i]; if (!collisionObject.IsStaticOrKinematicObject()) { lock (m_unionFind) { collisionObject.SetIslandTag(m_unionFind.Find(index)); //Set the correct object offset in Collision Object Array //m_unionFind.GetElement(index).m_sz = i; m_unionFind.SetElementSize(index, i); } collisionObject.SetCompanionId(-1); index++; } else { collisionObject.SetIslandTag(-1); collisionObject.SetCompanionId(-2); } } } }
public void UpdateActivationState(CollisionWorld colWorld, IDispatcher dispatcher) { // put the index into m_controllers into m_tag int index = 0; { int i; CollisionObject[] collisionObjects = colWorld.GetCollisionObjectArray().GetRawArray(); int length = colWorld.GetCollisionObjectArray().Count; for (i = 0; i < length; i++) { CollisionObject collisionObject = collisionObjects[i]; //Adding filtering here if (!collisionObject.IsStaticOrKinematicObject()) { collisionObject.SetIslandTag(index++); } collisionObject.SetCompanionId(-1); collisionObject.SetHitFraction(1.0f); } } // do the union find InitUnionFind(index); FindUnions(dispatcher, colWorld); }
public virtual void StoreIslandActivationState(CollisionWorld collisionWorld) { int index = 0; ObjectArray <CollisionObject> list = collisionWorld.GetCollisionObjectArray(); int length = list.Count; CollisionObject[] rawList = list.GetRawArray(); for (int i = 0; i < length; ++i) { CollisionObject collisionObject = rawList[i]; if (!collisionObject.IsStaticOrKinematicObject()) { collisionObject.SetIslandTag(m_unionFind.Find(index)); collisionObject.SetCompanionId(-1); } else { collisionObject.SetIslandTag(-1); collisionObject.SetCompanionId(-2); } index++; } }
public virtual void UpdateActivationState(CollisionWorld collisionWorld, IDispatcher dispatcher) { InitUnionFind(collisionWorld.GetCollisionObjectArray().Count); // put the index into m_controllers into m_tag { int index = 0; ObjectArray <CollisionObject> list = collisionWorld.GetCollisionObjectArray(); int length = list.Count; CollisionObject[] rawList = list.GetRawArray(); for (int i = 0; i < length; ++i) { CollisionObject collisionObject = rawList[i]; collisionObject.SetIslandTag(index); collisionObject.SetCompanionId(-1); collisionObject.SetHitFraction(1f); index++; } } // do the union find FindUnions(dispatcher, collisionWorld); }