Somnia Docs
Developer DiscordTestnet Homepage
Somnia Playground
Somnia Playground
  • Welcome
  • Getting Started
    • Create your first avatar
    • Create your first world
    • Place your first object
    • Create your first object
    • Creating a custom world
  • Beginner guides
    • Using the mml editor and creating your first dynamic object
    • The mml editor tour
  • Components
    • Avatar Builder
    • Item Builder
    • Item Gallery
    • World Builder
    • MML and MML Editor
  • Resources
    • MML Reference Docs
    • MML Examples
      • A Basic Scene With Models And Cubes
      • A Dice With Advanced Animation
      • A 3D Video Player
      • Interaction With A Weather API
      • A Simple Clock
      • Tic Tac Toe Game
    • Glossary
Powered by GitBook
On this page
  • Elements
  • Events
Export as PDF
  1. Resources

MML Reference Docs

This page has the reference documentation for MML. This can also be found on the mml website https://mml.io/docs/reference

PreviousMML and MML EditorNextMML Examples

Elements

All of the MML Elements with available attributes and examples.

  • The m-group element can contain other MML tags, allowing all of them to be transformed as single item.

  • The m-cube element is a primitive 3D cube that can be coloured. It is often used for debugging or initial development purposes.

  • The m-sphere element is a primitive 3D sphere that can be coloured. It is often used for debugging or initial development purposes.

  • The m-cylinder element is a primitive 3D cylinder that can be coloured. It is often used for debugging or initial development purposes.

  • The m-light element is a light that supports various types (e.g. point, spotlight) and can be coloured.

  • The m-plane element is a primitive 3D plane that can be coloured.

  • The m-model element is a 3D model. It can be used to load and display various 3D model file formats, such as OBJ, FBX, or GLTF, depending on the rendering engine being used. The model can be positioned, rotated, and scaled within the 3D scene. It also supports animations.

  • The m-character element is a 3D character. It supports containing other m-model elements, allowing for composing a character from multiple models.

  • The m-frame element is a 3D frame. It enables composing other MML documents into the document and transforming them as a unit.

  • The m-audio element is used to play audio in a 3D scene.

  • The m-image element is used to display an image in a 3D scene.

  • The m-video element is used to display a video in a 3D scene.

  • The m-label element is used to display text on a plane in a 3D scene.

  • The m-position-probe element is used to request the position of a user (either camera or avatar depending upon the experience).

  • The m-prompt element is used to request a string from the user when the element is clicked in a 3D scene.

  • The m-interaction element is used to describe an action that a user can take at a point in 3D space.

  • The m-chat-probe element is used to receive messages from a chat system. Which chat system that is depends on the client implementation.

  • The m-attr-anim element is used to describe document time-synchronized changes to element attributes.

Events

All of the MML Event types and their properties.

  • A class that extends Event | Event.

  • A class that extends Event | Event.

  • Received when a user clicks on a 3D object.

  • Received when a user stops colliding with an element.

  • Received when a user moves the collision point they are colliding at on an element.

  • Received when a user starts colliding with an element.

  • Received when a user interacts with an m-interaction.

  • Received when a user enters the range of an m-position-probe.

  • Received when a user leaves the range of an m-position-probe after having entered.

  • Received when a user moves after having entered the range of an m-position-probe.

  • Received when a user triggers a prompt with a value.

  • A class that extends Event | Event.

You can go to the mml website to learn more about these comonents ->

<m-group>
<m-cube>
<m-sphere>
<m-cylinder>
<m-light>
<m-plane>
<m-model>
<m-character>
<m-frame>
<m-audio>
<m-image>
<m-video>
<m-label>
<m-position-probe>
<m-prompt>
<m-interaction>
<m-chat-probe>
<m-attr-anim>
ConnectionEvent
MMLChatEvent
MMLClickEvent
MMLCollisionEndEvent
MMLCollisionMoveEvent
MMLCollisionStartEvent
MMLInteractionEvent
MMLPositionEnterEvent
MMLPositionLeaveEvent
MMLPositionMoveEvent
MMLPromptEvent
RemoteEvent
https://mml.io/docs/reference/elements/m-group