c# - Farseer ContactListener is not working -


i'm using farseer in xna project, have trouble contactlistener. created class contactlistener these 2 error messages , don't know how fix problems.

the type or namespace name 'contactlistener' not found (are missing using directive or assembly reference?)

the type or namespace name 'contactimpulse' not found (are missing using directive or assembly reference?)

what wrong contactlistener class?

class mycontactlistener: contactlistener {     void begincontact(contact contact)      { /* handle begin event */ }       void endcontact(contact contact)      { /* handle end event */ }        void presolve(contact contact, ref manifold oldmanifold)     {       fixture fixturea = contact.fixturea;       fixture fixtureb = contact.fixtureb;        if (fixtureb.collisioncategories == category.cat10)       {         contact.enabled = false;       }     }      void postsolve(contact contact, ref contactimpulse impulse)     { /* handle post-solve event */ }  } 

try this:

  • open vs
  • go solution explorer window
  • search folder called references , right click it
  • select add reference...
  • look farseer assembly , add it

and try adding these in code:

using farseerphysics.collision.shapes; using farseerphysics.common; using farseerphysics.dynamics; using farseerphysics.dynamics.contacts; using farseerphysics.factories; using farseerphysics.testbed.framework; using microsoft.xna.framework; 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -