コード例 #1
0
 private CAvatar CheckValid(CAvatar aAvatar)
 {
     if (aAvatar.CheckValid())
     {
         return(aAvatar);
     }
     return(this);
 }
コード例 #2
0
        internal CAvatar RotateZ(float aRadians)
        {
            var a1 = this.AxisAngles;
            var a2 = new Vector3(a1.X, a1.Y, a1.Z + aRadians);
            var a  = new CAvatar(this.Game, this.CamPos, a2);

            return(a);
        }
コード例 #3
0
        // "Absolute" version der Methode "LookLeftRight"
        private CAvatar LookLeftRightAbsolute(float aRadians)
        {
            var a1 = this.AxisAngles;
            var a2 = new Vector3(a1.X, a1.Y + aRadians, a1.Z);
            var a  = new CAvatar(this.Game, this.CamPos, a2);

            return(a);
        }
コード例 #4
0
 internal CAvatar MoveToOffset(Vector3 aMoveVector)
 {
     if (this.AccumulativeIsEnabled)
     {
         var aCamPos    = this.CamPos + aMoveVector;
         var aCamTarget = this.CamTarget + aMoveVector;
         var aAvatar    = new CAvatar(this.Game, aCamPos, aCamTarget, this.UpVector, this.AxisX, this.AxisY);
         return(aAvatar);
     }
     else
     {
         var aNewCameraPosition = this.CamPos + aMoveVector;
         var aAvatar            = new CAvatar(this.Game, aNewCameraPosition, this.AxisAngles);
         return(aAvatar);
     }
 }
コード例 #5
0
        internal static CAvatar Load(CGame aGame)
        {
            var aFileInfo = FileInfo;

            if (aFileInfo.Exists)
            {
                try
                {
                    var aMemoryStream = new MemoryStream(File.ReadAllBytes(aFileInfo.FullName));
                    var aAvatar       = Read(aGame, aMemoryStream);
                    return(aAvatar);
                }
                catch (Exception)
                {
                    return(CAvatar.Default(aGame));
                }
            }
            return(CAvatar.Default(aGame));
        }
コード例 #6
0
        => this;     //throw new NotImplementedException();


        //    => new CAvatar(this.CamPos + this.CamTarget.RotateZ(MathHelper.ToRadians(90)) * new Vector3(aDelta),)

        internal CAvatar MoveAlongViewAngle(float aDistance)
        {
            if (this.AccumulativeIsEnabled)
            {
                var aMoveVector        = this.CamTargetOffset;
                var aLonger            = aMoveVector.MakeLongerDelta(aDistance);
                var aNewCameraPosition = this.CamPos + aLonger;
                var aNewCameraTarget   = this.CamTarget + aLonger;
                var aAvatar            = new CAvatar(this.Game, aNewCameraPosition, aNewCameraTarget, this.UpVector, this.AxisX, this.AxisY);
                return(aAvatar);
            }
            else if (aDistance != 0f)
            {
                var aMoveVector        = this.CamTargetOffset;
                var aLonger            = aMoveVector.MakeLongerDelta(aDistance);
                var aNewCameraPosition = this.CamPos + aLonger;
                var aAvatar            = new CAvatar(this.Game, aNewCameraPosition, this.AxisAngles);
                return(aAvatar);
            }
            else
            {
                return(this);
            }
        }
コード例 #7
0
 protected override void LoadContent()
 {
     this.Avatar = CAvatar.Load(this);
     this.MonoFacade.MonoModels.LoadContent();
     base.LoadContent();
 }