64-bit compat

Sep 24, 2009 at 4:37 PM

Great package, thank you!

FYI your install script doesn't work quite right for x64.  It should detect whether the user is running x64 and place the files in %program files (x86)% if so.

I'd be happy to make the change and contribute back, but, I noticed that the source code on codeplex doesn't seem to be in sync with the packaged releases.  Are you maintaining the source repository elsewhere?

 

Coordinator
Sep 24, 2009 at 4:44 PM

Thanks, good catch.

Yeah, the Source is currently only available in the main Download package - I need to refresh the repository, it is behind! Thanks for your offer to contribute though - I'll ping you back when the repository is caught up.

Dec 3, 2009 at 12:53 PM

Hi, please notify me also when the release is also compatible with the 64bit version, looking forward to use this package :) Txs!

Coordinator
Dec 3, 2009 at 1:03 PM
Edited Dec 3, 2009 at 1:04 PM

The Physics Helper assemblies work fine under x64, it's just a problem with the install.bat file - which is meant to "install" the assemblies into Blend 3.

If you're running under x64, just follow these steps to work around the problem:

(1) Download the ZIP and extract the contents

(2) For Silverlight support in Blend 3, copy the following files to "%ProgramFiles (x86)%\Microsoft Expression\Blend 3\Libraries\Silverlight\v3.0"

Common\PhysicsBehaviors\ClientBin\FarseerPhysics.dll
Common\PhysicsBehaviors\ClientBin\Spritehand.FarseerHelper.dll
Common\PhysicsBehaviors\ClientBin\Spritehand.PhysicsBehaviors.dll
Common\PhysicsBehaviors.Design\ClientBin\Debug\Spritehand.PhysicsBehaviors.Design.dll

(3) For WPF support in Blend 3, copy the following files to "%ProgramFiles (x86)%\Microsoft Expression\Blend 3\Libraries\WPF\v3.5"

Common\PhysicsBehaviors\Bin\Debug\FarseerPhysics.dll
Common\PhysicsBehaviors\Bin\Debug\Spritehand.FarseerHelper.dll
Common\PhysicsBehaviors\Bin\Debug\Spritehand.PhysicsBehaviors.dll
Common\PhysicsBehaviors.Design\bin\Debug\Spritehand.PhysicsBehaviors.Design.dll

(4) Be sure to restart Blend, as it checks these folders for custom controls at startup.

Jan 6, 2010 at 3:05 PM

Hi Andy,

Indeed, this is a solid solution :) Now that I've installed everything and was doing my first exercises, I encountered an error when using a transparant png (see below). Can you give me an indication what's going wrong?

Txs in advance!

 

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)
Timestamp: Wed, 6 Jan 2010 15:07:44 UTC
Message: Unhandled Error in Silverlight Application [Arg_IndexOutOfRangeException]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.40818.0&File=mscorlib.dll&Key=Arg_IndexOutOfRangeException   at Spritehand.FarseerHelper.BoundaryHelper.GetNextVertex(UIElement element, Point current, Point last, Double left, Double top, Double width, Double height, WriteableBitmap bitmap)
   at Spritehand.FarseerHelper.BoundaryHelper.GetPointsForImage(Image element, UIElement containerElement, Boolean positionOnly)
   at Spritehand.FarseerHelper.BoundaryHelper.GetPointsForElement(UIElement element, UIElement containerElement, Boolean positionOnly)
   at Spritehand.FarseerHelper.PhysicsSprite..ctor(PhysicsSimulator physicsSim, Canvas parentCanvas, UIElement element, List`1 points, Boolean showDebug, Single defaultFriction, UIElement boundaryElement)
   at Spritehand.FarseerHelper.PhysicsControllerMain.AddPhysicsBody(PhysicsObjectMain physObject)
   at Spritehand.PhysicsBehaviors.PhysicsObjectBehavior.controller_Initialized(Object source)
   at Spritehand.FarseerHelper.PhysicsControllerMain.InitializedHandler.Invoke(Object source)
   at Spritehand.FarseerHelper.PhysicsControllerMain._timerInitialize_Completed(Object sender, EventArgs e)
   at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
Line: 1
Char: 1
Code: 0
URI: http://localhost:62677/TestPage.html

Webpage error details

 

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)

Timestamp: Wed, 6 Jan 2010 15:07:44 UTC

 

 

Message: Unhandled Error in Silverlight Application [Arg_IndexOutOfRangeException]

Arguments:

Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.40818.0&File=mscorlib.dll&Key=Arg_IndexOutOfRangeException   at Spritehand.FarseerHelper.BoundaryHelper.GetNextVertex(UIElement element, Point current, Point last, Double left, Double top, Double width, Double height, WriteableBitmap bitmap)

   at Spritehand.FarseerHelper.BoundaryHelper.GetPointsForImage(Image element, UIElement containerElement, Boolean positionOnly)

   at Spritehand.FarseerHelper.BoundaryHelper.GetPointsForElement(UIElement element, UIElement containerElement, Boolean positionOnly)

   at Spritehand.FarseerHelper.PhysicsSprite..ctor(PhysicsSimulator physicsSim, Canvas parentCanvas, UIElement element, List`1 points, Boolean showDebug, Single defaultFriction, UIElement boundaryElement)

   at Spritehand.FarseerHelper.PhysicsControllerMain.AddPhysicsBody(PhysicsObjectMain physObject)

   at Spritehand.PhysicsBehaviors.PhysicsObjectBehavior.controller_Initialized(Object source)

   at Spritehand.FarseerHelper.PhysicsControllerMain.InitializedHandler.Invoke(Object source)

   at Spritehand.FarseerHelper.PhysicsControllerMain._timerInitialize_Completed(Object sender, EventArgs e)

   at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)

   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

Line: 1

Char: 1

Code: 0

URI: http://localhost:62677/TestPage.html

 

 

Coordinator
Jan 6, 2010 at 3:12 PM

It could be your PNG image has one or more "stray pixels" --- it needs to have a clean outline that can be traced around it. So you could try bringing your image up in an editor and zoom in to make sure it has a clean outline.

This is because the algorithm that traces the outline of the image uses a path finding that hits a pixel and then starts a hit test to find the next pixel and basically follow the outline. I think I can make this algorithm a bit more foregiving, I'll see what I can do for future versions.

Jan 8, 2010 at 9:35 AM

Hi Andy,

Indeed, that seemed to be the problem. I used a rather rough cutout of an image (somebody's head). Only, I had to go to a full ellipse in order to get it to work ( and thereby losing a lot of detail), so it would be a great job if this could be more forgiving in a future version. Anyhow, still great fan of your work!

 

Jan 22, 2010 at 1:56 AM
Edited Jan 22, 2010 at 2:09 AM

Hi Andy

I think this PNG issue might not solely be about the stray pixels.  I did a simple clean, filled rectangle, (created once in MS Paint, then to eliminate also in Paint.NET)

Also tried as bmp

error triggered in WPF from:

Line 530 of BoundaryHelper.cs

int pixel = pixels[bitmap.PixelWidth * offsetY + offSetX];

Index was outside the bounds of the array.

OR

Line 163: Physics Sprite

 

if (points == null)
points = BoundaryHelper.GetPointsForElement(elementBoundary, element, false);

if (points == null)

 points = BoundaryHelper.GetPointsForElement(elementBoundary, element, false);

Index was outside the bounds of the array.

 

 

I'm really enjoying the power you have made available here; you are very generous to share your work.

Zaurska

Jan 22, 2010 at 10:17 AM
zaurska wrote:

Hi Andy

I think this PNG issue might not solely be about the stray pixels.  I did a simple clean, filled rectangle, (created once in MS Paint, then to eliminate also in Paint.NET)

Also tried as bmp

error triggered in WPF from:

Line 530 of BoundaryHelper.cs

int pixel = pixels[bitmap.PixelWidth * offsetY + offSetX];

Index was outside the bounds of the array.

OR

Line 163: Physics Sprite

 

if (points == null)
points = BoundaryHelper.GetPointsForElement(elementBoundary, element, false);

 

if (points == null)

 points = BoundaryHelper.GetPointsForElement(elementBoundary, element, false);

Index was outside the bounds of the array.

 

 

 

I'm really enjoying the power you have made available here; you are very generous to share your work.

Zaurska

 

Reducing the size of the PNG image worked here!

Z

Feb 21, 2010 at 1:38 PM
Edited Feb 21, 2010 at 1:46 PM

nevermind.........;)