編輯

共用方式為


ConstantViewSize Class

Definition

ConstantViewSize solver scales to maintain a constant size relative to the view (currently tied to the Camera)

public ref class ConstantViewSize : Microsoft::MixedReality::Toolkit::Utilities::Solvers::Solver
[UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/ConstantViewSize")]
public class ConstantViewSize : Microsoft.MixedReality.Toolkit.Utilities.Solvers.Solver
[<UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/ConstantViewSize")>]
type ConstantViewSize = class
    inherit Solver
Public Class ConstantViewSize
Inherits Solver
Inheritance
UnityEngine.MonoBehaviour
ConstantViewSize
Attributes
UnityEngine.AddComponentMenuAttribute

Constructors

ConstantViewSize()

Fields

SolverHandler

The handler reference for this solver that's attached to this GameObject

(Inherited from Solver)

Properties

CurrentDistancePercent

0 to 1 between MinDistance and MaxDistance. If current is less than max, object is potentially on a surface [or some other condition like interpolating] (since it may still be on surface, but scale percent may be clamped at max). This value is subject to inaccuracies due to smoothing/interpolation/momentum.

CurrentScalePercent

0 to 1 between MinScale and MaxScale. If current is less than max, then scaling is being applied. This value is subject to inaccuracies due to smoothing/interpolation/momentum.

FovScale

Returns the scale to be applied based on the FOV. This scale will be multiplied by distance as part of the final scale calculation, so this is the ratio of vertical fov to distance.

GoalPosition

The final position to be attained

(Inherited from Solver)
GoalRotation

The final rotation to be attained

(Inherited from Solver)
GoalScale

The final scale to be attained

(Inherited from Solver)
ManualObjectSize

Overrides auto size calculation with provided manual size. If 0, solver calculates size

MaxDistance

If the object is farther than MaxDistance, the distance used is clamped here

MaxScale

Maximum scale value possible (world space scale)

MinDistance

If the object is closer than MinDistance, the distance used is clamped here

MinScale

Minimum scale value possible (world space scale)

MoveLerpTime

If 0, the position will update immediately. Otherwise, the greater this attribute the slower the position updates

(Inherited from Solver)
RotateLerpTime

If 0, the rotation will update immediately. Otherwise, the greater this attribute the slower the rotation updates")]

(Inherited from Solver)
ScaleBuffer

Used for dead zone for scaling

ScaleLerpTime

If 0, the scale will update immediately. Otherwise, the greater this attribute the slower the scale updates

(Inherited from Solver)
ScaleState
Smoothing

If true, updates are smoothed to the target. Otherwise, they are snapped to the target

(Inherited from Solver)
TargetViewPercentV

The object take up this percent vertically in our view (not technically a percent use 0.5 for 50%)

UpdateLinkedTransform

If true, the position and orientation will be calculated, but not applied, for other components to use

(Inherited from Solver)
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

(Inherited from Solver)
WorkingRotation

Rotation version of WorkingPosition

(Inherited from Solver)
WorkingScale

Scale version of WorkingPosition

(Inherited from Solver)

Methods

AddOffset(Vector3)

Add an offset position to the target goal position.

(Inherited from Solver)
Awake() (Inherited from Solver)
OnDestroy() (Inherited from Solver)
OnEnable()

Typically when a solver becomes enabled, it should update its internal state to the system, in case it was disabled far away

(Inherited from Solver)
RecalculateBounds()

Attempts to calculate the size of the bounds which contains all child renderers for attached GameObject. This information is used in the core solver calculations

SnapGoalTo(Vector3, Quaternion, Vector3)

SnapGoalTo only sets the goal orientation. Not really useful.

(Inherited from Solver)
SnapGoalTo(Vector3, Quaternion)
Obsolete.

SnapGoalTo only sets the goal orientation. Not really useful.

(Inherited from Solver)
SnapTo(Vector3, Quaternion, Vector3)

Snaps the solver to the desired pose.

(Inherited from Solver)
SnapTo(Vector3, Quaternion)
Obsolete.

Snaps the solver to the desired pose.

(Inherited from Solver)
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

(Inherited from Solver)
Start()
UpdateTransformToGoal()

Updates all object orientations to the goal orientation for this solver, with smoothing accounted for (smoothing may be off)

(Inherited from Solver)
UpdateWorkingPositionToGoal()

Updates only the working position to goal with smoothing, if enabled

(Inherited from Solver)
UpdateWorkingRotationToGoal()

Updates only the working rotation to goal with smoothing, if enabled

(Inherited from Solver)
UpdateWorkingScaleToGoal()

Updates only the working scale to goal with smoothing, if enabled

(Inherited from Solver)
UpdateWorkingToGoal()

Updates the Working orientation (which may be the object, or the shared orientation) to the goal with smoothing, if enabled

(Inherited from Solver)

Applies to