Concave polygons

Sep 29, 2010 at 8:39 PM

Is concave polygons supposed to work?

I create one as a Path in Blend and it "almost" works. The problem is that small objects collides before getting to the concave corners of the polygon.

I would like to use a LARGE polygon for the ground with lots of points. Is this recommeded or is there a better solution?

Sep 30, 2010 at 6:33 PM

Yeah, concave should be fine. If you are noticing collision problems, set IsDebug="True" on the PhysicsControllerBehavior and see what the detected outline is. If it appears off, make sure that your main Game Canvas is located at offset 0,0 (sorry for that limitation - it needs offset world coordinates!)


Oct 7, 2010 at 8:37 PM

The outlines looks fine but the ball stops before hitting the ground.

The code below defines a small ball falling into a concave shape, but the ball stops about 30 pixels above where it should.

	Width="640" Height="480">

	<Canvas x:Name="LayoutRoot">
			<pb:PhysicsControllerBehavior MousePickEnabled="True" DebugMode="True"/>
		<Path Data="M0,0 L320,400 L640,0 L640,480 L0,480 z" Fill="red" Height="480" Stretch="Fill" Width="640">
				<pb:PhysicsObjectBehavior IsStatic="True"/>
		<Ellipse Fill="blue" Height="20" Width="20" Canvas.Left="390" Canvas.Top="70">