예제 #1
0
        private void worldObject_TransformationChanged(object sender, EventArgs e)
        {
            var worldObject = (WorldObject)sender;

            Debug.Assert(registeredObjects.Contains(worldObject));

            if (BoundingBox.Intersects(worldObject.WorldBoundary, worldObject.Sector.Boundary))
            {
                return;
            }

            Sector oldSector = worldObject.Sector;
            Sector newSector = FindSectorForObject(worldObject);

            oldSector.UnregisterObject(worldObject);
            if (newSector != null)
            {
                newSector.RegisterObject(worldObject);
            }
        }
예제 #2
0
        private void worldObject_TransformationChanged(object sender, EventArgs e)
        {
            var worldObject = (WorldObject)sender;

            // In the case when object orientation update cause current sector change
            if (!registeredObjects.Contains(worldObject))
            {
                return;
            }

            ReallyUpdateObject(worldObject);
        }