Document toolboxDocument toolbox

Private & Confidential

v1.2.21 Scripting Reference

IglooManager Prefab

A prefab which contains the following scripts, IglooManager.cs, and NetworkManager.cs. The prefab should be included somewhere in your scene, it is set to DontDestroyOnLoad

IglooManager.cs

Manges all things Igloo and has the following properties and functions

IglooManager.cs is a static class which can be accessed from other scripts like so

 

Igloo.IglooManager manager = Igloo.IglooManager.Instance;

createOnAwake

Type: boolean, Default is enabled

When enabled CreateIgloo() is called on Awake().

saveOnQuit

Type: boolean, Default is enabled

When enabled any settings changed during runtime are saved on application close or on the destruction of IglooManager.cs

cameraPrefab

Type: Unity GameObject - Default is unassigned

Assigns a camera prefab allowing camera effects to be applied, see the cameraPrefab property of DisplayManager.cs for more information.

followTransform

Type: Unity Transform- Default is unassigned

Optionally assign a Transform for the camera to follow, by default only the position if followed and rotation is ignored. This can be changed using the FollowObjectTrasform.cs script attached to the Igloo prefab

When assigned the Igloo player system will be disabled.

igloo

Type: Unity GameObject - Default is unassigned

Advanced - Not for general use. This should only ever be assigned in the Editor when creating/testing new camera configurations.

CreateIgloo

 

public void CreateIgloo (GameObject parent = null, Transform follow = null)

 

Creates the Igloo prefab which loads an XML settings file IglooSettings.xml for the configuration of a custom camera system and optional player system to allow playback of your Unity project within an Igloo System. If no settings file is found then default settings will be generated.

parent

An optional parameter which allows to the Igloo prefab instantiated by the function to be parented to the given object. If unassigned the prefab will be parented to the IglooManager GameObject.

follow

An optional parameter which assigns the followTransform property

RemoveIgloo

 

public void RemoveIgloo(bool save = true)

Removes the Igloo prefab from the scene if it exists

save

Optional parameter to specify whether current settings should be saved before removing.

SaveSettings

 

Saves current settings to the IglooSettings.xml

GetNetworkManager

Returns the NetworkManager component of the IglooManager prefab. Useful for adding and handling custom message receivers.

NetworkManager.cs

Manages network message sending and receiving using the Open Sound Control (OSC) messaging protocol. Default ports are Sending: 9001, Receiving: 9007. These can be changed in the IglooSettings.xml.

This NetworkManager.cs class is dependant on the extOSC package, which is available for free on the asset store but has been included for convenience.

oscIn

Type: OSCReceiver

OSC receiver class used to handle incoming messages. oscIn can be accessed and used in your own code to add additional functionality. Refer to the extOSC documentation for full usage.

 

oscOut

Type: OSCSender

Same as a receiver but for sending messages.

inPort

Type: int

Receiving port

outPort

Type: int

Sending port

Igloo Prefab

A prefab which contains the following scripts, DisplayManager.cs, and PlayerManager.cs

DisplayManager.cs

Creates and manages Display objects also allowing the following optional functionality

  • Compositing - multiple camera render textures can be combined into a single texture

  • Cubemap conversion - multiple cameras render textures can be processed to perform cube map to equirectangular conversion

  • Texture Sharing - resulting textures can be shared via the TextureShareUtility

headManager

Type: HeadManager

HeadManager.cs class, used for specifying head position, head tracking and 3D eye spacing

cameraPrefab

Type: GameObject

This allows you to define a camera that contains extra components or variables that you would like to use for all Igloo Cameras that are created by this script.
This is very useful for camera-based effects, as most are only applied to the main camera and not globally to all cameras in the scene.

Note - watch out for incompatible camera and image effects. Especially important if you’re converting a complex, pre-existing Unity project, is being aware of certain camera tricks and effects that do not play well in the 360 formats. This is likely to include camera-aligned particle systems and billboards, certain types of anti-aliasing and depth reliant effects such as depth-of-field. There are of course many 3rd party effects that we have not tested for compatibility, so careful testing is the best approach.

displays

Type: List<Display>

List of Display objects created by the Display manager.

sharingName

Type: string

Sharing name if textureShareMode is enabled

useCompositeTexture

Type: bool

When enabled a single render texture will be created, it’s resolution will be the combined resolution of cameras defined in Displays. This texture will be assigned as the target texture for every camera with appropriate viewport settings.

Note - the setting is ignored if useCubemapToEquirectangular is enabled

useFramepackTopBottom3D

Type: bool

When either useCubemapToEquirectangular or useCompositeTexture are enabled and the 3D is being used, the resulting textures for the left and right eyes can be combined into a single texture, left on top, right on the bottom.

textureShareMode

Type: TextureShareMode enum

When either useCubemapToEquirectangular or useCompositeTexture are enabled and multiple Display textures are composited into a single texture, the method for sharing the resulting texture is specified using this enum

NONE- do not share

SPOUT - share texture via Spout

NDI - share texture via NDI

useCubemapToEqui

Type: bool

Enables Cubemap to Equirectangular system, assumes Displays have been configured appropriately with Cubemap faces assigned.

HorizontalFOV

Type: float

When useCubemapToEqui is enabled. This is the range of angles covered by the render on the horizontal axis. Use 360° for a full render, 180° for a half-sphere, and so on.

VerticalFOV

Type: float

When useCubemapToEqui is enabled. This is the range of angles covered by the render on the horizontal axis. Use 360° for a full render, 180° for a half-sphere, and so on

Setup

 

Setup Display manager and create Display object using DisplaySettings

GetSettings

 

Returns DisplaySettings, used by serialiser for saving settings

CreateDisplays

 

Removes current Displays if they exist and creates new Displays based on DisplayItem array parameter

RemoveDisplays

 

Destroys all Display objects

SetDisplaysEnabled

 

Sets the enabled state for all Display cameras

GetCameras

 

Gets all cameras from all Display objects. Useful for modifying camera properties e.g

 

 

PlayerManager.cs

playerName

Type: string - Default is 'player'

Player name. Used to process player events for correct player. The default should only be changed if more than one player is being used.

UsePlayer

Type: bool

Sets player system enabled state. When enabled followObjectTransform will be disabled automatically.

headManager

Type: HeadManager

Igloo head manager object, used for setting the player orientation

movementInput

Type: MOVEMENT_INPUT enum

STANDARD : player movement is controlled using the default Unity input settings

GYROSC: player movement is controlled via OSC networks messaging from GyrOSC app http://www.bitshapesoftware.com/instruments/gyrosc/

movementMode

Type: MOVEMENT_MODE enum

WALKING: gravity enabled, colliders enabled

FLYING : gravity disabled, colliders enabled

FLYING_GHOST: gravity disabled, colliders disabled

rotationInput

Type: ROTATION_INPUT enum

STANDARD: player rotation is controlled using the default Unity input settings

WARPER: player rotation is controlled via OSC network message from IglooWarper application

rotationMode

Type: ROTATION_MODE enum

IGLOO_360: display rotation is static and does not follow the player's rotation, optimal settings for a standard 360-degree Igloo structure

IGLOO_NONE_360: display follows the rotation of the player in the y-axis but is static in the x-axis. Optimal for non-360 igloo structures

GAME: display follows the rotation of the player in both x and y-axis, like a standard gaming control system.

crouchMode

Type: CROUCH_MODE enum

ONE: Movement is unbound between crouch Min and crouch Max. meaning the character can freely move between those values and will not move on its own.

TWO: Movement is bound via a spring interpretation between the input value (clamped by crouch Min and crouch Max.) and 0.
However the initial input is not 'sprung' meaning you can freely, and quickly, crouch, but you will then spring back to standing when you stop crouching.

THREE: Movement is bound via a spring interpretation between the input value (clamped by crouch Min and crouch Max.) and 0. Spring force is always calculated.

SmoothTime

Type: float

takes a float value to set the rotation smoothing amount. 1 is much smoothing, 10 - is no smoothing

 

FollowObjectTransform.cs

This Script allows you to set the 360 camera to follow any object in the scene, including all aspects of its transform data. The advantage of also being able to follow only certain aspects of this T=ransform data is also extremely useful.

e.g: Following a 3rd Person camera, with X,Y,Z movement, but only following Rotation Y, allowing for slight tilt in the camera to make it seem more.

Example usage

Enable object following

 

 

Disable object following

 

 

  • Object Transform:
    Type: Transform | Default Setting: null
    The transform of the object you wish the camera rig to follow.


  • Follow Position:
    Type: Boolean | Default Setting: true
    Should the camera rig follow the ObjectTransform's position?


  • Follow Rotation:
    Type: Boolean | Default Setting: false
    Should the camera rig follow the ObjectTransform's rotation?


  • Follow Scale:
    Type: Boolean | Default Setting: false
    Should the camera rig follow the ObjectTransform's scale?


  • Position Vector:
    Type: Enum | Default Setting: XYZ
    This is what position axis the camera rig will follow. Other options are:

    • XYZ

    • X

    • Y

    • Z

    • XY

    • XZ

    • YZ

  • Rotation Vector:
    Type: Enum | Default Setting: XYZ
    This is what rotation axis the camera rig will follow. Other options are:

    • XYZ

    • X

    • Y

    • Z

    • XY

    • XZ

    • YZ


  • Scale Vector:
    Type: Enum | Default Setting: XYZ
    This is what scale axis the camera rig will follow. Other options are:

    • XYZ

    • X

    • Y

    • Z

    • XY

    • XZ

    • YZ

  • Position Offset:
    Type: Vector3 | Default Setting: 0,0,0
    Sometimes you will want to offset the position that the camera rig is following. This is usually when the camera rig is not high enough as it follows the pivot of an object, not its centre.
    This allows you to offset the position permanently.

 

 

(c) Igloo Vision 2020