static Matrix4x4 | GetTransformationMatrixMatchingAnchorVolume ( MRUKAnchor anchorInfo, bool matchAspectRatio, bool calculateFacingDirection, Bounds? prefabBounds, AnchorPrefabSpawner.ScalingMode scalingMode, AnchorPrefabSpawner.AlignMode alignMode ) Calculates a transformation matrix that matches the volume of the anchor. |
static Vector3 | Scales a prefab based on the specified scaling mode. |
static Vector3 | AlignPrefabPivot ( Bounds anchorVolumeBounds, Bounds? prefabBounds, Vector3 localScale, AnchorPrefabSpawner.AlignMode alignMode ) Aligns the pivot points of a prefab and of the anchors' volumebased on the specified alignment mode. |
static bool | GetPrefabWithClosestSizeToAnchor ( MRUKAnchor anchor, List< GameObject > prefabList, out GameObject sizeMatchingPrefab ) Selects a prefab from a list that has the closest size to the volume of an anchor. |
static Matrix4x4 | GetTransformationMatrixMatchingAnchorPlaneRect ( MRUKAnchor anchorInfo, Bounds? prefabBounds, AnchorPrefabSpawner.ScalingMode scaling, AnchorPrefabSpawner.AlignMode alignment ) Calculates a transformation matrix that matches the plane rectangle of the anchor. |
static GameObject | SelectPrefab ( MRUKAnchor anchor, AnchorPrefabSpawner.SelectionMode prefabSelectionMode, List< GameObject > prefabs, System.Random random ) Selects a prefab based on the specified selection mode. |
static Vector3 | AlignPrefabPivot ( Rect planeRect, Bounds? prefabBounds, Vector2 localScale, AnchorPrefabSpawner.AlignMode alignMode ) Aligns the pivots of a prefab and of the anchor's plane rect, based on the specified alignment mode. |
static Vector3 | Scales a prefab based on the specified scaling mode. |
static Matrix4x4 Meta.XR.MRUtilityKit.AnchorPrefabSpawnerUtilities.GetTransformationMatrixMatchingAnchorVolume ( MRUKAnchor anchorInfo, bool matchAspectRatio, bool calculateFacingDirection, Bounds? prefabBounds, AnchorPrefabSpawner.ScalingMode scalingMode, AnchorPrefabSpawner.AlignMode alignMode ) |
---|
Calculates a transformation matrix that matches the volume of the anchor. Parameters anchorInfo The anchor of which volume has to be match. matchAspectRatioWhether to match the aspect ratio of the anchor. calculateFacingDirectionWhether to calculate the facing direction of the anchor. prefabBoundsThe bounds of the prefab. scalingModeThe scaling mode to use. See AnchorPrefabSpawner.ScalingMode. alignModeThe alignment mode to use. See AnchorPrefabSpawner.AlignMode. Returns A transformation matrix that matches the volume of the anchor. This method calculates the local scale and pose of a prefab based on the anchor's volume, and then combines these to return a transformation matrix. See Also: AnchorPrefabSpawnerUtilities.GetTransformationMatrixMatchingAnchorPlaneRect |
static Vector3 Meta.XR.MRUtilityKit.AnchorPrefabSpawnerUtilities.ScalePrefab ( Vector3 localScale, AnchorPrefabSpawner.ScalingMode scalingMode ) |
---|
Scales a prefab based on the specified scaling mode. Parameters localScale The local scale of the prefab. scalingModeThe scaling mode to use. See AnchorPrefabSpawner.ScalingMode. Returns The scaled local scale of the prefab. This method is used to scale a prefab when instantiating it as an anchor with a volume. If the scaling mode is UniformScaling, it scales the prefab uniformly based on the smallest axis. If the scaling mode is UniformXZScale, it scales the prefab uniformly on the X and Z axes. If the scaling mode is NoScaling, it returns a unit vector. If the scaling mode is Custom, it uses the provided custom scaling logic. If the scaling mode is Stretch, it returns the anchor's original local scale. |
static Vector3 Meta.XR.MRUtilityKit.AnchorPrefabSpawnerUtilities.AlignPrefabPivot ( Bounds anchorVolumeBounds, Bounds? prefabBounds, Vector3 localScale, AnchorPrefabSpawner.AlignMode alignMode ) |
---|
Aligns the pivot points of a prefab and of the anchors' volumebased on the specified alignment mode. Parameters anchorVolumeBounds The volume bounds of the anchor. prefabBoundsThe bounds of the prefab. localScaleThe local scale of the prefab. alignModeThe alignment mode to use. See AnchorPrefabSpawner.AlignMode. Returns The pivot points of the prefab and of the anchor's volume. This method aligns the pivots of a prefab and of an anchor based on the specified alignment mode. The pivot calculations will impact where the prefab will be instantiated in the scene. If the alignment mode is Automatic or Bottom, it aligns the pivot at the bottom center of the prefab. If the alignment mode is Center, it aligns the pivot at the center of the prefab. If the alignment mode is Custom, it uses the provided custom alignment logic. It then scales the pivot point of the prefab and returns the pivot points of the prefab and the anchor. |
static bool Meta.XR.MRUtilityKit.AnchorPrefabSpawnerUtilities.GetPrefabWithClosestSizeToAnchor ( MRUKAnchor anchor, List< GameObject > prefabList, out GameObject sizeMatchingPrefab ) |
---|
Selects a prefab from a list that has the closest size to the volume of an anchor. Parameters anchor The anchor to compare sizes with. prefabListThe list of prefabs to select from. sizeMatchingPrefabThe selected prefab with the closest size to the anchor's volume. Returns True if a matching prefab is found, false otherwise. This method selects a prefab from a list that has the closest size to the volume of an anchor. It first checks if the anchor has a volume. If not, it throws an exception. It then calculates the volume of the anchor and each prefab in the list. It selects the prefab with the smallest difference in size to the anchor's volume. |
static Matrix4x4 Meta.XR.MRUtilityKit.AnchorPrefabSpawnerUtilities.GetTransformationMatrixMatchingAnchorPlaneRect ( MRUKAnchor anchorInfo, Bounds? prefabBounds, AnchorPrefabSpawner.ScalingMode scaling, AnchorPrefabSpawner.AlignMode alignment ) |
---|
Calculates a transformation matrix that matches the plane rectangle of the anchor. Parameters anchorInfo Information about the anchor. prefabBoundsThe bounds of the prefab. scalingThe scaling mode to use. See AnchorPrefabSpawner.ScalingMode. alignmentThe alignment mode to use. See AnchorPrefabSpawner.AlignMode. Returns A transformation matrix that matches the plane rectangle of the anchor. This method calculates and returns a transformation matrix for a prefab that matches the plane rect of an anchor, by determining the local scale and pose of the prefab based on the rect. |
static GameObject Meta.XR.MRUtilityKit.AnchorPrefabSpawnerUtilities.SelectPrefab ( MRUKAnchor anchor, AnchorPrefabSpawner.SelectionMode prefabSelectionMode, List< GameObject > prefabs, System.Random random ) |
---|
Selects a prefab based on the specified selection mode. Parameters anchor The anchor to use for selection. prefabSelectionModeThe selection mode to use. See AnchorPrefabSpawner.SelectionMode. prefabsThe list of prefabs to select from. randomThe random generator used to generate the index of the prefab to be selected Returns True if a prefab was selected, false otherwise. This method selects a prefab based on the specified selection mode. If the selection mode is Random, it selects a random prefab from the list. If the selection mode is ClosestSize, it selects the prefab with the closest size to the anchor. If the selection mode is Custom, it uses the provided custom selection logic. |
static Vector3 Meta.XR.MRUtilityKit.AnchorPrefabSpawnerUtilities.AlignPrefabPivot ( Rect planeRect, Bounds? prefabBounds, Vector2 localScale, AnchorPrefabSpawner.AlignMode alignMode ) |
---|
Aligns the pivots of a prefab and of the anchor's plane rect, based on the specified alignment mode. Parameters planeRect The plane rectangle of the anchor. prefabBoundsThe bounds of the prefab. localScaleThe local scale of the prefab. alignModeThe alignment mode to use. See AnchorPrefabSpawner.AlignMode. Returns The pivot points of the prefab and the anchor plane rectangle. This method aligns the pivots of a prefab and of an anchor based on the specified alignment mode. The pivot calculations will impact where the prefab will be instantiated in the scene. If the alignment mode is Automatic or Center, it aligns the pivot at the center of the prefab. If the alignment mode is Bottom, it aligns the pivot at the bottom of the prefab. If the alignment mode is Custom, it uses the provided custom alignment logic. It then scales the pivot point of the prefab and returns the pivot points of the prefab and the anchor plane rectangle. |
static Vector3 Meta.XR.MRUtilityKit.AnchorPrefabSpawnerUtilities.ScalePrefab ( Vector2 localScale, AnchorPrefabSpawner.ScalingMode scalingMode ) |
---|
Scales a prefab based on the specified scaling mode. Parameters localScale The local scale of the prefab. scalingModeThe scaling mode to use. See AnchorPrefabSpawner.ScalingMode. Returns The scaled local scale of the prefab. This method is used to scale a prefab when instantiating it as an anchor with a PlaneRect. If the scaling mode is Stretch, it returns the original local scale. If the scaling mode is UniformScaling or UniformXZScale, it scales the prefab uniformly. If the scaling mode is NoScaling, it returns a unit vector. If the scaling mode is Custom, it uses the provided custom scaling logic. |