I understand you think that a physics library is overkill for this, but
many of the problems you're running into are already solved. The choice
is yours to use the right tool for the job, or try coding your own solution.
Priyank Jain wrote:
Now, to do collision detection between the Ball (which I am considering to be a
point for now, and thus a line given its velocity) and the World, I'd want a
way for the line to be checked against the PAT transformed Bboxes. Any
suggestions on how I should approach this (any callback that I should define or
what)?
A bounding box (axis-aligned) is just two points. So you just need to
transform those two points by the PAT's matrix.
Also, as per the API, I can retrieve the bounding box of a Geode and bounding
sphere of a Node. Thus, if I were to use the above hierarchy, I would have 3
bounding spheres for left/center/right Transform. What I really want is a
bounding box for these 3, since the BS would be a very loose fit for the
collision detection. So, do you recommend me organizing the hierarchy in any
other way ?
Don't use the bounding sphere. Just use the bounding box of the Geode.
FYI, osgBullet has facilities to bridge the gap between OSG's inherently
relative coordinate system and the inherently absolute coordinate system
required for collision detection. osgBullet also has facilities for
creating collision shapes from scene graphs, so even if the bounding box
isn't axis-aligned, you can still create an exact collision shape.
-Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org