Logo Search packages:      
Sourcecode: blender version File versions  Download package

ATTRIBUTE_ALIGNED16 ( struct   ) 

btQuantizedBvhNode is a compressed aabb node, 16 bytes. Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range).

Definition at line 36 of file btGImpactQuantizedBvh.h.

Referenced by btDbvtBroadphase::getBroadphaseAabb(), and btCompoundCollisionAlgorithm::processCollision().

{
      //12 bytes
      unsigned short int      m_quantizedAabbMin[3];
      unsigned short int      m_quantizedAabbMax[3];
      //4 bytes
      int   m_escapeIndexOrDataIndex;

      BT_QUANTIZED_BVH_NODE()
      {
            m_escapeIndexOrDataIndex = 0;
      }

      SIMD_FORCE_INLINE bool isLeafNode() const
      {
            //skipindex is negative (internal node), triangleindex >=0 (leafnode)
            return (m_escapeIndexOrDataIndex>=0);
      }

      SIMD_FORCE_INLINE int getEscapeIndex() const
      {
            //btAssert(m_escapeIndexOrDataIndex < 0);
            return -m_escapeIndexOrDataIndex;
      }

      SIMD_FORCE_INLINE void setEscapeIndex(int index)
      {
            m_escapeIndexOrDataIndex = -index;
      }

      SIMD_FORCE_INLINE int getDataIndex() const
      {
            //btAssert(m_escapeIndexOrDataIndex >= 0);

            return m_escapeIndexOrDataIndex;
      }

      SIMD_FORCE_INLINE void setDataIndex(int index)
      {
            m_escapeIndexOrDataIndex = index;
      }

      SIMD_FORCE_INLINE bool testQuantizedBoxOverlapp(
            unsigned short * quantizedMin,unsigned short * quantizedMax) const
      {
            if(m_quantizedAabbMin[0] > quantizedMax[0] ||
               m_quantizedAabbMax[0] < quantizedMin[0] ||
               m_quantizedAabbMin[1] > quantizedMax[1] ||
               m_quantizedAabbMax[1] < quantizedMin[1] ||
               m_quantizedAabbMin[2] > quantizedMax[2] ||
               m_quantizedAabbMax[2] < quantizedMin[2])
            {
                  return false;
            }
            return true;
      }

};


Generated by  Doxygen 1.6.0   Back to index