Esempio n. 1
0
        public static MvdCameraPropertyFrame Parse(MvdCameraPropertyData cpd, BinaryReader br)
        {
            var rt = new MvdCameraPropertyFrame
            {
                FrameTime = br.ReadInt64(),
                Enabled = br.ReadBoolean(),
                Perspective = br.ReadBoolean(),
                Alpha = br.ReadSingle(),
                EffectEnabled = br.ReadBoolean(),
            };

            switch (cpd.MinorType)
            {
                case 0:
                    br.ReadByte();

                    break;
                case 1:
                case 2:
                    rt.DynamicFov = br.ReadBoolean();
                    rt.DynamicFovRate = br.ReadSingle();
                    rt.DynamicFovCoefficent = br.ReadSingle();

                    if (cpd.MinorType == 2)
                    {
                        rt.RelatedModelId = br.ReadInt32();
                        rt.RelatedBoneId = br.ReadInt32();
                    }

                    break;
            }

            return rt;
        }
Esempio n. 2
0
        public static MvdCameraFrame Parse(MvdCameraData cd, BinaryReader br, out MvdCameraPropertyFrame propertyFrame)
        {
            var rt = new MvdCameraFrame
            {
                StageId = br.ReadInt32(),
                FrameTime = br.ReadInt64(),
                Radius = br.ReadSingle(),
                Position = new[] { br.ReadSingle(), br.ReadSingle(), br.ReadSingle() },
                Angle = new[] { br.ReadSingle(), br.ReadSingle(), br.ReadSingle() },
                Fov = br.ReadSingle(),
            };

            propertyFrame = null;

            switch (cd.MinorType)
            {
                case 0:
                    propertyFrame = new MvdCameraPropertyFrame
                    {
                        FrameTime = rt.FrameTime,
                        Perspective = br.ReadBoolean(),
                    };

                    break;
                case 1:
                    propertyFrame = new MvdCameraPropertyFrame
                    {
                        FrameTime = rt.FrameTime,
                        Enabled = br.ReadBoolean(),
                        Perspective = br.ReadBoolean(),
                        Alpha = br.ReadSingle(),
                        EffectEnabled = br.ReadBoolean(),
                    };

                    break;
                case 3:
                    rt.Spline = br.ReadBoolean();
                    br.ReadBytes(3);

                    break;
            }

            rt.PositionInterpolation = new[] { MvdInterpolationPoint.Parse(br), MvdInterpolationPoint.Parse(br) };
            rt.AngleInterpolation = new[] { MvdInterpolationPoint.Parse(br), MvdInterpolationPoint.Parse(br) };
            rt.RadiusInterpolation = new[] { MvdInterpolationPoint.Parse(br), MvdInterpolationPoint.Parse(br) };
            rt.FovInterpolation = new[] { MvdInterpolationPoint.Parse(br), MvdInterpolationPoint.Parse(br) };

            return rt;
        }