当前位置: 首页>>代码示例>>C#>>正文


C# Radian类代码示例

本文整理汇总了C#中Radian的典型用法代码示例。如果您正苦于以下问题:C# Radian类的具体用法?C# Radian怎么用?C# Radian使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Radian类属于命名空间,在下文中一共展示了Radian类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestExplicitOperator

        public void TestExplicitOperator()
        {
            var rad = new Radian(1.0f);

              Assert.AreEqual((Radian)1.0f, rad);
              Assert.AreEqual(1.0f, (float)rad);
        }
开发者ID:pengyancai,项目名称:cs-util,代码行数:7,代码来源:Radian.cs

示例2: SetCameraOrientation

 public virtual void SetCameraOrientation(Radian roll, Radian yaw, Radian pitch)
 {
     _lastOrientation = new Quaternion(roll, Vector3.UNIT_Z)
         * new Quaternion(yaw, Vector3.UNIT_Y)
         * new Quaternion(pitch, Vector3.UNIT_X);
     CameraOrientation = _lastOrientation;
 }
开发者ID:andyhebear,项目名称:Mccs,代码行数:7,代码来源:FixedCameraMode.cs

示例3: MakeOrthoMatrix

		public override void MakeOrthoMatrix( Radian fovy, Real aspectRatio, Real near, Real far, out Matrix4 dest,
		                                      bool forGpuPrograms )
		{
			var thetaY = fovy/2.0f;
			var tanThetaY = Utility.Tan( thetaY );
			var tanThetaX = tanThetaY*aspectRatio;

			var half_w = tanThetaX*near;
			var half_h = tanThetaY*near;

			var iw = 1.0f/( half_w );
			var ih = 1.0f/( half_h );
			Real q = 0.0f;

			if ( far != 0 )
			{
				q = 1.0/( far - near );
			}

			dest = Matrix4.Zero;
			dest.m00 = iw;
			dest.m11 = ih;
			dest.m22 = q;
			dest.m23 = -near/( far - near );
			dest.m33 = 1;

			if ( forGpuPrograms )
			{
				dest.m22 = -dest.m22;
			}
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:31,代码来源:D3D9RenderSystem.Matrix.cs

示例4: MakeOrthoMatrix

        public override void MakeOrthoMatrix(Radian fov, Real aspectRatio, Real near, Real far, out Matrix4 dest, bool forGpuPrograms)
        {
            float thetaY = Utility.DegreesToRadians(fov / 2.0f);
            float tanThetaY = Utility.Tan(thetaY);
            float tanThetaX = tanThetaY * aspectRatio;

            float halfW = tanThetaX * near;
            float halfH = tanThetaY * near;

            var w = 1.0f / (halfW);
            var h = 1.0f / (halfH);
            var q = 0.0f;

            if (far != 0)
            {
                q = 1.0f / (far - near);
            }

            dest = Matrix4.Zero;
            dest.m00 = w;
            dest.m11 = h;
            dest.m22 = q;
            dest.m23 = -near / (far - near);
            dest.m33 = 1;

            if (forGpuPrograms)
            {
                dest.m22 = -dest.m22;
            }
        }
开发者ID:WolfgangSt,项目名称:axiom,代码行数:30,代码来源:D3DRenderSystem.Matrix.cs

示例5: SphericCameraMode

        /**
         * @param relativePositionToCameraTarget Default camera position with respecto to camera target
         * @param autoResetTime If greater than zero the camera will be resetted to its initial position after the amount of seconds specified.
         * @param resetDistance true for correcting the camera distance to the target when resetting. If false, the camera will maintaing the current distance to target.
         * @param resetRotationFactor Speed factor for correcting the camera rotation when resetting.
         * @param offset Offset applied to the center of the sphere.
         */
        public SphericCameraMode(CameraControlSystem cam
             , Vector3 relativePositionToCameraTarget
             , float outerSphereRadius
            , Vector3 offset
             , Vector3 fixedAxis, float innerSphereRadius = 0.0f
             , float autoResetTime = 3.0f
             , bool resetDistance = true
             , float resetRotationFactor = 1.0f)
            : base(cam)
        {
            _relativePositionToCameraTarget = relativePositionToCameraTarget;
            _outerSphereRadius = outerSphereRadius;
            _innerSphereRadius = innerSphereRadius;
            _autoResetTime = autoResetTime;
            _resetDistance = resetDistance;
            _resetRotationFactor = resetRotationFactor;
            _offset = offset;
            _fixedAxis = fixedAxis;
            _resseting = false;
            _LastRessetingDiff = new Radian(2.0f * Mogre.Math.PI);

            if (innerSphereRadius > outerSphereRadius) { throw new Exception("Inner radious greater than outer radious"); }
            if (innerSphereRadius > relativePositionToCameraTarget.Length
                || outerSphereRadius < relativePositionToCameraTarget.Length) {
                throw new Exception("relativePositionToCameraTarget param value not valid.");
            }
        }
开发者ID:andyhebear,项目名称:Mccs,代码行数:34,代码来源:SphericCameraMode.cs

示例6: Euler

 /// <summary>
 /// Constructor to create a new Euler Angle struct from angle values. 
 /// The rotation will be applied in the order Yaw-Pitch- Roll, which are related to the axis order Y-X-Z. 
 /// </summary>
 public Euler(Radian yaw, Radian pitch, Radian roll)
 {
     mYaw = yaw;
     mPitch = pitch;
     mRoll = roll;
     mChanged = true;
     mCachedQuaternion = Quaternion.IDENTITY;
 }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:12,代码来源:Euler.cs

示例7: CreateRotater

        /// <summary>
        /// Creates a Rotater. This removes any existing nlerpers and rotaters attached to the lthing.
        /// </summary>
        /// <param name="owner">What lthing are we affecting?</param>
        /// <param name="duration">How long as we going to rotate?</param>
        /// <param name="angle">Rotation angle</param>
        /// <param name="mode">Rotation axis mode</param>
        /// <returns>The new rotater</returns>
        public Rotater CreateRotater(LThing owner, float duration, Radian angle, RotaterAxisMode mode)
        {
            RemoveRotater(owner);

            Rotater newRotater = new Rotater(owner, duration, angle, mode);
            Rotaters.TryAdd(owner, newRotater);
            return newRotater;
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:16,代码来源:LThingHelperManager.cs

示例8: OrbitalWithMouseCameraMode

 public OrbitalWithMouseCameraMode(CameraControlSystem cam
      , MOIS.MouseButtonID activateButton
      , Radian initialHorizontalRotation
      , Radian initialVerticalRotation, float initialZoom = 1)
     : base(cam, initialHorizontalRotation, initialVerticalRotation, initialZoom)
 {
     _activateButton = activateButton;
 }
开发者ID:andyhebear,项目名称:Mccs,代码行数:8,代码来源:OrbitalWithMouseCameraMode.cs

示例9: Sprite

 public Sprite(Texture texture)
 {
     Texture = texture;
     Color = Color.White;
     Position = Vector2.Zero;
     Scale = new Vector2(1.0f, 1.0f);
     Rotation = new Radian(0.0f);
     SourceRect = new Rectangle(0, 0, Texture.Width, Texture.Height);
 }
开发者ID:HaKDMoDz,项目名称:Irelia,代码行数:9,代码来源:Sprite.cs

示例10: TestEquatable

        public void TestEquatable()
        {
            var rad = new Radian(1.0f);
              var f = 1.0f;

              Assert.IsTrue(rad.Equals(rad));
              Assert.IsTrue(rad.Equals(f));
              Assert.IsFalse(rad.Equals(null));
        }
开发者ID:pengyancai,项目名称:cs-util,代码行数:9,代码来源:Radian.cs

示例11: SetDesiredVelocity

			public override void SetDesiredVelocity( Radian velocity, float maxTorque )
			{
				if( joint.jointID == dJointID.Zero )
					return;

				Ode.dJointSetHingeParam( joint.jointID, Ode.dJointParams.dParamVel,
					joint.Body1.Static ? velocity : -velocity );
				Ode.dJointSetHingeParam( joint.jointID, Ode.dJointParams.dParamFMax, maxTorque );
			}
开发者ID:whztt07,项目名称:SDK,代码行数:9,代码来源:ODEHingeJoint.cs

示例12: Update

        public override void Update(int elapsed)
        {
            float rotateFactor = elapsed * 0.125f / 1000.0f;
            var yawAmount = new Radian((0.4f + 0.25f * MathUtils.Sin(new Radian(this.game.TotalGameTime / 15040))) * rotateFactor);
            Yaw(yawAmount);
            var pitchAmount = new Radian((0.35f + 0.212f * MathUtils.Cos(new Radian(this.game.TotalGameTime / 38040))) * rotateFactor);

            float moveFactor = elapsed * 27.5f / 1000.0f;
            MoveRelative(Vector3.UnitZ * moveFactor);
        }
开发者ID:HaKDMoDz,项目名称:Irelia,代码行数:10,代码来源:RoamingCamera.cs

示例13: SetCameraRelativePosition

        public virtual void SetCameraRelativePosition(Vector3 posRelativeToCameraTarget
            , Radian roll, Radian yaw, Radian pitch)
        {
            RelativePosToTarget = posRelativeToCameraTarget;

            _rotationOffset = new Quaternion(roll, Vector3.UNIT_Z)
                            * new Quaternion(yaw, Vector3.UNIT_Y)
                            * new Quaternion(pitch, Vector3.UNIT_X);

            InstantUpdate();
        }
开发者ID:andyhebear,项目名称:Mccs,代码行数:11,代码来源:ChaseFreeYawAxisCameraMode.cs

示例14: Rotate

        protected override void Rotate(Radian yawAngle, Radian pitchAngle)
        {
            base.Rotate(yawAngle,pitchAngle);

            var debugOverlay = OverlayManager.Singleton.GetByName("Core/DebugOverlay");
            debugOverlay.Show();

            var myCurr = OverlayManager.Singleton.GetOverlayElement("Core/CurrFps");

            myCurr.Caption = State.CameraManager.RenderWindow.LastFPS.ToString();
        }
开发者ID:crescent,项目名称:SubmarineSim3D,代码行数:11,代码来源:FreeControlState.cs

示例15: Rotater

        /// <summary>
        /// USE THE LThingHelperManager FOR THIS!
        /// </summary>
        public Rotater(LThing thingToRotate, float duration, Radian angle, Vector3 axis, RotaterAxisMode mode = RotaterAxisMode.Explicit)
        {
            this.thing = thingToRotate;
            this.duration = duration;
            this.angle = angle;
            this.axis = axis;
            this.mode = mode;

            orient = new Quaternion();

            PhysicsMain.PreSimulate += PreSimulate;
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:15,代码来源:Rotater.cs


注:本文中的Radian类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。