Search code examples
c#xnafarseer

FarSeer : Remove Object On MouseClick


I'm still developing a small game, where I want to remove boxes when I click with mouse using FarSeer Engine 3.3 [if there is a solution I may already use 3.1]

Do not show me the example sources [i've them all, already and digged them deeply] my problem stays by checking colliding of mouse with the object. At FarSeer all objects are in interaction on a world, i have to pass my mouse to this world, where it may not do anything except i want.

How can I success a function IsTheObjectClicked [by Right or Left Mouse] at FarSeer.

(more, do not give any documention from FarSeer's webpage it is not update] Thanks


Solution

  • Your Mouse is not a Farseer Body, it is an input, and is handled as an input by the XNA framework.

    You could create a Farseer Body, and apply the active Mouse position to it, effectively mapping the mouse position to the Body. This would allow you to interact with your Farseer world using your Mouse.

    You could also just grab the mouse position when clicked, and do a position check to see if there are any Shapes at that location, and remove them.