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 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
|
ComputeRoomBoxGrid
(
Room
, MaxPointsCount
, PointsPerUnitX
, PointsPerUnitY
)
|
Compute a grid by taking into account the room box geometry. E.g. create evenly spaced points on ceiling, floor and walls.
Signature
static TArray< FVector > UMRUKBPLibrary::ComputeRoomBoxGrid(const AMRUKRoom *Room, int32 MaxPointsCount, double PointsPerUnitX=1.0, double PointsPerUnitY=1.0) Parameters MaxPointsCount: int32Â
The maximum number of points
PointsPerUnitX: doubleÂ
The density of points on the X axis
PointsPerUnitY: doubleÂ
The density of points on the Y axis
Returns TArray< FVector >Â
The computed points
|
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
, SegmentationPoints
, ReservedMin
, ReservedMax
, OutSegments
, OutReservedSegment
)
|
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, const TArray< FVector > &SegmentationPoints, const FVector &ReservedMin, const FVector &ReservedMax, TArray< FMRUKMeshSegment > &OutSegments, FMRUKMeshSegment &OutReservedSegment) Parameters MeshPositions: const TArray< FVector > &Â
The mesh positions that should be segmented
MeshIndices: const TArray< uint32 > &Â
The mesh indices that should be segmented
SegmentationPoints: const TArray< FVector > &Â
A set of points that should be used to calculate the segments
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 &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 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 |