Пример #1
0
        public void SetMultiInstancesTransformStrategy(MyInstanceData[] multiInstanceData, int instanceStart, int instancesCount)
        {
            if (m_transformStrategy is MySingleTransformStrategy)
            {
                MySingleTransformStrategy oldStrategy = (MySingleTransformStrategy)m_transformStrategy;
                MyMultiTransformStrategy  newStrategy = MyObjectPoolManager.Allocate <MyMultiTransformStrategy>();
                newStrategy.SetCoreMatrix(m_transformStrategy.GetCoreMatrixD());
                MyObjectPoolManager.Deallocate(oldStrategy);
                m_transformStrategy = newStrategy;
            }

            MyRenderProxy.Assert(m_transformStrategy is MyMultiTransformStrategy);

            MyMultiTransformStrategy multiTranformStrategy = (MyMultiTransformStrategy)m_transformStrategy;

            multiTranformStrategy.SetInstanceData(multiInstanceData, instanceStart, instancesCount);
        }
Пример #2
0
 public static void Cleanup(MyMultiTransformStrategy strategy)
 {
     strategy.SetCoreMatrix(MatrixD.Identity);
 }