Exemple #1
0
        public M2AnimationBone(M2File file, ref M2Bone bone, BinaryReader reader)
        {
            Bone      = bone;
            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);
        }
Exemple #2
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);
        }
Exemple #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);
        }
Exemple #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;

            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);
        }
Exemple #5
0
 public M2InterpolateAlpha16AnimationBlock(M2File file, AnimationBlock data, BinaryReader reader, float defaultValue = default(float))
     : base(file, data, reader, defaultValue)
 {
 }
Exemple #6
0
 public M2InvQuaternion16AnimationBlock(M2File file, AnimationBlock data, BinaryReader reader)
     : base(file, data, reader, Quaternion.Identity)
 {
 }
Exemple #7
0
 public M2InvQuaternion16AnimationBlock(M2File file, AnimationBlock data, BinaryReader reader, Quaternion defaultValue = default(Quaternion))
     : base(file, data, reader, defaultValue)
 {
 }
Exemple #8
0
 public M2Vector4AnimationBlock(M2File file, AnimationBlock data, BinaryReader reader, Vector4 defaultValue = default(Vector4))
     : base(file, data, reader, defaultValue)
 {
 }
Exemple #9
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);
 }
Exemple #10
0
 public M2AlphaAnimation(M2File file, ref AnimationBlock transBlock, BinaryReader reader)
 {
     mAlpha = new M2InterpolateAlpha16AnimationBlock(file, transBlock, reader, 1.0f);
 }
Exemple #11
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);
 }