unreal.MagicLeapARPinFunctionLibrary
¶
- class unreal.MagicLeapARPinFunctionLibrary(outer=None, name='None')¶
Bases:
unreal.BlueprintFunctionLibrary
Direct API interface for the Magic Leap Persistent AR Pin tracker system.
C++ Source:
Plugin: MagicLeapPassableWorld
Module: MagicLeapARPin
File: MagicLeapARPinFunctionLibrary.h
- classmethod bind_to_on_magic_leap_ar_pin_updated_delegate(delegate) → None¶
Bind a dynamic delegate to the OnMagicLeapARPinUpdated event.
The delegate reports 3 arrays for ARPins added, updated and deleted. Whether a pin is considered updated is determined by whehter any of its state parameters changed a specified delta. The delta thresholds can be set in Project Settings > MagicLeapARPin Plugin
- Parameters
delegate (MagicLeapARPinUpdatedDelegate) – Delegate to bind
- classmethod bind_to_on_magic_leap_content_binding_found_delegate(delegate) → None¶
Bind a dynamic delegate to the OnMagicLeapContentBindingFound event.
The delegate reports a PinID and the set of ObjectIds that were saved (via a MagicLeapARPinComponent) for that Pin. This delegate can be used to spawn the actors associated with that ObjectId. Spawn the actor, set the ObjectId and then call UMagicLeapARPinComponent::AttemptPinDataRestoration().
- Parameters
delegate (MagicLeapContentBindingFoundDelegate) – Delegate to bind
- classmethod create_tracker() → MagicLeapPassableWorldError¶
Create an ARPin tracker.
- Returns
Error code representing specific success or failure cases. If code is EMagicLeapPassableWorldError::PrivilegeRequestPending, poll for IsTrackerValid() to check when the privilege is granted and tracker successfully created.
- Return type
- classmethod destroy_tracker() → MagicLeapPassableWorldError¶
Destroy an ARPin tracker.
- Returns
Error code representing specific success or failure cases.,
- Return type
- classmethod get_ar_pin_position_and_orientation(pin_id) → (position=Vector, orientation=Rotator, pin_found_in_environment=bool) or None¶
Returns the world position & orientation of the requested Pin.
- Parameters
pin_id (Guid) – ID of the Pin to get the position and orientation for.
- Returns
true if the PinID was valid and the position & orientation were successfully retrieved.
position (Vector): Output param for the world position of the Pin. Valid only if return value is true.
orientation (Rotator): Output param for the world orientation of the Pin. Valid only if return value is true.
pin_found_in_environment (bool): Output param for indicating if the requested Pin was found user’s current environment or not.
- Return type
tuple or None
- classmethod get_ar_pin_position_and_orientation_tracking_space(pin_id) → (position=Vector, orientation=Rotator, pin_found_in_environment=bool) or None¶
Returns the position & orientation of the requested Pin in tracking space
- Parameters
pin_id (Guid) – ID of the Pin to get the position and orientation for.
- Returns
true if the PinID was valid and the position & orientation were successfully retrieved.
position (Vector): Output param for the position of the Pin in tracking space. Valid only if return value is true.
orientation (Rotator): Output param for the orientation of the Pin in tracking space. Valid only if return value is true.
pin_found_in_environment (bool): Output param for indicating if the requested Pin was found user’s current environment or not.
- Return type
tuple or None
- classmethod get_ar_pin_state(pin_id) -> (MagicLeapPassableWorldError, state=MagicLeapARPinState)¶
Returns the state of the requested Pin.
- Parameters
pin_id (Guid) – ID of the Pin to get the state for.
- Returns
Error code representing specific success or failure cases.
state (MagicLeapARPinState): Output state of the Pin. Valid only if return value is true.
- Return type
- classmethod get_ar_pin_state_to_string(state) → str¶
Get ARPin State to String
- Parameters
state (MagicLeapARPinState) –
- Returns
- Return type
- classmethod get_available_ar_pins(num_requested) -> (MagicLeapPassableWorldError, pins=Array(Guid))¶
Returns all the AR Pins currently available.
- Parameters
num_requested (int32) – Max number of AR Pins to query. Pass in a negative integer to get all available Pins.
- Returns
Error code representing specific success or failure cases.
pins (Array(Guid)): Output array containing IDs of the found Pins. Valid only if return value is EMagicLeapPassableWorldError::None.
- Return type
- classmethod get_closest_ar_pin(search_point) -> (MagicLeapPassableWorldError, pin_id=Guid)¶
Returns the Pin closest to the target point passed in.
- classmethod get_content_binding_save_game_user_index() → int32¶
Get the user index used to save / load the save game object used for storing all the content bindings (PinID and ObjectID associations in a MagicLeapARPinComponent).
- Returns
user index for the save game object
- Return type
int32
- classmethod get_global_query_filter() -> (MagicLeapPassableWorldError, current_global_filter=MagicLeapARPinQuery)¶
The current filter used when querying pins for updates. see: SetGlobalQueryFilter()
- Returns
Error code representing specific success or failure cases.
current_global_filter (MagicLeapARPinQuery): the current filter used when querying pins for updates.
- Return type
- classmethod get_num_available_ar_pins() -> (MagicLeapPassableWorldError, count=int32)¶
Returns the count of currently available AR Pins.
- Returns
Error code representing specific success or failure cases.
count (int32): Output param for number of currently available AR Pins. Valid only if return value is EMagicLeapPassableWorldError::None.
- Return type
int32
- classmethod parse_string_to_ar_pin_id(pin_id_string) → Guid or None¶
Parse String to ARPin Id
- classmethod query_ar_pins(query) -> (MagicLeapPassableWorldError, pins=Array(Guid))¶
Returns filtered set of Pins based on the informed parameters.
- Parameters
query (MagicLeapARPinQuery) – Search parameters
- Returns
Error code representing specific success or failure cases.
pins (Array(Guid)): Output array containing IDs of the found Pins. Valid only if return value is EMagicLeapPassableWorldError::None.
- Return type
- classmethod set_content_binding_save_game_user_index(user_index) → None¶
Set the user index to be used to save / load the save game object used for storing all the content bindings (PinID and ObjectID associations in a MagicLeapARPinComponent). Call this before the first tick of the level.
- Parameters
user_index (int32) – user index to be used for the save game object
- classmethod set_global_query_filter(global_filter) → MagicLeapPassableWorldError¶
Set the filter used to query ARPins at the specified frequency (see UMagicLeapARPinSettings). This will alter the results reported via the OnMagicLeapARPinUpdated delegates only and not the ones by GetClosestARPin() and QueryARPins(). By default the filter includes all available Pin in an unbounded distance. If an ARPin’s type changes to one that is not in the specified filter, or it falls outside the specified search volume, it will be marked as a “deleted” Pin even if it is still present in the environment.
- Parameters
global_filter (MagicLeapARPinQuery) – Filter to use when querying pins for updates.
- Returns
Error code representing specific success or failure cases.
- Return type
- classmethod un_bind_to_on_magic_leap_ar_pin_updated_delegate(delegate) → None¶
Unbind a dynamic delegate from the OnMagicLeapARPinUpdated event.
- Parameters
delegate (MagicLeapARPinUpdatedDelegate) – Delegate to unbind
- classmethod un_bind_to_on_magic_leap_content_binding_found_delegate(delegate) → None¶
Unbind a dynamic delegate from the OnMagicLeapContentBindingFound event.
- Parameters
delegate (MagicLeapContentBindingFoundDelegate) – Delegate to unbind