Class IUsesReferencePointsMethods
Namespace: Unity.MARS.Providers
Syntax
public static class IUsesReferencePointsMethods : object
Methods
GetAllReferencePoints(IUsesReferencePoints, List<MRReferencePoint>)
Get all registered reference points
Declaration
public static void GetAllReferencePoints(this IUsesReferencePoints obj, List<MRReferencePoint> referencePoints)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
List<MRReferencePoint> | referencePoints | A list of MRReferencePoint objects to which the currently tracked reference points will be added |
StartTrackingReferencePoints(IUsesReferencePoints)
Start tracking reference points. Point cloud detection is enabled on initialization, so this is only necessary after calling StopDetecting.
Declaration
public static void StartTrackingReferencePoints(this IUsesReferencePoints obj)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj |
StopTrackingReferencePoints(IUsesReferencePoints)
Stop tracking reference points. This will happen automatically on destroying the session. It is only necessary to call this method to pause plane detection while maintaining camera tracking
Declaration
public static void StopTrackingReferencePoints(this IUsesReferencePoints obj)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj |
SubscribePointAdded(IUsesReferencePoints, Action<MRReferencePoint>)
Subscribe to the pointAdded event, which is called when a reference point is first added
Declaration
public static void SubscribePointAdded(this IUsesReferencePoints obj, Action<MRReferencePoint> pointAdded)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
Action<MRReferencePoint> | pointAdded | The delegate to subscribe |
SubscribePointRemoved(IUsesReferencePoints, Action<MRReferencePoint>)
Subscribe to the pointRemoved event, which is called when a reference point is removed
Declaration
public static void SubscribePointRemoved(this IUsesReferencePoints obj, Action<MRReferencePoint> pointRemoved)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
Action<MRReferencePoint> | pointRemoved | The delegate to subscribe |
SubscribePointUpdated(IUsesReferencePoints, Action<MRReferencePoint>)
Subscribe to the pointUpdated event, which is called when a reference point is updated
Declaration
public static void SubscribePointUpdated(this IUsesReferencePoints obj, Action<MRReferencePoint> pointUpdated)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
Action<MRReferencePoint> | pointUpdated | The delegate to subscribe |
TryAddReferencePoint(IUsesReferencePoints, Pose, out MarsTrackableId)
Add a reference point
Declaration
public static bool TryAddReferencePoint(this IUsesReferencePoints obj, Pose pose, out MarsTrackableId referencePointId)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
Pose | pose | |
MarsTrackableId | referencePointId |
Returns
Type | Description |
---|---|
Boolean | true if adding the point succeeded, false otherwise |
TryGetReferencePoint(IUsesReferencePoints, MarsTrackableId, out MRReferencePoint)
Get a reference point
Declaration
public static bool TryGetReferencePoint(this IUsesReferencePoints obj, MarsTrackableId referencePointId, out MRReferencePoint point)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
MarsTrackableId | referencePointId | |
MRReferencePoint | point |
Returns
Type | Description |
---|---|
Boolean | true if getting the point succeeded, false otherwise |
TryRemoveReferencePoint(IUsesReferencePoints, MarsTrackableId)
Remove a reference point
Declaration
public static bool TryRemoveReferencePoint(this IUsesReferencePoints obj, MarsTrackableId referencePointId)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
MarsTrackableId | referencePointId |
Returns
Type | Description |
---|---|
Boolean | true if removing the point succeeded, false otherwise |
UnsubscribePointAdded(IUsesReferencePoints, Action<MRReferencePoint>)
Unsubscribe from the pointAdded event, which is called when a reference point is first added
Declaration
public static void UnsubscribePointAdded(this IUsesReferencePoints obj, Action<MRReferencePoint> pointAdded)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
Action<MRReferencePoint> | pointAdded | The delegate to unsubscribe |
UnsubscribePointRemoved(IUsesReferencePoints, Action<MRReferencePoint>)
Unsubscribe from the pointRemoved event, which is called when a reference point is removed
Declaration
public static void UnsubscribePointRemoved(this IUsesReferencePoints obj, Action<MRReferencePoint> pointRemoved)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
Action<MRReferencePoint> | pointRemoved | The delegate to unsubscribe |
UnsubscribePointUpdated(IUsesReferencePoints, Action<MRReferencePoint>)
Unsubscribe from the pointUpdated event, which is called when a reference point is updated
Declaration
public static void UnsubscribePointUpdated(this IUsesReferencePoints obj, Action<MRReferencePoint> pointUpdated)
Parameters
Type | Name | Description |
---|---|---|
IUsesReferencePoints | obj | |
Action<MRReferencePoint> | pointUpdated | The delegate to unsubscribe |