InteractionTracker.TryUpdatePositionBy Method
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.
Overloads
TryUpdatePositionBy(Vector3) |
Tries to adjust the InteractionTracker's position by the specified amount. The TryUpdatePositionBy method updates the current location of InteractionTracker by the Vector3 delta specified as a parameter. Similarly to TryUpdatePosition, TryUpdatePositionBy is used to declaratively move InteractionTracker by a defined delta without the need of an animation or Inertia. TryUpdatePositionBy can be called from either the Idle, CustomAnimation or Inertia state – doing so will move the position of InteractionTracker by the defined delta and enter the idle state. |
TryUpdatePositionBy(Vector3, InteractionTrackerClampingOption) |
Tries to adjust the position of the InteractionTracker by the specified amount using the specified clamping option. |
TryUpdatePositionBy(Vector3)
Tries to adjust the InteractionTracker's position by the specified amount.
The TryUpdatePositionBy method updates the current location of InteractionTracker by the Vector3 delta specified as a parameter. Similarly to TryUpdatePosition, TryUpdatePositionBy is used to declaratively move InteractionTracker by a defined delta without the need of an animation or Inertia. TryUpdatePositionBy can be called from either the Idle, CustomAnimation or Inertia state – doing so will move the position of InteractionTracker by the defined delta and enter the idle state.
public:
virtual int TryUpdatePositionBy(float3 amount) = TryUpdatePositionBy;
int TryUpdatePositionBy(float3 const& amount);
public int TryUpdatePositionBy(Vector3 amount);
function tryUpdatePositionBy(amount)
Public Function TryUpdatePositionBy (amount As Vector3) As Integer
Parameters
Returns
int
Returns the request ID. On state transitions, the request which caused the change in state will be included in the args. These IDs will start at 1 and increase with each try call during the lifetime of the application.
Examples
public void InertiaStateEntered(InteractionTracker sender, InteractionTrackerInertiaStateEnteredArgs args)
{
// For sample purpose, will overwrite Inertia motion definitions by moving InteractionTracker to a specified position based on a delta
_tracker.TryUpdatePositionBy(new Vector3(50f));}
}
Remarks
If InteractionTracker is in its Interacting State (user actively manipulating), and TryUpdatePositionBy is called, the system will ignore this request – an event gets fired when this occurs that can be listened for. If sent from one of the other states, listen for the event fired for IdleStateEntered and check the RequestId property that identifies which request triggered the callback. The table below summarizes the expected behavior when this method is called in a particular state:
Current State | Outcome |
---|---|
Idle | Property updates to requested value, no state changes |
Interacting | Request ignored |
Inertia | Property updates to requested value, state changes to Idle |
CustomAnimation | Property updates to requested value, state changes to Idle |
Applies to
TryUpdatePositionBy(Vector3, InteractionTrackerClampingOption)
Tries to adjust the position of the InteractionTracker by the specified amount using the specified clamping option.
public:
virtual int TryUpdatePositionBy(float3 amount, InteractionTrackerClampingOption option) = TryUpdatePositionBy;
/// [Windows.Foundation.Metadata.Overload("TryUpdatePositionByWithOption")]
int TryUpdatePositionBy(float3 const& amount, InteractionTrackerClampingOption const& option);
[Windows.Foundation.Metadata.Overload("TryUpdatePositionByWithOption")]
public int TryUpdatePositionBy(Vector3 amount, InteractionTrackerClampingOption option);
function tryUpdatePositionBy(amount, option)
Public Function TryUpdatePositionBy (amount As Vector3, option As InteractionTrackerClampingOption) As Integer
Parameters
A value that specifies how values are clamped to the maximum and minimum.
Returns
int
Returns the request ID. On state transitions, the request which caused the change in state will be included in the args. These IDs will start at 1 and increase with each try call during the lifetime of the application.
- Attributes
Windows requirements
Device family |
Windows 10, version 1809 (introduced in 10.0.17763.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v7.0)
|