Beispiel #1
0
        public static void FindCollision(GImpactBvh boxset1, ref IndexedMatrix trans1,
                                         GImpactBvh boxset2, ref IndexedMatrix trans2,
                                         PairSet collision_pairs)
        {
            if (boxset1.GetNodeCount() == 0 || boxset2.GetNodeCount() == 0)
            {
                return;
            }

            BT_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0 = new BT_BOX_BOX_TRANSFORM_CACHE();

            trans_cache_1to0.CalcFromHomogenic(ref trans1, ref trans2);

#if TRI_COLLISION_PROFILING
            bt_begin_gim02_tree_time();
#endif //TRI_COLLISION_PROFILING

            FindCollisionPairsRecursive(boxset1, boxset2, collision_pairs, trans_cache_1to0, 0, 0, true);
#if TRI_COLLISION_PROFILING
            bt_end_gim02_tree_time();
#endif //TRI_COLLISION_PROFILING
        }
        public static void FindCollision(GImpactQuantizedBvh boxset0, ref IndexedMatrix trans0,
                                         GImpactQuantizedBvh boxset1, ref IndexedMatrix trans1,
                                         PairSet collision_pairs)
        {
            if (boxset0.GetNodeCount() == 0 || boxset1.GetNodeCount() == 0)
            {
                return;
            }

            BT_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0 = new BT_BOX_BOX_TRANSFORM_CACHE();

            trans_cache_1to0.CalcFromHomogenic(ref trans0, ref trans1);

#if TRI_COLLISION_PROFILING
            BulletGlobals.StartProfile("GIMPACT-TRIMESH");
#endif //TRI_COLLISION_PROFILING

            FindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, 0, 0, true);
#if TRI_COLLISION_PROFILING
            BulletGlobals.StopProfile();
#endif //TRI_COLLISION_PROFILING
        }