示例#1
0
        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);
        }
示例#2
0
        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);
                }
            }
        }
示例#3
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);
        }