This project has moved and is read-only. For the latest updates, please go here.

Breaking change announcement

Aug 19, 2011 at 2:19 PM

As of change set 11190 it's no longer possible to list geometries inside most body classes. For example this is no longer possible.

 

<Rectangle Canvas.Left="742" Canvas.Top="482" Width="50" Height="50" Fill="DarkRed">
    <physics:PhysicalBox.Body>
       <physics:RectangleBody>
            <physics:RectangleBody.Geometries>
                <physics:RectangleGeometry FrictionCoefficient="0.1" />
            </physics:RectangleBody.Geometries>
        </physics:RectangleBody>
    </physics:PhysicalBox.Body>
</Rectangle>

 

This will have to be changed to use the new EmptyBody class. It is now the only class that allows you to access the geometries collection.

 

<Rectangle Canvas.Left="742" Canvas.Top="482" Width="50" Height="50" Fill="DarkRed">
    <physics:PhysicalBox.Body>
       <physics:EmptyBody>
            <physics:EmptyBody.Geometries>
                <physics:RectangleGeometry FrictionCoefficient="0.1" />
            </physics:EmptyBody.Geometries>
        </physics:EmptyBody>
    </physics:PhysicalBox.Body>
</Rectangle>

In some cases this will mean you must set some of the properties on the geometry that the body was doing for you. In the case of a rectangle you must set the Width and Height.

<Rectangle Canvas.Left="742" Canvas.Top="482" Width="50" Height="50" Fill="DarkRed">
    <physics:PhysicalBox.Body>
       <physics:EmptyBody>
            <physics:EmptyBody.Geometries>
                <physics:RectangleGeometry FrictionCoefficient="0.1" Width="50" Height="50" />
            </physics:EmptyBody.Geometries>
        </physics:EmptyBody>
    </physics:PhysicalBox.Body>
</Rectangle>

The EllipseGeometry requires that you set the width and height as well and the CircleGeometry requires that you set the radius. Other geometry classes can be used the same as before.

In the future it will not be necessary to list geometries in these cases where all you want to do is change FrictionCoefficient or attach to the collide event. These properties will be made available in the body classes. Something like this will be possible before the next release.

<Rectangle Canvas.Left="742" Canvas.Top="482" Width="50" Height="50" Fill="DarkRed">
    <physics:PhysicalBox.Body>
       <physics:RectangleBody FrictionCoefficient="0.1" />
    </physics:PhysicalBox.Body>
</Rectangle>