point detect in body

Official forum for the Chipmunk2D Physics Library.
Post Reply
ideath
Posts: 3
Joined: Sat Jan 10, 2015 6:28 am
Contact:

point detect in body

Post by ideath »

Hello is there way to detect that point with coordinates (x,y) inside a body?
I'm using chipmunk with cocos2d js
aisman
Posts: 145
Joined: Tue Mar 04, 2008 2:21 am
Contact:

Re: point detect in body

Post by aisman »

Look on Demo file:
ChipmunkDemo.c =>

Code: Select all

static void
Tick(double dt)

Code: Select all

static void
Click(int button, int state)
I belive it is this one:

Code: Select all

cpVect new_point = cpvlerp(mouse_body->p, ChipmunkDemoMouse, 0.25f);
Chipmunk4PB: The fastest way to write games together with PureBasic and the Chipmunk physics engine.
ideath
Posts: 3
Joined: Sat Jan 10, 2015 6:28 am
Contact:

Re: point detect in body

Post by ideath »

ty for help but i found a solution in using "space.nearestPointQueryNearest" method.
but now i have another problem, how can i find distance between 2 shapes?
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 6 guests