API reference

OSPanelTransformer Class

Extends MonoBehaviour
An ITransformer that keeps a panel facing a provided center, typically the user's head, and keeps its apparent (angular) size constant as it is moved nearer to or farther from that center.
This transformer is only meant to be used as part of the Grabbable._oneGrabTransformer using it with more than one grab point does not produce the expected transformation.
The rotation of the grab pose is ignored; only its position is used. The target's forward axis is made radial, which leaves its up axis tangent to the sphere centered on Center, and its scale is made proportional to its radius, which is what holds the angular size fixed. Scale and rotation are applied about the target's own origin and the target is then translated so that the grabbed point of the panel returns to the grab pose, which makes the grab point the effective pivot of both. Nearer than the minimum scale distance, or farther than the maximum, the panel is scaled as if it were at that distance, holding its world size steady instead of its angular size. The result is eased toward over time, so the panel trails the hand slightly rather than tracking it rigidly. Far enough out, and while not too far above or below the center, the panel instead only yaws toward the center so that it stays upright rather than pitching to face it head on, easing between the two across the upright fade ranges.

Properties

FollowSpeed : float
[Get][Set]
How quickly the panel follows the hand, per second.
Zero stays in place, larger values track it more closely.
Signature
float Oculus.Interaction.OSPanelTransformer.FollowSpeed
MaxScaleDistance : float
[Get][Set]
Once the panel is farther from Center than this, it is scaled as if it were at this distance, so it stops growing as it is pushed away.
Signature
float Oculus.Interaction.OSPanelTransformer.MaxScaleDistance
MinScaleDistance : float
[Get][Set]
While the panel is nearer to Center than this, it is scaled as if it were at this distance, so it stops shrinking as it is pulled closer.
Signature
float Oculus.Interaction.OSPanelTransformer.MinScaleDistance
UnitsPerMeter : float
[Get][Set]
The scale the panel should have when it is one meter from Center.
Its height in units at that scale sets the angular size, which is then preserved at every distance. Read when a grab begins, so changes take effect on the next grab.
Signature
float Oculus.Interaction.OSPanelTransformer.UnitsPerMeter
UprightAngleFade : float
[Get][Set]
Angle, in degrees, past UprightHalfAngle over which the panel eases back to facing the center head on.
Zero switches between the two abruptly.
Signature
float Oculus.Interaction.OSPanelTransformer.UprightAngleFade
UprightDistance : float
[Get][Set]
Past this distance from Center the panel stays upright rather than pitching to face the center head on, provided it is also within UprightHalfAngle.
Signature
float Oculus.Interaction.OSPanelTransformer.UprightDistance
UprightDistanceFade : float
[Get][Set]
Distance below UprightDistance over which the panel eases back to facing the center head on.
Zero switches between the two abruptly.
Signature
float Oculus.Interaction.OSPanelTransformer.UprightDistanceFade
UprightHalfAngle : float
[Get][Set]
Half angle, in degrees, of the band around the horizon in which the panel stays upright, measured at Center.
Zero disables the upright region entirely.
Signature
float Oculus.Interaction.OSPanelTransformer.UprightHalfAngle

Methods

BeginTransform ()
Implementation of ITransformer.BeginTransform; for details, please refer to the related documentation provided for that interface.
Signature
void Oculus.Interaction.OSPanelTransformer.BeginTransform()
Returns
void
EndTransform ()
Implementation of ITransformer.EndTransform; for details, please refer to the related documentation provided for that interface.
Signature
void Oculus.Interaction.OSPanelTransformer.EndTransform()
Returns
void
Initialize ( grabbable )
Implementation of ITransformer.Initialize; for details, please refer to the related documentation provided for that interface.
Signature
void Oculus.Interaction.OSPanelTransformer.Initialize(IGrabbable grabbable)
Parameters
grabbable: IGrabbable
Returns
void
InjectAllOSPanelTransformer ( center , panel )
Injects all required dependencies for a dynamically instantiated OSPanelTransformer.
Signature
void Oculus.Interaction.OSPanelTransformer.InjectAllOSPanelTransformer(Transform center, Transform panel)
Parameters
center: Transform
panel: Transform
Returns
void
InjectCenter ( center )
Sets the underlying center Transform for a dynamically instantiated OSPanelTransformer.
Signature
void Oculus.Interaction.OSPanelTransformer.InjectCenter(Transform center)
Parameters
center: Transform
Returns
void
InjectPanel ( panel )
Sets the underlying panel Canvas for a dynamically instantiated OSPanelTransformer.
Signature
void Oculus.Interaction.OSPanelTransformer.InjectPanel(Transform panel)
Parameters
panel: Transform
Returns
void
SetDeltaTimeProvider ( deltaTimeProvider )
Sets a custom provider for the frame delta, in seconds, used to smooth the target toward its solved pose.
This is essential for testing, where Time.deltaTime cannot be controlled.
Signature
void Oculus.Interaction.OSPanelTransformer.SetDeltaTimeProvider(Func< float > deltaTimeProvider)
Parameters
deltaTimeProvider: Func< float >  A function delegate that returns the frame delta in seconds.
Returns
void
UpdateTransform ()
Implementation of ITransformer.UpdateTransform; for details, please refer to the related documentation provided for that interface.
Signature
void Oculus.Interaction.OSPanelTransformer.UpdateTransform()
Returns
void