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); }
public static void Cleanup(MyMultiTransformStrategy strategy) { strategy.SetCoreMatrix(MatrixD.Identity); }