Microsoft.Xna.Framework.MathHelper.ToRadians C# (CSharp) Method

ToRadians() public static method

public static ToRadians ( float degrees ) : float
degrees float
return float
        public static float ToRadians(float degrees)
        {
            return degrees * 0.0174532924f;
        }
        public static float ToDegrees(float radians)

Usage Example

Esempio n. 1
0
        public WpRagdollSample(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            GraphicsScreen.ClearBackground = true;
            GraphicsScreen.BackgroundColor = Color.CornflowerBlue;

            // Set a fixed camera.
            var projection = new PerspectiveProjection();

            projection.SetFieldOfView(
                MathHelper.ToRadians(30),
                GraphicsService.GraphicsDevice.Viewport.AspectRatio,
                1f,
                100.0f);
            Vector3F cameraTarget   = new Vector3F(0, 1, 0);
            Vector3F cameraPosition = new Vector3F(0, 12, 0);
            Vector3F cameraUpVector = new Vector3F(0, 0, -1);

            GraphicsScreen.CameraNode = new CameraNode(new Camera(projection))
            {
                View = Matrix44F.CreateLookAt(cameraPosition, cameraTarget, cameraUpVector),
            };

            InitializePhysics();
        }
All Usage Examples Of Microsoft.Xna.Framework.MathHelper::ToRadians