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

EffectMesh Class

Extends MonoBehaviour
Manages dynamic mesh and collider generation based on scene elements.
This class is responsible for creating and managing the anchor's rendering and their associated colliders within a scene. It allows for dynamic updates based on scene changes, such as room and anchor updates, and provides options for shadow casting, visibility, and material customization. EffectMeshObject is used to represent the generated objects.

Member Enumerations

Enumeration WallTextureCoordinateModeU

Defines the modes for calculating texture coordinates along the U-axis (horizontal) for wall textures.
METRIC
No description available
METRIC_SEAMLESS
No description available
MAINTAIN_ASPECT_RATIO
No description available
MAINTAIN_ASPECT_RATIO_SEAMLESS
No description available
STRETCH
No description available
STRETCH_SECTION
No description available

Enumeration WallTextureCoordinateModeV

Defines the modes for calculating texture coordinates along the V-axis (vertical) for wall textures.
METRIC
No description available
MAINTAIN_ASPECT_RATIO
No description available
STRETCH
No description available

Enumeration AnchorTextureCoordinateMode

Defines the modes for calculating texture coordinates for anchor surfaces.
METRIC
No description available
STRETCH
No description available

Fields

When the scene data is loaded, this controls what room(s) the effect mesh is applied to.
See MRUK.RoomFilter for more details.
The material applied to the generated mesh.
If you'd like a multi-material room, you can use another EffectMesh object with a different Mesh Material.
float BorderSize[Get]
If enabled, a BoxCollider will be generated for each mesh component or a MeshCollider if the anchor has a triangle mesh.
Cut holes in the mesh for door frames and/or window frames.
NOTE: This does not apply if border size is non-zero
int Layer[Get]
TextureCoordinateModes[] textureCoordinateModes[Get]

Properties

Gets or sets a value indicating whether the effect mesh objects should cast shadows.
true if effect mesh objects should cast shadows; otherwise, false.
Gets or sets a value indicating whether the effect mesh objects should be hidden.
true if effect mesh objects should be hidden; otherwise, false.
Gets or sets a value indicating whether colliders for the effect mesh objects should be active.
true if colliders for effect mesh objects should be active; otherwise, false.
Gets a dictionary that maps MRUKAnchor instances to their corresponding spawned EffectMeshObject.
This should be treated as read-only, do not modify the contents.

Member Functions

Creates effect mesh for all elements in all rooms.
Destroys mesh the objects instantiated based on the provided label filter.
Parameters
label
The filter for mesh object destruction. If a mesh object's anchor labels pass this filter, the mesh object will be destroyed. Default value includes all labels.
Destroys all meshs in the given room and mark the room as not tracked anymore by this class.
Parameters
room
MRUK Room
Destroys the meshs associated with the provided anchor and mark the anchor as not tracked anymore by this class.
Parameters
anchor
MRUK Anchor
Adds colliders to the mesh objects instantiated based on the provided label filter.
Parameters
label
The filter to determine which mesh objects receive a collider. If a mesh object's anchor labels pass this filter and the mesh object does not already have a collider, a new collider is added. Default value includes all labels.
Destroy the colliders of the instantiated mesh objects based on the provided label filter.
Parameters
label
The filter to determine which mesh objects receive a collider. If a mesh object's anchor labels pass this filter and the mesh object does not already have a collider, a new collider is added. Default value includes all labels.
Toggles the shadow casting behavior of effect mesh objects based on the specified label filter.
Parameters
shouldCast
Determines whether shadows should be cast by the effect mesh objects.
label
A filter that specifies which effect mesh objects should have their shadow casting toggled. The default is a new instance of LabelFilter, which includes all labels.
Toggles the visibility of the effect mesh objects instantiated based on the provided label filter.
Parameters
shouldShow
Determines whether the effect mesh objects should be visible or not.
label
The filter to determine which effect mesh objects have their visibility toggled. If an effect mesh object's anchor labels pass this filter, its visibility is toggled according to the 'shouldShow' parameter. Default value includes all labels.
materialOverride
An optional material to apply to the effect mesh objects when their visibility is toggled. If not provided, the material of the mesh objects remains unchanged.
Toggles the colliders of the effect mesh objects.
Creates one if not existing.
Parameters
doEnable
Determines whether the effect mesh objects should have an active collider or not.
label
The filter to determine which effect mesh objects have their visibility toggled. If an effect mesh object's anchor labels pass this filter, its visibility is toggled according to the 'shouldShow' parameter. Default value includes all labels.
Overrides the material of the effect mesh objects instantiated based on the provided label filter.
Parameters
newMaterial
The new material to apply to the effect mesh objects.
label
The filter to determine which effect mesh objects have their material overridden. If an effect mesh object's anchor labels pass this filter, its material is changed to the new material. Default value is a new instance of LabelFilter.
Creates effect mesh for all objects in the given room.
Parameters
room
The room to apply to
Creates an effect mesh for a specified anchor using the default border size.
Parameters
anchorInfo
The anchor information used to create the effect mesh.
Returns
An instance of EffectMeshObject representing the created effect mesh or null if the mesh could not be created.
Utility function that sets the parent transform for all effect mesh objects managed by this class.
Parameters
newParent
The new parent transform to which all effect mesh objects will be attached.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon