Example #1
0
    /*
     * HoloLensの向いている方向と自己位置をJsonSelfLocationの形式で渡すメソッド
     */
    public JsonSelfLocation getSelfLocation()
    {
        var theta          = degree(Math.Atan2(camera.transform.forward.x, camera.transform.forward.z));
        JsonSelfLocation l = new JsonSelfLocation(theta + cordinateGap.gapAngle, getCurrentLocationOnPullDogCordinates());

        return(l);
    }
Example #2
0
    /*
     * AndroidにJSONに成形したデータを渡すメソッド
     * データ型はJSONStructureを参照のこと
     */
    public void sendMessageToAndroid(JsonSelfLocation jsl, JsonMessage message)
    {
        JsonDataFromHoloLens jdfh = new JsonDataFromHoloLens(jsl, message);
        string json = JsonConvert.SerializeObject(jdfh);

                #if UNITY_UWP
        sendMessage(json);
                #endif
    }
Example #3
0
 public JsonDataFromHoloLens(JsonSelfLocation jsl, JsonMessage jm)
 {
     selfLocation = jsl;
     message      = jm;
 }