示例#1
0
        public M2Animator(M2File file)
        {
            mHasAnimation    = false;
            mAnimations      = file.Animations;
            mAnimationLookup = file.AnimLookup;

            SetBoneData(file.Bones);
            SetUvData(file.UvAnimations);
            SetTexColorData(file.ColorAnimations);
            SetAlphaData(file.Transparencies);
        }
示例#2
0
        public M2AnimationBone(M2File file, ref M2Bone bone, BinaryReader reader)
        {
            Bone         = bone;
            bone.pivot.Y = -bone.pivot.Y;
            mPivot       = Matrix.Translation(bone.pivot);
            mInvPivot    = Matrix.Translation(-bone.pivot);

            mTranslation = new M2Vector3AnimationBlock(file, bone.translation, reader);
            mRotation    = new M2Quaternion16AnimationBlock(file, bone.rotation, reader, Quaternion.Identity);
            mScaling     = new M2Vector3AnimationBlock(file, bone.scaling, reader, Vector3.One);
        }
示例#3
0
        public M2AnimationBlock(M2File file, AnimationBlock data, BinaryReader reader, TDest defaultValue = default(TDest))
        {
            if (data.globalSequence >= 0 && data.globalSequence < file.GlobalSequences.Length)
            {
                mGlobalSequence    = file.GlobalSequences[data.globalSequence];
                mHasGlobalSequence = true;
            }

            mDefaultValue = defaultValue;
            mFileBlock    = data;

            Load(reader);
        }
示例#4
0
        public M2AnimationBone(M2File file, ref M2Bone bone, BinaryReader reader)
        {
            mBone         = bone;
            IsBillboarded = (bone.flags & 0x08) != 0;  // Some billboards have 0x40 for cylindrical?
            IsTransformed = (bone.flags & 0x200) != 0;

            bone.pivot.Y = -bone.pivot.Y;
            mPivot       = Matrix.Translation(bone.pivot);
            mInvPivot    = Matrix.Translation(-bone.pivot);

            mTranslation = new M2Vector3AnimationBlock(file, bone.translation, reader);
            mRotation    = new M2Quaternion16AnimationBlock(file, bone.rotation, reader, Quaternion.Identity);
            mScaling     = new M2Vector3AnimationBlock(file, bone.scaling, reader, Vector3.One);
        }
示例#5
0
 public M2UVAnimation(M2File file, ref M2TexAnim texAnim, BinaryReader reader)
 {
     mTranslation = new M2Vector3AnimationBlock(file, texAnim.translation, reader);
     mRotation    = new M2InvQuaternion16AnimationBlock(file, texAnim.rotation, reader);
     mScaling     = new M2Vector3AnimationBlock(file, texAnim.scaling, reader, Vector3.One);
 }
示例#6
0
 public M2InterpolateAlpha16AnimationBlock(M2File file, AnimationBlock data, BinaryReader reader, float defaultValue = default(float))
     : base(file, data, reader, defaultValue)
 {
 }
示例#7
0
 public M2InvQuaternion16AnimationBlock(M2File file, AnimationBlock data, BinaryReader reader)
     : base(file, data, reader, Quaternion.Identity)
 {
 }
示例#8
0
 public M2InvQuaternion16AnimationBlock(M2File file, AnimationBlock data, BinaryReader reader, Quaternion defaultValue = default(Quaternion))
     : base(file, data, reader, defaultValue)
 {
 }
示例#9
0
 public M2Vector4AnimationBlock(M2File file, AnimationBlock data, BinaryReader reader, Vector4 defaultValue = default(Vector4))
     : base(file, data, reader, defaultValue)
 {
 }
示例#10
0
 public M2TexColorAnimation(M2File file, ref M2ColorAnim colorAnim, BinaryReader reader)
 {
     mColor = new M2Vector3AnimationBlock(file, colorAnim.color, reader, Vector3.One);
     mAlpha = new M2NoInterpolateAlpha16AnimationBlock(file, colorAnim.alpha, reader, 1.0f);
 }
示例#11
0
 public M2AlphaAnimation(M2File file, ref AnimationBlock transBlock, BinaryReader reader)
 {
     mAlpha = new M2InterpolateAlpha16AnimationBlock(file, transBlock, reader, 1.0f);
 }