www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: subhalakshmi27 on January 27, 2012, 04:42:04 am

Title: Detecting touch on particular position on the model
Post by: subhalakshmi27 on January 27, 2012, 04:42:04 am
Hi All,

I like to know if a particular part like head or leg in the model is touched. With collision detection I am able to get the polygon ID. As Polygon ID is generated by the JPCT_AE system, will I be able to map the model with polygon ID and know which particular part is touched?

Or do I need to make head and leg as separate meshes so that I can detect using collision detection?


Thanks,
Subha
Title: Re: Detecting touch on particular position on the model
Post by: EgonOlsen on January 27, 2012, 07:48:34 am
You have to figure that out on your own. jPCT-AE can't possibly know which polygon belongs to which part, because it doesn't know of any parts in the model. For legs and arms, you might be able to use the PolygonManager to loop through all polygons once and create a list of id 2 part simply based on their spatial position in object space.