public M2PortraitRenderer(M2File model) { Model = model; Textures = model.TextureInfos.ToArray(); mAnimationMatrices = new Matrix[model.GetNumberOfBones()]; Animator = ModelFactory.Instance.CreateAnimator(model); Animator.SetAnimation(AnimationType.Stand); Animator.Update(null); }
public M2SingleRenderer(M2File model) { mModel = model; if (model.NeedsPerInstanceAnimation) { mAnimationMatrices = new Matrix[model.GetNumberOfBones()]; mAnimator = ModelFactory.Instance.CreateAnimator(model); if (mAnimator.SetAnimation(AnimationType.Stand) == false) { mAnimator.SetAnimationByIndex(0); } } }
public M2Renderer(M2File model) { Model = model; VisibleInstances = new List <M2RenderInstance>(); if (!model.NeedsPerInstanceAnimation) { mAnimationMatrices = new Matrix[model.GetNumberOfBones()]; Animator = ModelFactory.Instance.CreateAnimator(model); if (Animator.SetAnimation(AnimationType.Stand) == false) { Animator.SetAnimationByIndex(0); } StaticAnimationThread.Instance.AddAnimator(Animator); } mBatchRenderer = new M2BatchRenderer(model); mSingleRenderer = new M2SingleRenderer(model); mPortraitRenderer = new M2PortraitRenderer(model); }