/// <summary>
        /// Refresh the model references
        /// </summary>
        private void RefreshModel()
        {
            if (this.skinnedModel == null
                || (this.skinnedModel.AssetPath != this.Model.ModelPath))
            {
                if (this.skinnedModel != null)
                {
                    this.skinnedModel.Unload();
                    this.skinnedModel = null;
                }

                if (this.Model.InternalModel != null)
                {
                    this.skinnedModel = this.Model.InternalModel.Clone();
                    Array.Resize(ref this.meshMaterials, this.skinnedModel.Meshes.Count);
                    Array.Resize(ref this.updateVertexBuffer, this.skinnedModel.Meshes.Count);
                }

                this.boneNames.Clear();
            }
        }
        /// <summary>
        /// Releases unmanaged and - optionally - managed resources
        /// </summary>
        /// <param name="disposing">
        /// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                if (disposing)
                {
                    if (this.skinnedModel != null)
                    {
                        this.skinnedModel.Unload();
                        this.skinnedModel = null;
                    }

                    this.disposed = true;
                }
            }
        }
        /// <summary>
        /// Performs further custom initialization for this instance.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            this.boneTransforms = new Matrix[this.Animation.InternalAnimation.BindPose.Count];
            this.worldTransforms = new Matrix[this.Animation.InternalAnimation.BindPose.Count];
            this.skinTransforms = new Matrix[this.Animation.InternalAnimation.BindPose.Count];

            this.skinnedModel = this.Model.InternalModel.Clone();            
        }
示例#4
0
 /// <summary>
 /// Performs further custom initialization for this instance.
 /// </summary>
 protected override void Initialize()
 {
     this.InternalModel = Assets.LoadAsset<InternalSkinnedModel>(this.ModelPath);
     this.BoundingBox = this.InternalModel.BoundingBox;
 }
示例#5
0
        /// <summary>
        /// Performs further custom initialization for this instance.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            this.isHidef = WaveServices.Platform.PlatformProfile == Platform.Profile.HiDef;
            this.boneTransforms = new Matrix[this.Animation.InternalAnimation.BindPose.Count];
            this.worldTransforms = new Matrix[this.Animation.InternalAnimation.BindPose.Count];
            this.skinTransforms = new Matrix[this.Animation.InternalAnimation.BindPose.Count];

            this.skinnedModel = this.Model.InternalModel.Clone();
        }