destroy() method when the AnchorMeshSpawner instance is no longer in use.
class AnchorMeshSpawner(val mrukFeature: MRUKFeature, var spawnGroups: Map<MRUKLabel, AnchorMeshSpawner.AnchorMeshGroup>, val spawnMode: MRUKSpawnMode = MRUKSpawnMode.CURRENT_ROOM_ONLY)
AnchorMeshSpawner
(
mrukFeature
,
spawnGroups
,
spawnMode
)
:
AnchorMeshSpawner |
Signature
constructor(mrukFeature: MRUKFeature, spawnGroups: Map<MRUKLabel, AnchorMeshSpawner.AnchorMeshGroup>, spawnMode: MRUKSpawnMode = MRUKSpawnMode.CURRENT_ROOM_ONLY) Parameters Returns |
mrukFeature
:
MRUKFeature [Get] |
The MRUKFeature to which this AnchorMeshSpawner is tied. The AnchorMeshSpawner gets its anchor data from the MRUKFeature.
Signature
val mrukFeature: MRUKFeature |
spawnGroups
:
Map
[Get][Set] |
A map of label to the meshes to spawn.
Signature
var spawnGroups: Map<MRUKLabel, AnchorMeshSpawner.AnchorMeshGroup> |
spawnMode
:
MRUKSpawnMode [Get] |
The spawnMode determines if the AnchorMeshSpawner should spawn meshes automatically whenever the mrukFeature has new anchors loaded. If the spawnMode is set to NONE spawnMeshes() needs to be invoked manually.
Signature
val spawnMode: MRUKSpawnMode |
destroy
()
|
Destroys the AnchorMeshSpawner. It's important to call this function before the AnchorMeshSpawner gets out of scope because it might lead to memory leaks otherwise.
Signature
fun destroy() |
spawnMeshes
(
rooms
)
:
List
|
Spawn meshes for a given list of rooms. This should only be invoked manually if spawnMode is set to NONE.
Signature
fun spawnMeshes(rooms: List<MRUKRoom>): List<Entity> Parameters
rooms:
List
Returns
List
|
spawnMeshes
(
room
)
:
List
|
Spawn meshes for a given room. This should only be invoked manually if spawnMode is set to NONE.
Signature
fun spawnMeshes(room: MRUKRoom): List<Entity> Parameters
room:
MRUKRoom Returns
List
|
boundsCache
:
HashMap<String, Bound3D>
[Get] |
Signature
val boundsCache: HashMap<String, Bound3D><String, Bound3D> |
getMeshBounds
(
mesh
)
:
Bound3D |
data class AnchorMeshGroup(val meshes: List<String>, val selectionMode: AnchorMeshSelectionMode = AnchorMeshSelectionMode.RANDOM, val scalingMode: AnchorMeshScalingMode = AnchorMeshScalingMode.STRETCH, val matchAspectRatio: Boolean = false)
AnchorMeshGroup
(
meshes
,
selectionMode
,
scalingMode
,
matchAspectRatio
)
:
AnchorMeshSpawner.AnchorMeshGroup
|
Signature
constructor(meshes: List<String>, selectionMode: AnchorMeshSelectionMode = AnchorMeshSelectionMode.RANDOM, scalingMode: AnchorMeshScalingMode = AnchorMeshScalingMode.STRETCH, matchAspectRatio: Boolean = false) Parameters
meshes:
List
selectionMode:
AnchorMeshSelectionMode
scalingMode:
AnchorMeshScalingMode
matchAspectRatio:
Boolean
Returns
AnchorMeshSpawner.AnchorMeshGroup
|
matchAspectRatio
:
Boolean
[Get] |
Ensures that the mesh gets rotated in a way to match the aspect ratio of the anchor.
Signature
val matchAspectRatio: Boolean = false |
meshes
:
List
[Get] |
A list of meshes considered for spawning. The selection of meshes for spawning is determined by the selectionMode.
Signature
val meshes: List<String> |
scalingMode
:
AnchorMeshScalingMode [Get] |
Determines the scaling mode that should be used when scaling a mesh from that group.
Signature
val scalingMode: AnchorMeshScalingMode |
selectionMode
:
AnchorMeshSelectionMode [Get] |
Determines the selection method for the meshes in that group.
Signature
val selectionMode: AnchorMeshSelectionMode |