Beispiel #1
0
        public void GetNodeBound(int nodeindex, out AABB bound)
        {
            bound.m_min = GImpactQuantization.Unquantize(
                ref m_node_array.GetRawArray()[nodeindex].m_quantizedAabbMin,
                ref m_global_bound.m_min, ref m_bvhQuantization);

            bound.m_max = GImpactQuantization.Unquantize(
                ref m_node_array.GetRawArray()[nodeindex].m_quantizedAabbMax,
                ref m_global_bound.m_min, ref m_bvhQuantization);
        }
Beispiel #2
0
        public void SetNodeBound(int nodeindex, ref AABB bound)
        {
            GImpactQuantization.QuantizeClamp(out m_node_array.GetRawArray()[nodeindex].m_quantizedAabbMin,
                                              ref bound.m_min,
                                              ref m_global_bound.m_min,
                                              ref m_global_bound.m_max,
                                              ref m_bvhQuantization);

            GImpactQuantization.QuantizeClamp(out m_node_array.GetRawArray()[nodeindex].m_quantizedAabbMax,
                                              ref bound.m_max,
                                              ref m_global_bound.m_min,
                                              ref m_global_bound.m_max,
                                              ref m_bvhQuantization);
        }
Beispiel #3
0
        protected void CalcQuantization(GIM_BVH_DATA_ARRAY primitive_boxes, float boundMargin)
        {
            //calc globa box
            AABB global_bound = new AABB();

            global_bound.Invalidate();

            int count = primitive_boxes.Count;

            for (int i = 0; i < count; i++)
            {
                global_bound.Merge(ref primitive_boxes.GetRawArray()[i].m_bound);
            }

            GImpactQuantization.CalcQuantizationParameters(out m_global_bound.m_min, out m_global_bound.m_max, out m_bvhQuantization, ref global_bound.m_min, ref global_bound.m_max, boundMargin);
        }
Beispiel #4
0
 public void QuantizePoint(out UShortVector3 quantizedpoint, ref IndexedVector3 point)
 {
     GImpactQuantization.QuantizeClamp(out quantizedpoint, ref point, ref m_global_bound.m_min, ref m_global_bound.m_max, ref m_bvhQuantization);
 }