コード例 #1
0
        private uint Morton2FromWorldPos(float x, float z)
        {
            uint px = (uint)Mathf.FloorToInt((x - m_Bounds.min.x) / m_DeltaWidth);
            uint pz = (uint)Mathf.FloorToInt((z - m_Bounds.min.z) / m_DeltaHeight);

            return(MortonCodeUtil.EncodeMorton2(px, pz));
        }
コード例 #2
0
        private uint Morton3FromWorldPos(float x, float y, float z)
        {
            uint px = (uint)Mathf.FloorToInt((x - m_Bounds.min.x) / m_DeltaX);
            uint py = (uint)Mathf.FloorToInt((y - m_Bounds.min.y) / m_DeltaY);
            uint pz = (uint)Mathf.FloorToInt((z - m_Bounds.min.z) / m_DeltaZ);

            return(MortonCodeUtil.EncodeMorton3(px, py, pz));
        }
コード例 #3
0
        private void TriggeLeafNode(IDetector detector, uint row, uint col, TriggerHandle <T> handle)
        {
            uint m = MortonCodeUtil.EncodeMorton2((uint)row, (uint)col);

            if (m_Nodes.ContainsKey(m) && m_Nodes[m] != null)
            {
                m_Nodes[m].Trigger(detector, handle);
            }
        }