Page 1 of 1

Using OBBoxRenderable to test interection...

Posted: Mon Oct 13, 2014 11:56 am
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?
Thanks
Jack

http://www.ogre3d.org/tikiwiki/tiki-ind ... unding+Box

Code: Select all

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

Re: Using OBBoxRenderable to test interection...

Posted: Mon Oct 13, 2014 11:17 pm
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.