Looking Glass Documentation
Buy Looking GlassDiscord
  • Looking Glass User Guide
  • NEW! ✨Looking Glass Go✨
  • Displays
    • 🔮Looking Glass Go
      • ⚡Get Started with Looking Glass Go
      • 📱Using the Go Mobile App
      • 🔆Liteforms™
      • 🖥️Standalone and Desktop Modes
      • 🔌Power and LED States
      • 🪄Default Playlist
      • ⏭️What's Next?
      • 👜Accessories
      • ⚙️Advanced Playlist Creation
      • ⚙️Manual Firmware Update
      • ❓Common Troubleshooting Issues
    • 🔮Looking Glass 16" Light Field Displays
      • 🪄Looking Glass 16" Light Field Display (Landscape)
      • 🪄Looking Glass 16" Light Field Display (Portrait)
      • ❓Common Troubleshooting Issues
    • 🔮Looking Glass 32" Light Field Displays
      • 🪄Looking Glass 32" Light Field Display (Landscape)
      • 🪄Looking Glass 32" Light Field Display (Portrait)
      • ❓Common Troubleshooting Issues
    • 🔮Looking Glass 65" Light Field Display
    • 🔮Looking Glass Portrait
      • ⚡Get Started with Looking Glass Portrait
      • 🎇Demo Holograms
      • ❓Common Troubleshooting Issues
  • Software Tools
    • 📚Overview
    • 🌉Looking Glass Bridge
      • ✨Using Looking Glass Bridge
      • 🪟Display Settings on Windows
      • 🍎Display Settings on macOS
      • 🐧Display Settings on Linux
      • 👷Troubleshooting
    • 📽️Looking Glass Studio
      • 📚Using Looking Glass Studio
      • RGB-D Photo / Video
      • Quilt Images / Video
      • iPhone Portrait Photos
      • Android Depth Photos
        • Samsung Portrait Mode
      • Light Field Photosets
      • Exporting Holograms
      • Troubleshooting
    • 🧊Looking Glass Blocks
      • ✨Convert any image into a hologram
      • ⬆️Uploading, editing and sharing Quilts
      • 🥽Viewing your holograms on different platforms
    • 🎬Hologram Video
    • 🔆Liteforms™
      • 🪟Get Started on Windows
      • 🍎Get Started on MacOS
      • 🧙Making Custom Liteforms
      • 🏪Configure Liteforms for Kiosk Setup
    • 👀Looking Glass Model Viewer
    • 🧪Experiments
      • 📽️Media Encoder
      • ⏩Looking Glass Media Encoder
  • Key Concepts
    • 🔑Hologram 101
      • 🎉Making great holograms
      • 🌎Holograms in the real world
      • 👾Holograms, but virtual
    • 🔍How does Looking Glass Work?
    • 📸Virtual Camera
    • 🧊3D Design Guidelines
      • Lighting
      • Post-Processing
      • Scene Composition
      • Materials & Textures
      • Performance
    • 💡Quilts
      • 🎬Quilt Video Encoding
    • 💡Light Fields
      • ⚡Linear Light Field Capture
    • 📽️Filming a Looking Glass
  • Creator Tools
    • 🎨Overview
    • 🔌Unity
      • ⚡Using Unity with Looking Glass
      • Setting up your Development Environment
      • Example Scenes
      • Prefabs
        • Hologram Camera
        • 3D Cursor
        • Dual Monitor Application
      • Script Reference
        • HologramCamera.cs
        • LKGDisplaySystem.cs
        • QuiltCapture.cs
        • Cursor3D.cs
        • OrbitControls.cs
        • BlockUploader.cs
        • MobileDMAController.cs
        • iOS Sample Scene Scripts
          • ChangeInteractionModality.cs
          • XYSlider.cs
          • XYSpotlight.cs
          • AudioRotateControl.cs
          • ModelController.cs
          • DemoIOSUIController.cs
          • PageHandler.cs
          • PageConnectHandler.cs
          • PageCalibrateHandler.cs
          • PageTestHandler.cs
          • DynamicAlcove.cs
      • Package Integrations
        • Built-in Render Pipeline Post-Processing
      • Developing for iOS
      • Depth of Field and Other Post-Processing Effects
      • Quilt Video Audio and Playback
      • Developing for Ultraleap Hand Tracking on Looking Glass
      • Looking Glass Pro (Legacy)
      • Additional Support
      • Change Log
    • 🍹Blender
    • 🔌Unreal Engine
      • 🗒️Change Log and Old Versions
      • 💽Installing the Unreal Engine plugin
      • 🎥Using the Unreal Engine Plugin
        • Using the HoloPlay Capture
        • Exporting Quilt Images and Video with Sequencer
      • Accessing HoloPlay Data with Blueprint Scripting
      • Packaging the Project
      • Unreal Engine 4 (Legacy Support)
        • Unreal Engine 4 Quick Start
          • Using the HoloPlay Capture
          • Exporting Quilt Images and Video with Sequencer
    • 🌐WebXR
      • 🔶PlayCanvas
      • 3️⃣3️⃣ Three.JS
      • ⚛️React-Three-Fiber
      • 🌈Spline
  • Tutorials
    • 📱Running Looking Glass Displays with iOS Devices
    • Ⓜ️Capturing Light Fields in Maya
    • 🧑‍🔬Using ShaderToy with Looking Glass
    • 🎨Sculpting with Adobe Medium and Looking Glass
    • 🔍Turn Videogames Holographic with Refract
    • 🖐️Building with Leap Motion
  • Developer Docs
    • ⚙️Looking Glass Bridge SDK
      • 🪛Web Application Integration
      • 🔌Integrating Native Applications
      • 📓Native Function Reference
    • 🐦Looking Glass Core Migration Guide
  • Third Party Software
    • 🗡️3D Slicer
    • 🔬VTK (Visualization Toolkit)
    • 🗺️ParaView
    • 🔩Community Made Tools & Projects
  • Legacy Software
    • 📡3D Model Importer
      • 3D Model Importer App Guide
      • 3D Model Importer App Reference
    • 🎭Diorama
      • Change Log
    • 🎞️Depth Recorder
    • 📸Lightfield Photo App
    • 🍍Looking Glass Core Overview
    • 🍽️Looking Glass Core SDK
      • C API Overview
        • HoloPlayCore.h
          • State Functions
          • General-Query-Functions
          • Device-Query-Functions
        • libHoloPlayCore.h
        • HoloPlayShaders.h
    • 🔰Looking Glass Core JS
      • API
        • HoloPlayCore.Client
        • HoloPlayCore.Message
        • HoloPlay Service Related
        • examples
  • Legacy Hardware
    • 🔻Looking Glass 8.9"
    • 🔻Looking Glass 15.6"
    • 🔻Looking Glass 8K
    • 🔻Looking Glass 16"
    • 🔻Looking Glass 32"
    • 🔻Looking Glass Pro
  • 💬Contact Us
  • 🛠️FAQ & Troubleshooting
Powered by GitBook

Follow us

  • Twitter
  • Instagram
  • LinkedIn
On this page
  • Constructor
  • Methods
  • InitMessage
  • InfoMessage
  • ShowMessage
  • CacheMessage
  • ShowCachedMessage
  • CheckMessage
  • DeleteMessage
  • WipeMessage

Was this helpful?

  1. Legacy Software
  2. Looking Glass Core JS
  3. API

HoloPlayCore.Message

PreviousHoloPlayCore.ClientNextHoloPlay Service Related

Last updated 3 years ago

Was this helpful?

A class to represent messages being sent over to HoloPlay Service. This is the base class, and users should aim to use the child classes that we provide below if possible unless you need a very specific custom Message. If you use the base class, you will have to construct the objects yourself.

All Message classes have cmd, and only quilt related ones have bin for binary data of the quilt.

See here for a list of .

Constructor

  • cmd object of the corresponsding settings for each command type.

  • bin binary data of the quilt, if it is a quilt-related message.

Examples

let msg = new Message({"info": ""}, binaryData);
client.sendMessage(msg)
  .then(() => console.log("Response received"))
  .catch((err) => console.log(err))

Methods

.toCbor()

Convert the class instance into CBOR format.

InitMessage

Extends Message

Extends the base Message class. If you provide following parameters in the constructor of HoloPlayCore.Client, this command will be called automatically, and you don't need to call it yourself.

Parameters

  • appId string optional; an identifier to specify what application it is in HoloPlay Service. If the same appId is provided, different connections will be treat as the same application and have access to cached quilts. If not provided, HoloPlay Service will generate a random string.

  • isGreedy boolean optional; this feature is currently not implemented.

  • oncloseBehavior string optional, determines behavior when all instances of a given app ID disconnect. Can be wipe, hide, or none, default is hide.

    • wipe : clear the screen, display the default background.

    • hide : hide the window on the Looking Glass.

    • none : do nothing.

  • debug boolean optional; default is false. If true, there will be logging messages in console.

Examples

let initMsg = new InitMessage("Test Looking Glass app", false, "wipe");
client.sendMessage(initMsg)
 .then((res) => console.log(res));

InfoMessage

Extends Message

Extends the base Message class. Gets info from HoloPlay Service.

Examples

let infoMsg = new InfoMessage();
client.sendMessage(infoMsg)
 .then((res) => console.log(res));

ShowMessage

Extends Message

Extends the base Message class. Show a quilt directly without caching it.

Parameters

  • bindata Uint8Array, optional, default '', but you will have to set it later.

  • targetDisplay int, optional, default 0.

Examples

let xhttp = new XMLHttpRequest();
xhttp.responseType = 'arraybuffer';
xhttp.onreadystatechange = function () {
    if (this.readyState == 4) {
        if (this.status == 200) {
            const quiltData = new Uint8Array(this.response);
            const showCmd = new ShowMessage(
                {vx: 5, vy: 9, vtotal: 45, aspect: 1.6},
                quiltData,
                0
            );
            client.sendMessage(showCmd)
            .then(() => alert("Quilt displayed!"));
        } else {
            console.log("Could not load " + quiltUrl + "!");
        }
    }
};
xhttp.open("GET", quiltUrl, true);
xhttp.send();

CacheMessage

Extends Message

Extends the base Message class. This message sends a quilt image to the cache, and you can send a ShowCachedMessage later to show it.

Parameters

  • name string, the name of the quilt being cached, for later retrieval.

  • bindata (optional, default '').

  • show (optional, default false).

ShowCachedMessage

Extends Message

Extends the base Message class. Retrieve and show a previously cached quilt by name. If you're not sure if a quilt is cached, use the CheckMessage command to check. If you try to show an uncached image, HoloPlay Service will respond with error code 3.

Parameters

  • name string, the name of the quilt in the cache.

  • targetDisplay int, optional, default 0.

CheckMessage

Extends Message

Check if a quilt exist in the cache. Extends the base Message class.

Parameters

  • name string name of the quilt (optional, default '').

Example

let checkCmd = new CheckMessage('quilt1')
client.sendMessage(checkCmd)
  .then((res) => {
    if (res['error'] === 0) {
        // quilt found in cache
        let showCachedCmd = new ShowCachedMessage('quilt1');
        client.sendMessage(showCachedCmd);
    } else if (res['error'] === 5) {
        // quilt not cached
        let showCmd = new ShowMessage({vx:5, vy:9, aspect: 1.6}, quiltBinaryData);
        client.sendMessage(showCmd);
    }
  });

DeleteMessage

Extends Message

Extends the base Message class. Deletes a previously cached quilt from HoloPlay Service.

Parameters

  • name string; name of the quilt.

WipeMessage

Extends Message

Extends the base Message class. Wipes the image in Looking Glass and displays the background image.

Parameters

  • targetDisplay (optional, default 0).

Returns information of the connected Looking Glass devices, in the format of .

Returns information of the connected Looking Glass devices, in the format of .

settings object optional, default {vx: 1,vy: 1,aspect:1.6}, for detailed format see .

settings object optional, default {vx:1,vy:1,aspect:1.6}, for detailed format see .

settings object optional, default {vx:5,vy:9,aspect:1.6}, for detailed format see . (THERE'S STILL INCONSISTENCY IN WHAT THE DEFAULT SETTINGS ARE, NEEDS TO BE RESOLVED)

🔰
quilt settings
quilt settings
quilt settings
error codes
device status response
device status response