Ejemplo n.º 1
0
        public override void OnEntityTransformChanged(Transform.Component comp)
        {
            base.OnEntityTransformChanged(comp);
            if (_ignoreTransformChanges)
            {
                return;
            }

            // we only care about scale. base handles pos/rot
            if (comp == Transform.Component.Scale)
            {
                // fetch the Vertices, clear them, add our originals and scale them
                PolygonShape poly  = Body.FixtureList[0].Shape as PolygonShape;
                Vertices     verts = poly.Vertices;
                verts.Clear();
                verts.AddRange(_verts);
                verts.Scale(Transform.Scale);
                poly.SetVerticesNoCopy(verts);

                // wake the body if it is asleep to update collisions
                if (!Body.IsAwake)
                {
                    Body.IsAwake = true;
                }
            }
        }