void VTerrainVisibilityInfo::Helper_GetShadowBox(hkvAlignedBBox &result, const hkvAlignedBBox &sourceBox) const
{
  result = sourceBox;
  hkvVec3 vShadowOfs = m_vShadowExtrusion * sourceBox.getSizeZ();
  result.translate(vShadowOfs);
  result.expandToInclude(sourceBox);
}
 ///\brief
 ///Evaluates the bounding box of the capsule
 inline void GetBoundingBox(hkvAlignedBBox &dest)
 {
   dest.m_vMin = m_vStartPosition;
   dest.m_vMax = m_vStartPosition;
   dest.expandToInclude(m_vStartPosition+m_vDirection*GetLength());
   dest.addBoundary (hkvVec3 (GetRadius()));
 }
void VParticleWallmark::InflateBoundingBox(hkvAlignedBBox &bbox)
{
  hkvVec3 vDist(distortion[0],distortion[1],distortion[2]);
  float fRadius = vDist.getLength();
  fRadius = hkvMath::Max(fRadius,size);
  hkvAlignedBBox thisBox(hkvVec3 (pos[0]-fRadius,pos[1]-fRadius,pos[2]-fRadius), hkvVec3 (pos[0]+fRadius,pos[1]+fRadius,pos[2]+fRadius));
  bbox.expandToInclude(thisBox);
}
    /// \brief
    ///  Calculates the absolute bounding box for this instance
    ///
    /// \param destBBox
    ///  Destination box
    ///
    inline void GetBoundingBox(hkvAlignedBBox &destBBox) const
    {
        m_spModel->EnsureLoaded();
        VASSERT(m_spModel->m_LocalBBox.isValid());
        destBBox.setInvalid();

        //destBBox.Inflate(m_spModel->m_LocalBBox,m_Orientation,m_vPosition);
        {
            hkvAlignedBBox temp = m_spModel->m_LocalBBox;
            hkvMat4 mTransform (m_Orientation, m_vPosition);
            temp.transformFromOrigin (mTransform);
            destBBox.expandToInclude (temp);
        }

    }
    inline void GetRenderBoundingBox(hkvAlignedBBox &destBBox, const hkvVec3& vOffset) const
    {
        VASSERT(m_spModel->m_LocalBBox.isValid());
        destBBox.setInvalid();

        //destBBox.Inflate(m_spModel->m_LocalBBox,m_Orientation,m_vPosition);
        {
            hkvAlignedBBox temp = m_spModel->m_LocalBBox;
            hkvMat4 mTransform (m_Orientation, m_vPosition);
            temp.transformFromOrigin (mTransform);
            destBBox.expandToInclude (temp);
        }

        destBBox.m_vMin += vOffset;
        destBBox.m_vMax += vOffset;
    }