Exemplo n.º 1
0
        /// <summary>
        ///		Translates this entity relative to its currently rotation and position.
        /// </summary>
        /// <param name="x">Amount on the x-axis to translate this entity by.</param>
        /// <param name="y">Amount on the y-axis to translate this entity by.</param>
        /// <param name="z">Amount on the z-axis to translate this entity by.</param>
        public void Translate(float x, float y, float z)
        {
            float mx = ((float)Math.Cos(MathMethods.DegreesToRadians(_transformation.AngleX)) * x);
            float my = -((float)Math.Sin(MathMethods.DegreesToRadians(_transformation.AngleY)) * y);

            _transformation.X += my;
            _transformation.Y += mx;
            _transformation.Z += z;
            Transformation     = _transformation;
        }