InertiaRotationBehavior2D.DesiredRotation Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the desired rotation, in radians.
public:
property float DesiredRotation { float get(); void set(float value); };
public float DesiredRotation { get; set; }
member this.DesiredRotation : single with get, set
Public Property DesiredRotation As Single
Property Value
The desired rotation, in radians.
Examples
In the following example, the DesiredRotation property is set to enable inertia processing to rotate an object three-and-one-half times from its starting orientation.
#region SetDesiredRotation
// PI * 2 radians = 360 degrees.
inertiaProcessor.RotationBehavior.DesiredRotation = (float)Math.PI * 7.0f;
#endregion
Remarks
This property represents the desired ending rotation of the inertia operation. This property value is mutually exclusive with the DesiredDeceleration property; setting this property will set DesiredDeceleration to NaN
. The default value for both this property and DesiredDeceleration is NaN
. You must set one or the other property before inertia processing starts.
DesiredRotation must be a finite, non-negative number. The direction of rotation is determined by the InitialVelocity property.
This property cannot be set while the inertia processor is running; otherwise, an exception is thrown.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈