Get collison point

  ... the Physics Box2D Extension for AndEngine.

Get collison point

Postby kt1 » Tue May 01, 2012 6:04 pm

Hi!
My question is that possible that I get collision point between 2 body?
Please help me.
kt1
 
Posts: 42
Joined: Sun Feb 26, 2012 7:58 pm
Location: Hungary

Re: Get collison point

Postby jaym » Wed May 02, 2012 3:15 am

In the Box2d collision listener you can get the contact point via contact.getWorldManifold().getPoints() method. The contact allows for a maximum of 2 points of collision for more complex polygonal shapes, or one point for points of a triangle, circles, etc.

The getPoints() method returns an array of the points, otherwise you can specify the specific point you'd like to grab via getPoints()[0] for a single point of contact.
AndEngine for Android Game Development Cookbook - Based on AndEngine's latest, greatest, GLES2.0 AnchorCenter branch!
jaym
 
Posts: 690
Joined: Wed May 04, 2011 10:08 pm

Re: Get collison point

Postby kt1 » Tue May 15, 2012 5:17 pm

uhh. thanks
Can I get one example code for it?
kt1
 
Posts: 42
Joined: Sun Feb 26, 2012 7:58 pm
Location: Hungary


Return to Physics Box2D

Who is online

Users browsing this forum: No registered users and 7 guests