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

AMRUKRoom Class

Extends AActor

Fields

The space handle of this anchor
The anchors UUID
Event that gets fired if a anchor in this room was updated. E.g. volume or plane changed.
Event that gets fired if a new anchor was created in this room.
Event that gets fired if a anchor gets removed from this room.
Bounds of the room.
Edges of the room.
The floor anchor of this room.
The ceiling anchor of this room.
The wall anchors of this room.
The global mesh anchor of this room.
All anchors which are possible to sit on.
All anchors of this room.

Object Data for friend

class FMRUKSpec

Member Functions

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam
( FOnAnchorUpdated ,
Anchor )
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam
( FOnAnchorCreated ,
Anchor )
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam
( FOnAnchorRemoved ,
Anchor )
Check whether the position is inside the room or not.
Parameters
Position
The position in world space to check.
TestVerticalBounds
Whether the room should be constrained by vertical bounds or not in the check.
Returns
Whether the position is inside the room or not.
Generate a uniform random position within the room.
Parameters
OutPosition
Contains the randomly generated position.
MinDistanceToSurface
The minimum distance between the generated position and the closest surface/volume.
AvoidVolumes
If true then the position will not be inside a volume and min distance away from it.
Returns
Return true if success otherwise false. If this fails it can be because the min distance to surface is too large.
Generate a uniform random position within the room from a random stream.
Parameters
OutPosition
Contains the randomly generated position.
RandomStream
A random generator used to generate the position on the plane.
MinDistanceToSurface
The minimum distance between the generated position and the closest surface/volume.
AvoidVolumes
If true then the position will not be inside a volume and min distance away from it.
Returns
Return true if success otherwise false. If this fails it can be because the min distance to surface is too large.
Generates a random position on the surface of a given spawn location, while ensuring that the generated position is at least MinDistanceToEdge away from any edges. The LabelFilter parameter allows you to specify which types of surfaces should be considered for generating the random position.
Parameters
SpawnLocation
The location where the random position should be generated.
MinDistanceToEdge
The minimum distance from the edge that the generated position must have.
LabelFilter
A filter that specifies which types of surfaces should be considered for generating the random position.
OutPosition
The generated position.
OutNormal
The normal vector of the generated position.
Returns
A boolean value indicating whether a valid position was found. If no valid position could be found, both OutPosition and OutNormal will be set to zero vectors.
Cast a ray and return the closest hit anchor
Parameters
Origin
Origin The origin of the ray.
Direction
Direction The direction of the ray.
MaxDist
The maximum distance the ray should travel.
LabelFilter
The label filter can be used to include/exclude certain labels from the search.
OutHit
The closest hit.
Returns
The anchor that the ray hit.
Cast a ray and collect hits against the volume and plane bounds in this room. The order of the hits in the array is not specified.
Parameters
Origin
Origin The origin of the ray.
Direction
Direction The direction of the ray.
MaxDist
The maximum distance the ray should travel.
OutHits
The hits the ray collected.
LabelFilter
The label filter can be used to include/exclude certain labels from the search.
OutAnchors
The anchors that were hit. Each anchor in this array corresponds to a entry at the same position in OutHits.
Returns
Whether the ray hit anything
Clear all anchors from the room.
Check if the room does have any of the labels.
Parameters
Labels
The labels to check.
Returns
Whether the label was found in the room.
Get the position on the surface that is closest to the given position with respect to the distance.
Parameters
WorldPosition
The position in world space from which the closest surface point should be found.
OutSurfacePosition
The closest position on the closest surface if any. Otherwise zero.
OutSurfaceDistance
The distance between WorldPosition and OutSurfacePosition.
LabelFilter
The label filter can be used to include/exclude certain labels from the search.
MaxDistance
The distance to which a closest surface position should be searched. Everything below or equal to zero will be treated as infinity.
Returns
The Anchor on which the closest surface position was found or a null pointer otherwise.
Checks if the given position is on or inside of any scene volume in the room. Floor, ceiling and wall anchors will be excluded from the search.
Parameters
WorldPosition
The position in world space to check
TestVerticalBounds
Whether the vertical bounds should be checked or not
Tolerance
Tolerance
Returns
The anchor the WorldPosition is in. A null pointer otherwise.
Finds the closest seat given a ray.
Parameters
RayOrigin
The origin of the ray.
RayDirection
The direction of the ray.
OutSeatTransform
The seat pose.
Returns
If any seat was found the Anchor that has seats available will be returned. Otherwise a null pointer.
Finds all anchors in this room that have the given label attached.
Parameters
Label
The label to search for.
Returns
An array off anchors with the given label.
Finds the first anchor in this room that has the given label attached.
Parameters
Label
The label to search for.
Returns
If found, the Anchor that has the label attached. Otherwise a null pointer.
Get a suggested pose (position & rotation) from a raycast to place objects on surfaces in the scene. There are different positioning modes available. Default just uses the position where the raycast hit the object. Edge snaps the position to the edge that is nearest to the user and Center simply centers the position on top of the surface.
Parameters
RayOrigin
The origin of the ray.
RayDirection
The direction of the ray.
MaxDist
The maximum distance the ray should travel.
LabelFilter
The label filter can be used to include/exclude certain labels from the search.
OutPose
The calculated pose.
PositioningMethod
The method that should be used for determining the position on the surface.
Returns
The anchor that was hit by the ray if any. Otherwise a null pointer.
Return the longest wall in the room that has no other walls behind it.
Parameters
Tolerance
The tolerance to use when determining wall that are behind.
Returns
The wall anchor that is the key wall in the room.
Return the largest surface for a given label.
Parameters
Label
The label of the surfaces to search in.
Returns
The anchor that has the largest surface if any. Otherwise, a null pointer.
Attach a procedural mesh to the walls. This is done at the room level to ensure the UV coordinates can be done in a seamless way if desired.
Parameters
WallTextureCoordinateModes
Mode of the wall texture coordinates.
CutHoleLabels
Labels for which holes should be cut into the plane meshes
ProceduralMaterial
Material to apply on top of the procedural mesh.
Spawn meshes on the position of the anchors of the room. The actors should have Z as up Y as right and X as forward. The pivot point should be in the bottom center.
Parameters
SpawnGroups
A map which tells to spawn which actor to a given label.
CutHoleLabels
Labels for which the generated mesh should have holes. Only works with planes.
ProceduralMaterial
Material to apply on top of the procedural mesh if any.
ShouldFallbackToProcedural
Whether or not it should by default fallback to generating a procedural mesh if no actor class has been specified for a label.
Returns
All spawned interior actors.
Spawn meshes on the position of the anchors of the room from a random stream. The actors should have Z as up Y as right and X as forward. The pivot point should be in the bottom center.
Parameters
SpawnGroups
A map wich tells to spawn which actor to a given label.
CutHoleLabels
Labels for which the generated mesh should have holes. Only works with planes.
RandomStream
A random generator to choose randomly between actor classes if there a multiple for one label.
ProceduralMaterial
Material to apply on top of the procedural mesh if any.
ShouldFallbackToProcedural
Whether or not it should by default fallback to generating a procedural mesh if no actor class has been specified for a label.
Returns
All spawned interior actors.
Check if the given anchor is a wall anchor.
Parameters
Anchor
The anchor to check.
Returns
Whether the anchor is a wall anchor or not.
Compute the wall mesh texture coordinate adjustments that are needed to generate proper texture coordinates for the walls.
Parameters
WallTextureCoordinateModes
The texture coordinate mode to use for the walls.
OutAnchorsWithPlaneUVs
The computed texture coordinate adjustment with the wall anchor.
Load the triangle mesh of the global mesh anchor if it's available.
Parameters
Material
The Material to show if the global mesh is visible.
Returns
On success true, otherwise false.
Load the triangle mesh of the global mesh anchor. For this function to succeed you need to make sure to have a global mesh specified in the JSON file. Not every JSON file has a global mesh in it.
Parameters
JsonString
The string with the JSON data.
Material
Material to apply on the global mesh.
Returns
On Success true, otherwise false.
Compute the centroid of the room by taking the points of the floor boundary. The centroid may be outside of the room for non convex rooms. The Z value determines the height of the resulting vectors and ranges from 0 to 1. A Z value of 1 corresponds to the ceiling positions Z, while a Z value of 0 corresponds to the floor positions Z. Any value between 0 and 1 will interpolate between the two values. In case the floor and ceiling anchors haven't been loaded yet a zero vector will be returned.
Parameters
Z
Value used for interpolation of Z.
Returns
The centroid.
AMRUKRoom
( const FObjectInitializer & ObjectInitializer )
void EndPlay
( EEndPlayReason::Type Reason )
void LoadFromData
( UMRUKRoomData * RoomData )
void AttachProceduralMeshToWalls
( const TArray< FString > & CutHoleLabels,
UMaterialInterface * ProceduralMaterial )
void UpdateWorldLock
( APawn * Pawn,
const FVector & HeadWorldPosition )
TSharedRef< FJsonObject > JsonSerialize ( )
bool Corresponds
( UMRUKRoomData * RoomQuery )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon