API reference
API reference
Select your platform
No SDKs available
No versions available

UMRUKBPLibrary Class

Extends UBlueprintFunctionLibrary
Mixed Reality Utility Kit Blueprint Function Library. See functions for further information.

Static Member Functions

ComputeCentroid ( PolygonPoints )
Compute the centroid of a polygon that is defined by the points. The centroid may be outside of the polygon in case the polygon is non convex.
Signature
static FVector2D UMRUKBPLibrary::ComputeCentroid(const TArray< FVector2D > &PolygonPoints)
Parameters
PolygonPoints: const TArray< FVector2D > &  Points that define the polygon.
Returns
FVector2D  The centroid.
ComputeDirectionAwayFromClosestWall ( Anchor , OutCardinalAxisIndex , ExcludedAxes )
Compute the direction that faces away from the closest wall of the given anchor.
Signature
static FVector UMRUKBPLibrary::ComputeDirectionAwayFromClosestWall(const AMRUKAnchor *Anchor, int &OutCardinalAxisIndex, const TArray< int > ExcludedAxes)
Parameters
Anchor: const AMRUKAnchor *  The anchor for which the direction should be computed.
OutCardinalAxisIndex: int &  The index of the computed cardinal axis. Can be either 0, 1, 2 or 3
ExcludedAxes: const TArray< int >  Axes to exclude in the computation. Can contain 0, 1, 2, 3
Returns
FVector  The direction
ConstructTexture2D ( RenderTarget2D , Outer , TexName )
Construct a 2D texture from a render target.
Signature
static UTexture2D * UMRUKBPLibrary::ConstructTexture2D(UTextureRenderTarget2D *RenderTarget2D, UObject *Outer, const FString &TexName)
Parameters
RenderTarget2D: UTextureRenderTarget2D *  The render target from which the texture should be created.
Outer: UObject *  The (optional) outer object for the created texture.
TexName: const FString &  Name for the new texture.
Returns
UTexture2D *  The newly created texture.
CreateMeshSegmentation ( MeshPositions , MeshIndices , PointsPerUnitX , PointsPerUnitY , PointsPerUnitZ , ReservedMin , ReservedMax , OutSegments , OutReservedSegment , WorldToMeters )
Create mesh segments from the given mesh. This can be used for creating a destructible mesh system.
Signature
static void UMRUKBPLibrary::CreateMeshSegmentation(const TArray< FVector > &MeshPositions, const TArray< uint32 > &MeshIndices, float PointsPerUnitX, float PointsPerUnitY, float PointsPerUnitZ, const FVector &ReservedMin, const FVector &ReservedMax, TArray< FMRUKMeshSegment > &OutSegments, FMRUKMeshSegment &OutReservedSegment, float WorldToMeters=100.0)
Parameters
MeshPositions: const TArray< FVector > &  The mesh positions that should be segmented
MeshIndices: const TArray< uint32 > &  The mesh indices that should be segmented
PointsPerUnitX: float  The number of points per unit along the X axis
PointsPerUnitY: float  The number of points per unit along the Y axis
PointsPerUnitZ: float  The number of points per unit along the Z axis
ReservedMin: const FVector &  Reserved space from the lower part of the bound box
ReservedMax: const FVector &  Reserved space from the upper part of the bounding box
OutSegments: TArray< FMRUKMeshSegment > &  The segmented meshes that have been created from the given mesh
OutReservedSegment: FMRUKMeshSegment &  The reserved mesh segment that has been created from the given mesh
WorldToMeters: float  Scale for world to meters
Returns
void
GetMatrixColumn ( Matrix , Index )
Extract a column from a matrix.
Signature
static FLinearColor UMRUKBPLibrary::GetMatrixColumn(const FMatrix &Matrix, int32 Index)
Parameters
Matrix: const FMatrix &  The matrix to use.
Index: int32  The column index.
Returns
FLinearColor  The column of the matrix.
IsUnrealEngineMetaFork ()
Check if the current Unreal Engine is the fork of Meta.
Signature
static bool UMRUKBPLibrary::IsUnrealEngineMetaFork()
Returns
bool  Whether its the fork or not.
LoadGlobalMeshFromDevice ( SpaceHandle , OutProceduralMesh , LoadCollision , WorldContext )
Load the global mesh from the device.
Signature
static bool UMRUKBPLibrary::LoadGlobalMeshFromDevice(FOculusXRUInt64 SpaceHandle, UProceduralMeshComponent *OutProceduralMesh, bool LoadCollision, const UObject *WorldContext)
Parameters
SpaceHandle: FOculusXRUInt64  Space handle of the room.
OutProceduralMesh: UProceduralMeshComponent *  Procedural mesh to load the triangle data in.
LoadCollision: bool  Whether to generate collision or not.
WorldContext: const UObject *  Context of the world.
Returns
bool  Whether the load was successful or not.
RecalculateProceduralMeshAndTangents ( Mesh )
(Re)Calculate Normals and Tangents of the given procedural mesh.
Signature
static void UMRUKBPLibrary::RecalculateProceduralMeshAndTangents(class UProceduralMeshComponent *Mesh)
Parameters
Mesh: class UProceduralMeshComponent *  The procedural mesh.
Returns
void
SetScaleRecursivelyAdjustingForRotation ( SceneComponent , UnRotatedScale )
In Unreal Engine, scale is always applied in the local space to avoid any skew. This means that if you have a component which has a 90 degree rotation and is scaled, or any of its children are scaled then the scale axes will not be applied as you would expect. This is can make it very awkward to work with when trying to scale the actors to fit within the scene volumes. To work around this problem, this function will attempt to adjust the scale axes recursively to match the expected behaviour. This will only work reliably if the rotations involved are 90 degrees, if they are not then it will pick the closest axis.
Signature
static void UMRUKBPLibrary::SetScaleRecursivelyAdjustingForRotation(USceneComponent *SceneComponent, const FVector &UnRotatedScale)
Parameters
SceneComponent: USceneComponent *  The component where the scale should be set
UnRotatedScale: const FVector &  The scale you would like to have without considering any rotations
Returns
void