Unity Sdk

by 3Glasses
+

This is the Unity SDK for 3Glasses Devices.

( Updated 2 hours ago )

+STYLE:

[[./README/icon.png]]

** How to Use Select 3Glasses>EnableHeadDisplay from the main menu.

[[./README/EnableHeadDisplay.png]]

Make sure the EnableHeadDisplay is selected in the 3Glasses drop-down box.

Now the Three3GlassesManager script is bind in your main camera, and there are some Properties can control the HeadDisplay's behavior.

[[./README/TreeGlassesCameraProperty.png]] * Properties:

+ATTR_HTML: :border 2 :rules all :frame border

| Property: | Discription | |-------------------+------------------------------------------------------------------------------| | FreezePosition | freeze the headdisplay's position | | FreezeRotation | freeze the headdisplay's rotation | | Eye Distance | The distance between the left and right camera in the HeadDisplay. | | Layer Mask | Includes or omits layers of objects to be rendered by the HeadDisplay device | | Enable JoyPad | Enable the 3Glasses Wand | | Only Head Display | If checked it will cancel the display of the maincamera |

** Get HeadDisplay Info

+BEGIN_SRC csharp

using ThreeGlasses;

//...

Vector3 pos = TGInput.GetHeadDisplayPosition(); Quaternion rotate = TGInput.GetHeadDisplayRotation();

+END_SRC

Get Wand Input There are two ways to get wand's info: * Get The InputExtendMethods class definit some methods for get the wand's info. you can get the info like this:

+BEGIN_SRC csharp

using ThreeGlasses;

//...

// get the back key status (down is true) TGInput.GetKey(InputType.LeftWand, InputKey.WandBack); // get the stick's info,Both the X axis and the Y axis are limited to between -1 and 1. Vector2 v = TGInput.GetStick(InputType.LeftWand);

+END_SRC

* Bind Script Bind the ThreeGlassesWandBind.cs on your wand object.

[[./README/TreeGlassesWandBindProperty.png]] ** Option

+ATTR_HTML: :border 2 :rules all :frame border

| Option | Description | |------------------+----------------------------------| | Type | wand's type | | Send To Children | send wand's info to all children | | Update Self | update the position and rotation | | Move Scale | scale wand's position | | Update Type | update local or world |

The children of the object who bind the ThreeGlassesWandBind.cs can implement OnWandChange for get the wand's info.

+BEGIN_SRC csharp

void OnWandChange(ThreeGlassesWand.Wand pack) { // do somethng }

+END_SRC