Using OBBoxRenderable to test interection...

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Posts: 11
Joined: Sun Nov 25, 2007 12:23 pm

Using OBBoxRenderable to test interection...

Post by luckiejacky »

I would like to test two oriented bounding box intersect,
First step to go is to test whether a point is intersecting with the box.
I can't seem to get the orientation and position of a SimpleRenderable. object..
where it is derived from. And there seems to be nothing to call to work
with intersections intrinsically with OBBoxRenderables.
Any ideas?
Jack ... unding+Box

Code: Select all

bool OBBoxRenderable::Intersect(Ogre::Vector3& point) {
	// from position/orientation to matrix
	Matrix4 mat(this->getOrientation());
	mat = mat.inverse();

User avatar
OGRE Team Member
OGRE Team Member
Posts: 4340
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 877

Re: Using OBBoxRenderable to test interection...

Post by dark_sylinc »

Get the SimpleRenderable's parent scene node and get the position and orientation from there.

If the scene node is a null pointer, the SimpleRenderable isn't part of the scene (because you didn't attach it to a node) and thus has no position or orientation.

Post Reply