Skip to main content

History: Talk:Oriented Bounding Box

Source of version: 1 (current)

Copy to clipboard
            In Ember I provide a non-axis aligned bounding box by extending the axis aligned one and override some of the methods. The code is this. It works just as the AABBWireBoundingBox.
~pp~namespace Ogre {

    /**
    This is just like a WireBoundBox but not aligned to the axes, hence it will correctly line up according to its orientation.
    */
    class OOBBWireBoundingBox  : public WireBoundingBox
    {
        public:
    
        void getWorldTransforms( Matrix4* xform ) const
        {
            SimpleRenderable::getWorldTransforms(xform);
        }
        //-----------------------------------------------------------------------
        const Quaternion& getWorldOrientation(void) const
        {
            return SimpleRenderable::getWorldOrientation();
        }
        //-----------------------------------------------------------------------
        const Vector3& getWorldPosition(void) const
        {
            return SimpleRenderable::getWorldPosition();
        }                

    };

};~/pp~
--((User:Azatoth|Azatoth)) 11:07, 12 July 2007 (BST)