コード例 #1
0
ファイル: ModelRenderBuffers.cs プロジェクト: pdjonov/x42view
        public ModelRenderBuffers( Scene scene, Libx42.Model model )
            : base(scene.GetService<IGraphicsDeviceService>())
        {
            if( model == null )
                throw new ArgumentNullException( "model" );

            Libx42.AnimationFlags flags = Libx42.AnimationFlags.None;

            if( model.HasNormalData )
                flags |= Libx42.AnimationFlags.IncludeNormals;

            if( model.HasTangentBasisData )
            {
                flags |= Libx42.AnimationFlags.IncludeNormals;
                flags |= Libx42.AnimationFlags.IncludeTangentBasis;
            }

            this.model = model;
            this.animBuf = model.CreateAnimationBuffer( flags );
        }
コード例 #2
0
ファイル: ModelRenderHelper.cs プロジェクト: pdjonov/x42view
        private void CreateModelObjects()
        {
            if( Site.DesignMode )
                //don't slow VS down
                return;

            if( model == null || model.Model == null )
                return;

            Libx42.Model m = model.Model;

            pose = m.CreatePose();
            UpdatePose();

            Libx42.AnimationFlags flags = Libx42.AnimationFlags.None;

            if( m.HasNormalData )
                flags |= Libx42.AnimationFlags.IncludeNormals;

            if( m.HasTangentBasisData )
            {
                flags |= Libx42.AnimationFlags.IncludeNormals;
                flags |= Libx42.AnimationFlags.IncludeTangentBasis;
            }

            animBuf = m.CreateAnimationBuffer( flags );
            animBuf.AnimateVertices( pose );

            CreateDeviceObjects();
        }