Class SurfaceMagnetism
SurfaceMagnetism casts rays to Surfaces in the world and aligns the object to the hit surface.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Utilities.Solvers
Assembly: cs.temp.dll.dll
Syntax
public class SurfaceMagnetism : Solver
Properties
BoxRaysPerEdge
Number of rays per edge, should be odd. Total casts is n^2
Declaration
public int BoxRaysPerEdge { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
CloseDistance
Closest distance to bring object
Declaration
public float CloseDistance { get; set; }
Property Value
Type | Description |
---|---|
Single |
ClosestDistance
Closest distance to bring object
Declaration
public float ClosestDistance { get; set; }
Property Value
Type | Description |
---|---|
Single |
CurrentOrientationMode
How solver will orient model. See OrientationMode enum for possible modes. When mode=Blended, use OrientationBlend property to define ratio for blending
Declaration
public SurfaceMagnetism.OrientationMode CurrentOrientationMode { get; set; }
Property Value
Type | Description |
---|---|
SurfaceMagnetism.OrientationMode |
CurrentRaycastDirectionMode
Raycast direction type. Default is forward direction of Tracked Target transform
Declaration
public SurfaceMagnetism.RaycastDirectionMode CurrentRaycastDirectionMode { get; set; }
Property Value
Type | Description |
---|---|
SurfaceMagnetism.RaycastDirectionMode |
DebugEnabled
If enabled, the debug lines will be drawn in the editor
Declaration
public bool DebugEnabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
KeepOrientationVertical
If true, ensures object is kept vertical for TrackedTarget, SurfaceNormal, and Blended Orientation Modes
Declaration
public bool KeepOrientationVertical { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
MagneticSurfaces
Array of LayerMask to execute from highest to lowest priority. First layermask to provide a raycast hit will be used by component
Declaration
public LayerMask[] MagneticSurfaces { get; set; }
Property Value
Type | Description |
---|---|
LayerMask[] |
MaxDistance
Max distance for raycast to check for surfaces
Declaration
public float MaxDistance { get; set; }
Property Value
Type | Description |
---|---|
Single |
MaximumNormalVariance
Align to ray cast direction if box cast hits many normals facing in varying directions
Declaration
public float MaximumNormalVariance { get; set; }
Property Value
Type | Description |
---|---|
Single |
MaxRaycastDistance
Max distance for raycast to check for surfaces
Declaration
public float MaxRaycastDistance { get; set; }
Property Value
Type | Description |
---|---|
Single |
OnSurface
Whether or not the object is currently magnetized to a surface.
Declaration
public bool OnSurface { get; }
Property Value
Type | Description |
---|---|
Boolean |
OrientationBlend
Value used for when Orientation Mode=Blended. If 0.0 orientation is driven all by TrackedTarget mode and if 1.0 orientation is driven all by SurfaceNormal mode
Declaration
public float OrientationBlend { get; set; }
Property Value
Type | Description |
---|---|
Single |
OrthographicBoxCast
If true, use orthographic casting for box lines instead of perspective
Declaration
public bool OrthographicBoxCast { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
RaycastMode
Surface raycast mode for solver
Declaration
public SceneQueryType RaycastMode { get; set; }
Property Value
Type | Description |
---|---|
SceneQueryType |
SphereSize
Radius to use for sphere cast
Declaration
public float SphereSize { get; set; }
Property Value
Type | Description |
---|---|
Single |
SurfaceNormalOffset
Offset from surface along surface normal
Declaration
public float SurfaceNormalOffset { get; set; }
Property Value
Type | Description |
---|---|
Single |
SurfaceRayOffset
Offset from surface along ray cast direction
Declaration
public float SurfaceRayOffset { get; set; }
Property Value
Type | Description |
---|---|
Single |
UseLinkedAltScaleOverride
When doing volume casts, use linked AltScale instead of object's current scale
Declaration
public bool UseLinkedAltScaleOverride { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
VolumeCastSizeOverride
When doing volume casts, use size override if non-zero instead of object's current scale
Declaration
public float VolumeCastSizeOverride { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
SolverUpdate()
Should be implemented in derived classes, but Solver can be used to flush shared transform to real transform
Declaration
public override void SolverUpdate()