コード例 #1
0
        /// <summary>
        /// Clones the fixture and attached shape onto the specified body.
        /// Note: This is used only by Deserialization.
        /// </summary>
        /// <param name="body">The body you wish to clone the fixture onto.</param>
        /// <returns>The cloned fixture.</returns>
        internal Fixture CloneOnto(Body body, Shape shape)
        {
            Fixture fixture = new Fixture(shape.Clone());

            fixture.UserData             = UserData;
            fixture.Restitution          = Restitution;
            fixture.Friction             = Friction;
            fixture.IsSensor             = IsSensor;
            fixture._collisionGroup      = _collisionGroup;
            fixture._collisionCategories = _collisionCategories;
            fixture._collidesWith        = _collidesWith;

            body.Add(fixture);
            return(fixture);
        }