Solver Class
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.
The base abstract class for all Solvers to derive from. It provides state tracking, smoothing parameters and implementation, automatic solver system integration, and update order. Solvers may be used without a link, as long as updateLinkedTransform is false.
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/ux-building-blocks/solvers/solver")]
[UnityEngine.RequireComponent(typeof(MixedReality.Toolkit.SpatialManipulation.SolverHandler))]
public abstract class Solver : UnityEngine.MonoBehaviour
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/ux-building-blocks/solvers/solver")>]
[<UnityEngine.RequireComponent(typeof(MixedReality.Toolkit.SpatialManipulation.SolverHandler))>]
type Solver = class
inherit MonoBehaviour
Public MustInherit Class Solver
Inherits MonoBehaviour
- Inheritance
-
UnityEngine.MonoBehaviourSolver
- Derived
- Attributes
-
UnityEngine.HelpURLAttribute UnityEngine.RequireComponentAttribute
Constructors
| Name | Description |
|---|---|
| Solver() | |
Fields
| Name | Description |
|---|---|
| SolverHandler |
The handler reference for this solver that's attached to this GameObject |
Properties
| Name | Description |
|---|---|
| ControllerLookup |
Get the ControllerLookup that will be used all application Solver objects. |
| GoalPosition |
The final position to be attained |
| GoalRotation |
The final rotation to be attained |
| GoalScale |
The final scale to be attained |
| MoveLerpTime |
If 0, the position will update immediately. Otherwise, the greater this attribute the slower the position updates |
| RotateLerpTime |
If 0, the rotation will update immediately. Otherwise, the greater this attribute the slower the rotation updates")] |
| ScaleLerpTime |
If 0, the scale will update immediately. Otherwise, the greater this attribute the slower the scale updates |
| Smoothing |
If true, updates are smoothed to the target. Otherwise, they are snapped to the target |
| UpdateLinkedTransform |
If true, the position and orientation will be calculated, but not applied, for other components to use |
| WorkingPosition |
Automatically uses the shared position if the solver is set to use the 'linked transform'. UpdateLinkedTransform may be set to false, and a solver will automatically update the object directly, and not inherit work done by other solvers to the shared position |
| WorkingRotation |
Rotation version of WorkingPosition |
| WorkingScale |
Scale version of WorkingPosition |
Methods
| Name | Description |
|---|---|
| AddOffset(Vector3) |
Add an offset position to the target goal position. |
| Awake() |
A Unity event function that is called when an enabled script instance is being loaded. |
| OnDisable() |
A Unity event function that is called when the script component has been disabled. |
| OnEnable() |
A Unity event function that is called when the script component has been enabled. |
| SmoothTo(Quaternion, Quaternion, Single, Single) |
Slerps Quaternion source to goal, handles lerpTime of 0 |
| SmoothTo(Vector3, Vector3, Single, Single) |
Lerps Vector3 source to goal. |
| SnapGoalTo(Vector3, Quaternion, Vector3) |
SnapGoalTo only sets the goal orientation. Not really useful. |
| SnapTo(Vector3, Quaternion, Vector3) |
Snaps the solver to the desired pose. |
| SolverUpdate() |
Should be implemented in derived classes, but Solver can be used to flush shared transform to real transform |
| SolverUpdateEntry() |
Tracks lifetime of the solver, disabling it when expired, and finally runs the orientation update logic |
| Start() |
A Unity event function that is called on the frame when a script is enabled just before any of the update methods are called the first time. |
| UpdateTransformToGoal() |
Updates all object orientations to the goal orientation for this solver, with smoothing accounted for (smoothing may be off) |
| UpdateWorkingPositionToGoal() |
Updates only the working position to goal with smoothing, if enabled |
| UpdateWorkingRotationToGoal() |
Updates only the working rotation to goal with smoothing, if enabled |
| UpdateWorkingScaleToGoal() |
Updates only the working scale to goal with smoothing, if enabled |
| UpdateWorkingToGoal() |
Updates the Working orientation (which may be the object, or the shared orientation) to the goal with smoothing, if enabled |