Exemple #1
0
        public Quaternion(Angles3 angles)
        {
            float sx, cx;

            MathHelpers.SinCos(angles.x * 0.5f, out sx, out cx);
            float sy, cy;

            MathHelpers.SinCos(angles.y * 0.5f, out sy, out cy);
            float sz, cz;

            MathHelpers.SinCos(angles.z * 0.5f, out sz, out cz);
            _w = cx * cy * cz + sx * sy * sz;

            _v = new Vector3(cz * cy * sx - sz * sy * cx,
                             cz * sy * cx + sz * cy * sx,
                             sz * cy * cx - cz * sy * sx);
        }
Exemple #2
0
 /// <summary>
 /// x=yaw
 /// y=pitch
 /// z=roll (we ignore this element, since its not possible to convert the roll-component into a vector)
 /// </summary>
 /// <param name="ypr"></param>
 /// <returns></returns>
 public static Vector3 CreateViewdir(Angles3 ypr)
 {
     return(CCamera.CreateViewdir(ypr));
 }
Exemple #3
0
 /// <summary>
 /// This function builds a 3x3 orientation matrix using YPR-angles, and converts it to a Matrix3x4
 /// Rotation order for the orientation-matrix is Z-X-Y. (Zaxis=YAW / Xaxis=PITCH / Yaxis=ROLL)
 /// COORDINATE-SYSTEM
 /// z-axis
 ///  ^
 ///  |
 ///  |  y-axis
 ///  |  /
 ///  | /
 ///  |/
 ///  +--------------->   x-axis
 /// </summary>
 /// <param name="ypr"></param>
 /// <returns></returns>
 public static Matrix3x4 CreateOrientationYPR(Angles3 ypr)
 {
     return(new Matrix34(CCamera.CreateOrientationYPR(ypr)));
 }
Exemple #4
0
        // TODO Wrap SViewParams in a managed struct
        //public void SetCurrentParams (SViewParams arg0);

        /// <summary>
        /// Set the additive camera angles for this <see cref="View"/>.
        /// </summary>
        /// <param name="addFrameAngles">Add frame angles.</param>
        public void SetFrameAdditiveCameraAngles(Angles3 addFrameAngles)
        {
            NativeHandle.SetFrameAdditiveCameraAngles(addFrameAngles);
        }
Exemple #5
0
 /// <summary>
 /// Set new shake parameters for a new or existing shake on this <see cref="View"/>.
 /// </summary>
 /// <param name="shakeAngle">The angle the view will shake to.</param>
 /// <param name="shakeShift">The direction and magnitude of the shake.</param>
 /// <param name="duration">Duration of the full shake.</param>
 /// <param name="frequency">The time it takes for a single oscilation to complete.</param>
 /// <param name="randomness">Amount of randomness that's added to the shake direction and angle.</param>
 /// <param name="shakeId">ID of the Shake. If a shake with this ID already exists, it will be adjusted with the new parameters, otherwise a new shake is created.</param>
 /// <param name="flipVector">If set to <c>true</c> the direction and angle of the shake will be flipped after each oscilation.</param>
 /// <param name="updateOnly">If set to <c>true</c> this will only update an existing shake.</param>
 public void SetViewShake(Angles3 shakeAngle, Vector3 shakeShift, float duration, float frequency, float randomness, int shakeId, bool flipVector, bool updateOnly)
 {
     NativeHandle.SetViewShake(shakeAngle, shakeShift, duration, frequency, randomness, shakeId, flipVector, updateOnly);
 }
Exemple #6
0
 /// <summary>
 /// Set new shake parameters for a new or existing shake on this <see cref="View"/>.
 /// </summary>
 /// <param name="shakeAngle">The angle the view will shake to.</param>
 /// <param name="shakeShift">The direction and magnitude of the shake.</param>
 /// <param name="duration">Duration of the full shake.</param>
 /// <param name="frequency">The time it takes for a single oscilation to complete.</param>
 /// <param name="randomness">Amount of randomness that's added to the shake direction and angle.</param>
 /// <param name="shakeId">ID of the Shake. If a shake with this ID already exists, it will be adjusted with the new parameters, otherwise a new shake is created.</param>
 public void SetViewShake(Angles3 shakeAngle, Vector3 shakeShift, float duration, float frequency, float randomness, int shakeId)
 {
     NativeHandle.SetViewShake(shakeAngle, shakeShift, duration, frequency, randomness, shakeId);
 }
Exemple #7
0
 public static Quaternion CreateRotationXYZ(Angles3 angles)
 {
     return(new Quaternion(angles));
 }
Exemple #8
0
 public Rotation(Vector3 rot)
 {
     _rotation = rot;
 }
Exemple #9
0
 public Rotation()
 {
     _rotation = new Vector3(0, 0, 0);
 }