//struct CreateFunc :public     btCollisionAlgorithmCreateFunc
        //{
        //    virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
        //    {
        //        void* mem = ci.m_dispatcher1.allocateCollisionAlgorithm(sizeof(btGImpactCollisionAlgorithm));
        //        return new(mem) btGImpactCollisionAlgorithm(ci,body0,body1);
        //    }
        //};

        //! Use this function for register the algorithm externally
        public static void RegisterAlgorithm(CollisionDispatcher dispatcher)
        {
            GImpactCreateFunc s_gimpact_cf = new GImpactCreateFunc();

            int i;

            for (i = 0; i < (int)BroadphaseNativeTypes.MAX_BROADPHASE_COLLISION_TYPES; i++)
            {
                dispatcher.RegisterCollisionCreateFunc((int)BroadphaseNativeTypes.GIMPACT_SHAPE_PROXYTYPE, i, s_gimpact_cf);
            }

            for (i = 0; i < (int)BroadphaseNativeTypes.MAX_BROADPHASE_COLLISION_TYPES; i++)
            {
                dispatcher.RegisterCollisionCreateFunc(i, (int)BroadphaseNativeTypes.GIMPACT_SHAPE_PROXYTYPE, s_gimpact_cf);
            }
        }
        //struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
        //{
        //    virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
        //    {
        //        void* mem = ci.m_dispatcher1.allocateCollisionAlgorithm(sizeof(btGImpactCollisionAlgorithm));
        //        return new(mem) btGImpactCollisionAlgorithm(ci,body0,body1);
        //    }
        //};

        //! Use this function for register the algorithm externally
        public static void RegisterAlgorithm(CollisionDispatcher dispatcher)
        {
            GImpactCreateFunc s_gimpact_cf = new GImpactCreateFunc();

            int i;

            for (i = 0; i < (int)BroadphaseNativeTypes.MAX_BROADPHASE_COLLISION_TYPES; i++)
            {
                dispatcher.RegisterCollisionCreateFunc((int)BroadphaseNativeTypes.GIMPACT_SHAPE_PROXYTYPE, i, s_gimpact_cf);
            }

            for (i = 0; i < (int)BroadphaseNativeTypes.MAX_BROADPHASE_COLLISION_TYPES; i++)
            {
                dispatcher.RegisterCollisionCreateFunc(i, (int)BroadphaseNativeTypes.GIMPACT_SHAPE_PROXYTYPE, s_gimpact_cf);
            }

        }