SkinnedModelAnimationInfoReader.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // SkinnedModelAnimationInfoReader.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using System.Collections.Generic;
  12. using Microsoft.Xna.Framework;
  13. using Microsoft.Xna.Framework.Content;
  14. using Microsoft.Xna.Framework.Graphics;
  15. using TRead = MovipaLibrary.SkinnedModelAnimationInfo;
  16. #endregion
  17. namespace MovipaLibrary
  18. {
  19. /// <summary>
  20. /// This class restores the xnb file converted by the content pipeline
  21. /// to the value of SkinnedModelAnimationInfoReader.
  22. /// This ContentTypeReader must be the same as the runtime
  23. /// specified in ContentTypeWriter that was used to write the xnb
  24. /// whose type is SkinnedModelAnimationInfoReader.
  25. ///
  26. /// ContentPipelineで変換されたxnbファイルをSkinnedModelAnimationInfoReader�
  27. /// フ値に復元します。 このContentTypeReaderはSkinnedModelAnimationInfoReader�
  28. /// フxnbを書き込む際に使用した ContentTypeWriterで指定されたランタイムと同じで�
  29. /// る必要があります。
  30. /// </summary>
  31. public class SkinnedModelAnimationInfoReader : ContentTypeReader<TRead>
  32. {
  33. /// <summary>
  34. /// Reads SkinnedModelAnimationInfo from the xnb file.
  35. ///
  36. /// xnbファイルからSkinnedModelAnimationInfoを読み込みます。
  37. /// </summary>
  38. protected override TRead Read(ContentReader input, TRead existingInstance)
  39. {
  40. TRead info = new TRead();
  41. // Reads AnimationInfo.
  42. //
  43. // AnimationInfoを読み込みます。
  44. AnimationInfoReader.ReadAnimationInfo(input, info);
  45. // Reads SkinnedModelAnimationInfo.
  46. //
  47. // SkinnedModelAnimationInfoを読み込みます。
  48. info.SkinnedModelInfoCollection.AddRange(
  49. input.ReadObject<List<SkinnedModelInfo>>());
  50. info.CameraUpVector = input.ReadObject<Vector3>();
  51. info.CameraPosition = input.ReadObject<Vector3>();
  52. info.CameraLookAt = input.ReadObject<Vector3>();
  53. return info;
  54. }
  55. }
  56. }