parent
ab6fdfb790
commit
28b3f3b09d
76 changed files with 2067 additions and 7637 deletions
File diff suppressed because it is too large
Load Diff
@ -1,13 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 69c0f378d0dcf504980865e62df80079 |
||||
timeCreated: 1523610448 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,11 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 400c2cde369742e4690d5216c5c3b3c3 |
||||
MonoImporter: |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,9 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: fa57c10b7d260f14097cfff344c082df |
||||
folderAsset: yes |
||||
timeCreated: 1482467657 |
||||
licenseType: Free |
||||
DefaultImporter: |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,127 +0,0 @@ |
||||
#region licence/info |
||||
// OSC.NET - Open Sound Control for .NET |
||||
// http://luvtechno.net/ |
||||
// |
||||
// Copyright (c) 2006, Yoshinori Kawasaki |
||||
// All rights reserved. |
||||
// |
||||
// Changes and improvements: |
||||
// Copyright (c) 2006-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
// As included with http://reactivision.sourceforge.net/ |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
// * Neither the name of "luvtechno.net" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY |
||||
// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
#endregion licence/info |
||||
|
||||
using System; |
||||
using System.Collections; |
||||
|
||||
/// <summary> |
||||
/// VVVV OSC Utilities |
||||
/// </summary> |
||||
namespace OSC.NET |
||||
{ |
||||
/// <summary> |
||||
/// OSCBundle |
||||
/// </summary> |
||||
public class OSCBundle : OSCPacket |
||||
{ |
||||
protected const string BUNDLE = "#bundle"; |
||||
private DateTime timestamp = new DateTime(); |
||||
|
||||
public OSCBundle(DateTime ts, bool extendedMode = false) : base(extendedMode) |
||||
{ |
||||
this.address = BUNDLE; |
||||
this.timestamp = ts; |
||||
} |
||||
|
||||
public OSCBundle(long ts, bool extendedMode = false) : base (extendedMode) |
||||
{ |
||||
DateTime start = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); |
||||
timestamp = start.AddMilliseconds(ts).ToLocalTime(); |
||||
} |
||||
|
||||
|
||||
public OSCBundle(bool extendedMode = false) : base (extendedMode) |
||||
{ |
||||
this.address = BUNDLE; |
||||
this.timestamp = DateTime.Now; |
||||
} |
||||
|
||||
override protected void pack() |
||||
{ |
||||
ArrayList data = new ArrayList(); |
||||
|
||||
addBytes(data, packString(this.Address)); |
||||
padNull(data); |
||||
addBytes(data, packTimeTag(timestamp)); // fixed point, 8 bytes |
||||
|
||||
foreach(OSCPacket oscPacket in this.Values) |
||||
{ |
||||
if (oscPacket != null) |
||||
{ |
||||
byte[] bs = oscPacket.BinaryData; |
||||
addBytes(data, packInt(bs.Length)); |
||||
addBytes(data, bs); |
||||
} |
||||
else |
||||
{ |
||||
// TODO |
||||
} |
||||
} |
||||
|
||||
this.binaryData = (byte[])data.ToArray(typeof(byte)); |
||||
} |
||||
|
||||
public static new OSCBundle Unpack(byte[] bytes, ref int start, int end, bool extendedMode = false) |
||||
{ |
||||
|
||||
string address = unpackString(bytes, ref start); |
||||
//Console.WriteLine("bundle: " + address); |
||||
if(!address.Equals(BUNDLE)) return null; // TODO |
||||
|
||||
DateTime timestamp = unpackTimeTag(bytes, ref start); |
||||
OSCBundle bundle = new OSCBundle(timestamp, extendedMode); |
||||
|
||||
while(start < end) |
||||
{ |
||||
int length = unpackInt(bytes, ref start); |
||||
int sub_end = start + length; |
||||
bundle.Append(OSCPacket.Unpack(bytes, ref start, sub_end, extendedMode)); |
||||
} |
||||
|
||||
return bundle; |
||||
} |
||||
|
||||
public DateTime getTimeStamp() { |
||||
return timestamp; |
||||
} |
||||
|
||||
override public void Append(object value) |
||||
{ |
||||
if( value is OSCPacket) |
||||
{ |
||||
values.Add(value); |
||||
} |
||||
else |
||||
{ |
||||
// TODO: exception |
||||
} |
||||
} |
||||
|
||||
override public bool IsBundle() { return true; } |
||||
} |
||||
} |
||||
|
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 9670623378c1d1344912298eb9dc0878 |
||||
timeCreated: 1482467657 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,213 +0,0 @@ |
||||
#region licence/info |
||||
// OSC.NET - Open Sound Control for .NET |
||||
// http://luvtechno.net/ |
||||
// |
||||
// Copyright (c) 2006, Yoshinori Kawasaki |
||||
// All rights reserved. |
||||
// |
||||
// Changes and improvements: |
||||
// Copyright (c) 2006-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
// As included with http://reactivision.sourceforge.net/ |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
// * Neither the name of "luvtechno.net" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY |
||||
// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
#endregion licence/info |
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.IO; |
||||
using System.Text; |
||||
|
||||
namespace OSC.NET |
||||
{ |
||||
/// <summary> |
||||
/// OSCMessage |
||||
/// |
||||
/// Contains an address, a comma followed by one or more type identifiers. then the data itself follows in binary encoding. |
||||
/// </summary> |
||||
public class OSCMessage : OSCPacket |
||||
{ |
||||
// These Attributes adhere to the OSC Specs 1.0 |
||||
protected const char INTEGER = 'i'; // int32 8byte |
||||
protected const char FLOAT = 'f'; //float32 8byte |
||||
protected const char LONG = 'h'; //int64 16byte |
||||
protected const char DOUBLE = 'd'; // float64 16byte |
||||
protected const char STRING = 's'; // padded by zeros |
||||
protected const char SYMBOL = 'S'; // same as STRING really |
||||
protected const char BLOB = 'b'; // bytestream, starts with an int that tells the total length of th stream |
||||
protected const char TIMETAG = 't'; // fixed point floating number with 32bytes (16bytes for totaldays after 1.1.1900 and 16bytes for fractionOfDay) |
||||
protected const char CHAR = 'c'; // bit |
||||
protected const char COLOR = 'r'; // 4x8bit -> rgba |
||||
|
||||
//protected const char TRUE = 'T'; |
||||
//protected const char FALSE = 'F'; |
||||
protected const char NIL = 'N'; |
||||
//protected const char INFINITUM = 'I'; |
||||
|
||||
//protected const char ALL = '*'; |
||||
|
||||
// These Attributes are added for convenience within vvvv. They are NOT part of the OSC Specs, but are VERY useful if you want to make vvvv talk to another instance of vvvv |
||||
// Using them requires to set the ExtendedVVVVMethod property to true (with the constructor or with the Unpack methods, depending if you want to send or receive) |
||||
protected const char VECTOR2D = 'v'; // synonym to dd |
||||
protected const char VECTOR3D = 'V'; // synonym to ddd |
||||
protected const char QUATERNION = 'q'; // synonym to dddd |
||||
protected const char MATRIX4 = 'M'; // for 4x4 Matrices with float, so synonym to ffffffffffffffff |
||||
|
||||
|
||||
public OSCMessage(string address, bool extendedMode = false) : base(extendedMode) |
||||
{ |
||||
this.typeTag = ","; |
||||
this.Address = address; |
||||
} |
||||
public OSCMessage(string address, object value, bool extendedMode = false) : base(extendedMode) |
||||
{ |
||||
this.typeTag = ","; |
||||
this.Address = address; |
||||
Append(value); |
||||
} |
||||
|
||||
override protected void pack() |
||||
{ |
||||
ArrayList data = new ArrayList(); |
||||
|
||||
addBytes(data, packString(this.address)); |
||||
padNull(data); |
||||
addBytes(data, packString(this.typeTag)); |
||||
padNull(data); |
||||
|
||||
foreach(object value in this.Values) |
||||
{ |
||||
if(value is int) addBytes(data, packInt((int)value)); |
||||
else if(value is long) addBytes(data, packLong((long)value)); |
||||
else if(value is float) addBytes(data, packFloat((float)value)); |
||||
else if(value is double) addBytes(data, packDouble((double)value)); |
||||
else if(value is string) { |
||||
addBytes(data, packString((string)value)); |
||||
padNull(data); |
||||
} |
||||
else if (value is Stream) { |
||||
addBytes(data, packBlob((Stream)value)); |
||||
padNull(data); |
||||
} |
||||
//else if (value is RGBAColor) addBytes(data, packColor((RGBAColor)value)); |
||||
else if (value is char) addBytes(data, packChar((char)value)); |
||||
else if (value is DateTime) |
||||
{ |
||||
addBytes(data, packTimeTag((DateTime)value)); |
||||
} |
||||
} |
||||
|
||||
this.binaryData = (byte[])data.ToArray(typeof(byte)); |
||||
} |
||||
|
||||
|
||||
public static OSCMessage Unpack(byte[] bytes, ref int start, bool extendedMode = false) |
||||
{ |
||||
string address = unpackString(bytes, ref start); |
||||
//Console.WriteLine("address: " + address); |
||||
OSCMessage msg = new OSCMessage(address, extendedMode); |
||||
|
||||
char[] tags = unpackString(bytes, ref start).ToCharArray(); |
||||
//Console.WriteLine("tags: " + new string(tags)); |
||||
foreach(char tag in tags) |
||||
{ |
||||
//Console.WriteLine("tag: " + tag + " @ "+start); |
||||
if(tag == ',') continue; |
||||
else if(tag == INTEGER) msg.Append(unpackInt(bytes, ref start)); |
||||
else if(tag == LONG) msg.Append(unpackLong(bytes, ref start)); |
||||
else if(tag == DOUBLE) msg.Append(unpackDouble(bytes, ref start)); |
||||
else if(tag == FLOAT) msg.Append(unpackFloat(bytes, ref start)); |
||||
else if (tag == STRING || tag == SYMBOL) msg.Append(unpackString(bytes, ref start)); |
||||
|
||||
else if (tag == CHAR) msg.Append(unpackChar(bytes, ref start)); |
||||
else if (tag == BLOB) msg.Append(unpackBlob(bytes, ref start)); |
||||
//else if (tag == COLOR) msg.Append(unpackColor(bytes, ref start)); |
||||
else if (tag == TIMETAG) msg.Append(unpackTimeTag(bytes, ref start)); |
||||
|
||||
else Console.WriteLine("unknown tag: " + tag); |
||||
} |
||||
return msg; |
||||
} |
||||
|
||||
override public void Append(object value) |
||||
{ |
||||
if(value is int) |
||||
{ |
||||
AppendTag(INTEGER); |
||||
} |
||||
else if(value is long) |
||||
{ |
||||
AppendTag(LONG); |
||||
} |
||||
else if(value is float) |
||||
{ |
||||
AppendTag(FLOAT); |
||||
} |
||||
else if(value is double) |
||||
{ |
||||
AppendTag(DOUBLE); |
||||
} |
||||
else if(value is string) |
||||
{ |
||||
AppendTag(STRING); |
||||
} |
||||
else if (value is char) |
||||
{ |
||||
AppendTag(CHAR); |
||||
} |
||||
else if (value is Stream) |
||||
{ |
||||
AppendTag(BLOB); |
||||
} |
||||
else if (value is DateTime) |
||||
{ |
||||
AppendTag(TIMETAG); |
||||
} |
||||
/*else if (value is RGBAColor) |
||||
{ |
||||
AppendTag(COLOR); |
||||
}*/ |
||||
else |
||||
{ |
||||
Fallback(); |
||||
return; |
||||
} |
||||
values.Add(value); |
||||
} |
||||
|
||||
private void Fallback() |
||||
{ |
||||
AppendTag(NIL); |
||||
// values.Add("undefined"); |
||||
} |
||||
|
||||
protected string typeTag; |
||||
protected void AppendTag(char type) |
||||
{ |
||||
typeTag += type; |
||||
} |
||||
|
||||
override public bool IsBundle() { return false; } |
||||
|
||||
public override string ToString() |
||||
{ |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.Append(this.Address + " "); |
||||
for(int i = 0; i < values.Count; i++) |
||||
sb.Append(values[i].ToString() + " "); |
||||
return sb.ToString(); |
||||
} |
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 2e5455a72772ac84a8d970fe4da47144 |
||||
timeCreated: 1482467657 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,292 +0,0 @@ |
||||
#region licence/info |
||||
// OSC.NET - Open Sound Control for .NET |
||||
// http://luvtechno.net/ |
||||
// |
||||
// Copyright (c) 2006, Yoshinori Kawasaki |
||||
// All rights reserved. |
||||
// |
||||
// Changes and improvements: |
||||
// Copyright (c) 2006-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
// As included with http://reactivision.sourceforge.net/ |
||||
// |
||||
// Further implementations and specifications: |
||||
// Copyright (c) 2013 Marko Ritter <marko@intolight.de> |
||||
// As included with https://github.com/vvvv/vvvv-sdk/// |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
// * Neither the name of "luvtechno.net" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY |
||||
// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
#endregion licence/info |
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
using System.Text; |
||||
using System.Drawing; |
||||
|
||||
namespace OSC.NET |
||||
{ |
||||
/// <summary> |
||||
/// OSCPacket |
||||
/// </summary> |
||||
abstract public class OSCPacket |
||||
{ |
||||
public static readonly Encoding ASCIIEncoding8Bit; |
||||
public bool ExtendedVVVVMode { get; set; } |
||||
|
||||
static OSCPacket() |
||||
{ |
||||
ASCIIEncoding8Bit = Encoding.ASCII;//Encoding.GetEncoding(1252); |
||||
} |
||||
|
||||
public OSCPacket(bool extendedMode = false) |
||||
{ |
||||
this.ExtendedVVVVMode = extendedMode; |
||||
this.values = new ArrayList(); |
||||
} |
||||
|
||||
protected static void addBytes(ArrayList data, byte[] bytes) |
||||
{ |
||||
foreach(byte b in bytes) |
||||
{ |
||||
data.Add(b); |
||||
} |
||||
} |
||||
|
||||
protected static void padNull(ArrayList data) |
||||
{ |
||||
byte zero = 0; |
||||
int pad = 4 - (data.Count % 4); |
||||
for (int i = 0; i < pad; i++) |
||||
{ |
||||
data.Add(zero); |
||||
} |
||||
} |
||||
|
||||
internal static byte[] swapEndian(byte[] data) |
||||
{ |
||||
byte[] swapped = new byte[data.Length]; |
||||
for(int i = data.Length - 1, j = 0 ; i >= 0 ; i--, j++) |
||||
{ |
||||
swapped[j] = data[i]; |
||||
} |
||||
return swapped; |
||||
} |
||||
|
||||
protected static byte[] packInt(int value) |
||||
{ |
||||
byte[] data = BitConverter.GetBytes(value); |
||||
if(BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return data; |
||||
} |
||||
|
||||
protected static byte[] packLong(long value) |
||||
{ |
||||
byte[] data = BitConverter.GetBytes(value); |
||||
if(BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return data; |
||||
} |
||||
|
||||
protected static byte[] packFloat(float value) |
||||
{ |
||||
byte[] data = BitConverter.GetBytes(value); |
||||
if(BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return data; |
||||
} |
||||
|
||||
protected static byte[] packDouble(double value) |
||||
{ |
||||
byte[] data = BitConverter.GetBytes(value); |
||||
if(BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return data; |
||||
} |
||||
|
||||
protected static byte[] packString(string value) |
||||
{ |
||||
return ASCIIEncoding8Bit.GetBytes(value); |
||||
} |
||||
|
||||
|
||||
protected static byte[] packChar(char value) |
||||
{ |
||||
byte[] data = BitConverter.GetBytes(value); |
||||
if (BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return data; |
||||
} |
||||
private static void Copy(Stream src, Stream dst, int bufferSize = 81920) |
||||
{ |
||||
byte[] array = new byte[bufferSize]; |
||||
int count; |
||||
while ((count = src.Read(array, 0, array.Length)) != 0) |
||||
{ |
||||
dst.Write(array, 0, count); |
||||
} |
||||
} |
||||
protected static byte[] packBlob(Stream value) |
||||
{ |
||||
var mem = new MemoryStream(); |
||||
value.Seek(0, SeekOrigin.Begin); |
||||
//value.CopyTo(mem); |
||||
Copy(value, mem); |
||||
byte[] valueData = mem.ToArray(); |
||||
|
||||
var lData = new ArrayList(); |
||||
|
||||
var length = packInt(valueData.Length); |
||||
|
||||
lData.AddRange(length); |
||||
lData.AddRange(valueData); |
||||
|
||||
return (byte[])lData.ToArray(typeof(byte)); |
||||
} |
||||
|
||||
protected static byte[] packTimeTag(DateTime value) |
||||
{ |
||||
var tag = new OscTimeTag(); |
||||
tag.Set(value); |
||||
|
||||
return tag.ToByteArray(); ; |
||||
} |
||||
|
||||
protected static byte[] packColor(Color col) |
||||
{ |
||||
byte[] data = {col.R, col.G, col.B, col.A}; |
||||
if (BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return data; |
||||
} |
||||
|
||||
abstract protected void pack(); |
||||
protected byte[] binaryData; |
||||
public byte[] BinaryData |
||||
{ |
||||
get |
||||
{ |
||||
pack(); |
||||
return binaryData; |
||||
} |
||||
} |
||||
|
||||
protected static int unpackInt(byte[] bytes, ref int start) |
||||
{ |
||||
byte[] data = new byte[4]; |
||||
for(int i = 0 ; i < 4 ; i++, start++) data[i] = bytes[start]; |
||||
if(BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return BitConverter.ToInt32(data, 0); |
||||
} |
||||
|
||||
protected static long unpackLong(byte[] bytes, ref int start) |
||||
{ |
||||
byte[] data = new byte[8]; |
||||
for(int i = 0 ; i < 8 ; i++, start++) data[i] = bytes[start]; |
||||
if(BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return BitConverter.ToInt64(data, 0); |
||||
} |
||||
|
||||
protected static float unpackFloat(byte[] bytes, ref int start) |
||||
{ |
||||
byte[] data = new byte[4]; |
||||
for(int i = 0 ; i < 4 ; i++, start++) data[i] = bytes[start]; |
||||
if(BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return BitConverter.ToSingle(data, 0); |
||||
} |
||||
|
||||
protected static double unpackDouble(byte[] bytes, ref int start) |
||||
{ |
||||
byte[] data = new byte[8]; |
||||
for(int i = 0 ; i < 8 ; i++, start++) data[i] = bytes[start]; |
||||
if(BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
return BitConverter.ToDouble(data, 0); |
||||
} |
||||
|
||||
protected static string unpackString(byte[] bytes, ref int start) |
||||
{ |
||||
int count= 0; |
||||
for(int index = start ; bytes[index] != 0 ; index++, count++) ; |
||||
string s = ASCIIEncoding8Bit.GetString(bytes, start, count); |
||||
start += count+1; |
||||
start = (start + 3) / 4 * 4; |
||||
return s; |
||||
} |
||||
|
||||
protected static char unpackChar(byte[] bytes, ref int start) |
||||
{ |
||||
byte[] data = {bytes[start]}; |
||||
return BitConverter.ToChar(data, 0); |
||||
} |
||||
|
||||
protected static Stream unpackBlob(byte[] bytes, ref int start) |
||||
{ |
||||
int length = unpackInt(bytes, ref start); |
||||
|
||||
byte[] buffer = new byte[length]; |
||||
Array.Copy(bytes, start, buffer, 0, length); |
||||
|
||||
start += length; |
||||
start = (start + 3) / 4 * 4; |
||||
return new MemoryStream(buffer); |
||||
} |
||||
|
||||
protected static Color unpackColor(byte[] bytes, ref int start) |
||||
{ |
||||
byte[] data = new byte[4]; |
||||
for (int i = 0; i < 4; i++, start++) data[i] = bytes[start]; |
||||
if (BitConverter.IsLittleEndian) data = swapEndian(data); |
||||
|
||||
return Color.FromArgb (data[3],data[0],data[1],data[2]); |
||||
} |
||||
|
||||
protected static DateTime unpackTimeTag(byte[] bytes, ref int start) |
||||
{ |
||||
byte[] data = new byte[8]; |
||||
for (int i = 0; i < 8; i++, start++) data[i] = bytes[start]; |
||||
var tag = new OscTimeTag(data); |
||||
|
||||
return tag.DateTime; |
||||
} |
||||
|
||||
public static OSCPacket Unpack(byte[] bytes, bool extendedMode = false) |
||||
{ |
||||
int start = 0; |
||||
return Unpack(bytes, ref start, bytes.Length, extendedMode); |
||||
} |
||||
|
||||
public static OSCPacket Unpack(byte[] bytes, ref int start, int end, bool extendedMode = false) |
||||
{ |
||||
if(bytes[start] == '#') return OSCBundle.Unpack(bytes, ref start, end, extendedMode); |
||||
else return OSCMessage.Unpack(bytes, ref start, extendedMode); |
||||
} |
||||
|
||||
|
||||
protected string address; |
||||
public string Address |
||||
{ |
||||
get { return address; } |
||||
set |
||||
{ |
||||
// TODO: validate |
||||
address = value; |
||||
} |
||||
} |
||||
|
||||
protected ArrayList values; |
||||
public ArrayList Values |
||||
{ |
||||
get { return (ArrayList)values.Clone(); } |
||||
} |
||||
abstract public void Append(object value); |
||||
|
||||
abstract public bool IsBundle(); |
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 1d5e22291a499ea4e9b4eb0aa812e8b0 |
||||
timeCreated: 1482467657 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,77 +0,0 @@ |
||||
#region licence/info |
||||
// OSC.NET - Open Sound Control for .NET |
||||
// http://luvtechno.net/ |
||||
// |
||||
// Copyright (c) 2006, Yoshinori Kawasaki |
||||
// All rights reserved. |
||||
// |
||||
// Changes and improvements: |
||||
// Copyright (c) 2006-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
// As included with http://reactivision.sourceforge.net/ |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
// * Neither the name of "luvtechno.net" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY |
||||
// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
#endregion licence/info |
||||
|
||||
using System; |
||||
using System.Net; |
||||
using System.Net.Sockets; |
||||
|
||||
namespace OSC.NET |
||||
{ |
||||
/// <summary> |
||||
/// OSCReceiver |
||||
/// </summary> |
||||
public class OSCReceiver |
||||
{ |
||||
protected UdpClient udpClient; |
||||
protected int localPort; |
||||
|
||||
public OSCReceiver(int localPort) |
||||
{ |
||||
this.localPort = localPort; |
||||
Connect(); |
||||
} |
||||
|
||||
public void Connect() |
||||
{ |
||||
if(this.udpClient != null) Close(); |
||||
this.udpClient = new UdpClient(this.localPort); |
||||
} |
||||
|
||||
public void Close() |
||||
{ |
||||
if (this.udpClient!=null) this.udpClient.Close(); |
||||
this.udpClient = null; |
||||
} |
||||
|
||||
public OSCPacket Receive() |
||||
{ |
||||
try |
||||
{ |
||||
IPEndPoint ip = new IPEndPoint(IPAddress.Any, 0); |
||||
byte[] bytes = this.udpClient.Receive(ref ip); |
||||
if (bytes != null && bytes.Length > 0) |
||||
return OSCPacket.Unpack(bytes); |
||||
|
||||
} catch (Exception e) { |
||||
Console.WriteLine(e.Message); |
||||
return null; |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 87f223074907a514aba8f8e9fb8559cf |
||||
timeCreated: 1482467657 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 279fb1fcfe44c074f8df93e4e6c301c7 |
||||
timeCreated: 1482467657 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,80 +0,0 @@ |
||||
#region licence/info |
||||
// OSC.NET - Open Sound Control for .NET |
||||
// http://luvtechno.net/ |
||||
// |
||||
// Copyright (c) 2006, Yoshinori Kawasaki |
||||
// All rights reserved. |
||||
// |
||||
// Changes and improvements: |
||||
// Copyright (c) 2006-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
// As included with http://reactivision.sourceforge.net/ |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
// * Neither the name of "luvtechno.net" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY |
||||
// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
#endregion licence/info |
||||
|
||||
using System; |
||||
using System.Net; |
||||
using System.Net.Sockets; |
||||
using System.Diagnostics; |
||||
|
||||
namespace OSC.NET |
||||
{ |
||||
/// <summary> |
||||
/// OSCTransmitter |
||||
/// </summary> |
||||
public class OSCTransmitter |
||||
{ |
||||
protected UdpClient udpClient; |
||||
protected string remoteHost; |
||||
protected int remotePort; |
||||
|
||||
public OSCTransmitter(string remoteHost, int remotePort) |
||||
{ |
||||
this.remoteHost = remoteHost; |
||||
this.remotePort = remotePort; |
||||
Connect(); |
||||
} |
||||
|
||||
public void Connect() |
||||
{ |
||||
if(this.udpClient != null) Close(); |
||||
this.udpClient = new UdpClient(this.remoteHost, this.remotePort); |
||||
} |
||||
|
||||
public void Close() |
||||
{ |
||||
this.udpClient.Close(); |
||||
this.udpClient = null; |
||||
} |
||||
|
||||
public int Send(OSCPacket packet) |
||||
{ |
||||
int byteNum = 0; |
||||
byte[] data = packet.BinaryData; |
||||
try |
||||
{ |
||||
byteNum = this.udpClient.Send(data, data.Length); |
||||
} |
||||
catch (Exception e) |
||||
{ |
||||
Debug.WriteLine(e.Message); |
||||
Debug.WriteLine(e.StackTrace); |
||||
} |
||||
|
||||
return byteNum; |
||||
} |
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: bb78f7ece681028498e13b4403bb5ee3 |
||||
timeCreated: 1482467657 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,9 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: deb7d6460f0841542b7fbcd85e9e3f92 |
||||
folderAsset: yes |
||||
timeCreated: 1505186844 |
||||
licenseType: Free |
||||
DefaultImporter: |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 14027a9fa6ea80343add45670fbba46e |
||||
timeCreated: 1505126203 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: bce2447b045f72647ab51f6dd6cfba77 |
||||
timeCreated: 1505123819 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,9 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: ed93ffb713e535d4a95e9ef7f57b6a33 |
||||
folderAsset: yes |
||||
timeCreated: 1482467558 |
||||
licenseType: Free |
||||
DefaultImporter: |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,440 +0,0 @@ |
||||
/* |
||||
TUIO C# Library - part of the reacTIVision project |
||||
Copyright (c) 2005-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
|
||||
This library is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU Lesser General Public |
||||
License as published by the Free Software Foundation; either |
||||
version 3.0 of the License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Lesser General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Lesser General Public |
||||
License along with this library. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace TUIO |
||||
{ |
||||
|
||||
/** |
||||
* <remarks> |
||||
* The TuioBlob class encapsulates /tuio/2Dblb TUIO objects. |
||||
* </remarks> |
||||
* |
||||
* @author Martin Kaltenbrunner |
||||
* @version 1.1.5 |
||||
*/ |
||||
public class TuioBlob : TuioContainer |
||||
{ |
||||
/** |
||||
* <summary> |
||||
* The individual symbol ID number that is assigned to each TuioBlob.</summary> |
||||
*/ |
||||
protected int blob_id; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The rotation angle value.</summary> |
||||
*/ |
||||
protected float angle; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The blob width value.</summary> |
||||
*/ |
||||
protected float width; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The blob height value.</summary> |
||||
*/ |
||||
protected float height; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The blob area value.</summary> |
||||
*/ |
||||
protected float area; |
||||
|
||||
|
||||
/** |
||||
* <summary> |
||||
* The rotation speed value.</summary> |
||||
*/ |
||||
protected float rotation_speed; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The rotation acceleration value.</summary> |
||||
*/ |
||||
protected float rotation_accel; |
||||
|
||||
#region State Enumeration Values |
||||
|
||||
/** |
||||
* <summary> |
||||
* Defines the ROTATING state.</summary> |
||||
*/ |
||||
public static readonly int TUIO_ROTATING = 5; |
||||
#endregion |
||||
|
||||
#region Constructors |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes a TuioTime argument and assigns it along with the provided |
||||
* Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioBlob.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="si">the Session ID to assign</param> |
||||
* <param name="bi">the Blob ID to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle to assign</param> |
||||
* <param name="w">the width to assign</param> |
||||
* <param name="h">the height to assign</param> |
||||
* <param name="f">the area to assign</param> |
||||
*/ |
||||
public TuioBlob(TuioTime ttime, long si, int bi, float xp, float yp, float a, float w, float h, float f) |
||||
: base(ttime, si, xp, yp) |
||||
{ |
||||
blob_id = bi; |
||||
angle = a; |
||||
width = w; |
||||
height = h; |
||||
area = f; |
||||
rotation_speed = 0.0f; |
||||
rotation_accel = 0.0f; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the provided Session ID, Symbol ID, X and Y coordinate |
||||
* and angle, and assigs these values to the newly created TuioBlob.</summary> |
||||
* |
||||
* <param name="si">the Session ID to assign</param> |
||||
* <param name="sym">the Symbol ID to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle to assign</param> |
||||
* <param name="w">the width to assign</param> |
||||
* <param name="h">the height to assign</param> |
||||
* <param name="f">the area to assign</param> |
||||
*/ |
||||
public TuioBlob(long si, int bi, float xp, float yp, float a, float w, float h, float f) |
||||
: base(si, xp, yp) |
||||
{ |
||||
blob_id = bi; |
||||
angle = a; |
||||
width = w; |
||||
height = h; |
||||
area = f; |
||||
rotation_speed = 0.0f; |
||||
rotation_accel = 0.0f; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the atttibutes of the provided TuioBlob |
||||
* and assigs these values to the newly created TuioBlob.</summary> |
||||
* |
||||
* <param name="tblb">the TuioBlob to assign</param> |
||||
*/ |
||||
public TuioBlob(TuioBlob tblb) |
||||
: base(tblb) |
||||
{ |
||||
blob_id = tblb.BlobID; |
||||
angle = tblb.Angle; |
||||
width = tblb.Width; |
||||
height = tblb.Height; |
||||
area = tblb.Area; |
||||
rotation_speed = 0.0f; |
||||
rotation_accel = 0.0f; |
||||
} |
||||
#endregion |
||||
|
||||
#region Update Methods |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes a TuioTime argument and assigns it along with the provided |
||||
* X and Y coordinate, angle, X and Y velocity, motion acceleration, |
||||
* rotation speed and rotation acceleration to the private TuioBlob attributes.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle coordinate to assign</param> |
||||
* <param name="w">the width to assign</param> |
||||
* <param name="h">the height to assign</param> |
||||
* <param name="f">the area to assign</param> |
||||
* <param name="xs">the X velocity to assign</param> |
||||
* <param name="ys">the Y velocity to assign</param> |
||||
* <param name="rs">the rotation velocity to assign</param> |
||||
* <param name="ma">the motion acceleration to assign</param> |
||||
* <param name="ra">the rotation acceleration to assign</param> |
||||
*/ |
||||
public void update(TuioTime ttime, float xp, float yp, float a, float w, float h, float f, float xs, float ys, float rs, float ma, float ra) |
||||
{ |
||||
base.update(ttime, xp, yp, xs, ys, ma); |
||||
angle = a; |
||||
width = w; |
||||
height = h; |
||||
area = f; |
||||
rotation_speed = rs; |
||||
rotation_accel = ra; |
||||
if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration |
||||
* rotation velocity and rotation acceleration to the private TuioContainer attributes. |
||||
* The TuioTime time stamp remains unchanged.</summary> |
||||
* |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle coordinate to assign</param> |
||||
* <param name="w">the width to assign</param> |
||||
* <param name="h">the height to assign</param> |
||||
* <param name="f">the area to assign</param> |
||||
* <param name="xs">the X velocity to assign</param> |
||||
* <param name="ys">the Y velocity to assign</param> |
||||
* <param name="rs">the rotation velocity to assign</param> |
||||
* <param name="ma">the motion acceleration to assign</param> |
||||
* <param name="ra">the rotation acceleration to assign</param> |
||||
*/ |
||||
public void update(float xp, float yp, float a, float w, float h, float f, float xs, float ys, float rs, float ma, float ra) |
||||
{ |
||||
base.update(xp, yp, xs, ys, ma); |
||||
angle = a; |
||||
width = w; |
||||
height = h; |
||||
area = f; |
||||
rotation_speed = rs; |
||||
rotation_accel = ra; |
||||
if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes a TuioTime argument and assigns it along with the provided |
||||
* X and Y coordinate and angle to the private TuioBlob attributes. |
||||
* The speed and accleration values are calculated accordingly.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle coordinate to assign</param> |
||||
* <param name="w">the width to assign</param> |
||||
* <param name="h">the height to assign</param> |
||||
* <param name="f">the area to assign</param> |
||||
*/ |
||||
public void update(TuioTime ttime, float xp, float yp, float a,float w, float h, float f) |
||||
{ |
||||
TuioPoint lastPoint = path[path.Count - 1]; |
||||
base.update(ttime, xp, yp); |
||||
|
||||
width = w; |
||||
height = h; |
||||
area = f; |
||||
|
||||
TuioTime diffTime = currentTime - lastPoint.TuioTime; |
||||
float dt = diffTime.TotalMilliseconds / 1000.0f; |
||||
float last_angle = angle; |
||||
float last_rotation_speed = rotation_speed; |
||||
angle = a; |
||||
|
||||
float da = (angle - last_angle) / (2.0f * (float)Math.PI); |
||||
if (da > 0.75f) da -= 1.0f; |
||||
else if (da < -0.75f) da += 1.0f; |
||||
|
||||
rotation_speed = da / dt; |
||||
rotation_accel = (rotation_speed - last_rotation_speed) / dt; |
||||
if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes the atttibutes of the provided TuioBlob |
||||
* and assigs these values to this TuioBlob. |
||||
* The TuioTime time stamp of this TuioContainer remains unchanged.</summary> |
||||
* |
||||
* <param name="tblb">the TuioContainer to assign</param> |
||||
*/ |
||||
public void update(TuioBlob tblb) |
||||
{ |
||||
base.update(tblb); |
||||
angle = tblb.Angle; |
||||
width = tblb.Width; |
||||
height = tblb.Height; |
||||
area = tblb.Area; |
||||
rotation_speed = tblb.RotationSpeed; |
||||
rotation_accel = tblb.RotationAccel; |
||||
if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This method is used to calculate the speed and acceleration values of a |
||||
* TuioBlob with unchanged position and angle.</summary> |
||||
*/ |
||||
public new void stop(TuioTime ttime) |
||||
{ |
||||
update(ttime, this.xpos, this.ypos, this.angle, this.width, this.height, this.area); |
||||
} |
||||
#endregion |
||||
|
||||
#region Properties & Getter/Setter Methods |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the symbol ID of this TuioBlob.</summary> |
||||
* <returns>the symbol ID of this TuioBlob</returns> |
||||
*/ |
||||
public int BlobID |
||||
{ |
||||
get { return blob_id; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public int getBlobID() |
||||
{ |
||||
return BlobID; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the width of this TuioBlob.</summary> |
||||
* <returns>the width of this TuioBlob</returns> |
||||
*/ |
||||
public float Width |
||||
{ |
||||
get { return width; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getWidth() |
||||
{ |
||||
return Width; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the height of this TuioBlob.</summary> |
||||
* <returns>the heigth of this TuioBlob</returns> |
||||
*/ |
||||
public float Height |
||||
{ |
||||
get { return height; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getHeight() |
||||
{ |
||||
return Height; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the area of this TuioBlob.</summary> |
||||
* <returns>the area of this TuioBlob</returns> |
||||
*/ |
||||
public float Area |
||||
{ |
||||
get { return area; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getArea() |
||||
{ |
||||
return Area; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the rotation angle of this TuioBlob.</summary> |
||||
* <returns>the rotation angle of this TuioBlob</returns> |
||||
*/ |
||||
public float Angle |
||||
{ |
||||
get { return angle; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getAngle() |
||||
{ |
||||
return Angle; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the rotation angle in degrees of this TuioBlob.</summary> |
||||
* <returns>the rotation angle in degrees of this TuioBlob</returns> |
||||
*/ |
||||
public float AngleDegrees |
||||
{ |
||||
get { return angle / (float)Math.PI * 180.0f; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getAngleDegrees() |
||||
{ |
||||
return AngleDegrees; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the rotation speed of this TuioBlob.</summary> |
||||
* <returns>the rotation speed of this TuioBlob</returns> |
||||
*/ |
||||
public float RotationSpeed |
||||
{ |
||||
get { return rotation_speed; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getRotationSpeed() |
||||
{ |
||||
return RotationSpeed; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the rotation acceleration of this TuioBlob.</summary> |
||||
* <returns>the rotation acceleration of this TuioBlob</returns> |
||||
*/ |
||||
public float RotationAccel |
||||
{ |
||||
get { return rotation_accel; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getRotationAccel() |
||||
{ |
||||
return RotationAccel; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns true of this TuioBlob is moving.</summary> |
||||
* <returns>true of this TuioBlob is moving</returns> |
||||
*/ |
||||
public override bool isMoving |
||||
{ |
||||
get |
||||
{ |
||||
if ((state == TUIO_ACCELERATING) || (state == TUIO_DECELERATING) || (state == TUIO_ROTATING)) return true; |
||||
else return false; |
||||
} |
||||
} |
||||
#endregion |
||||
} |
||||
|
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 3e648284471a6a84cac17552235670f8 |
||||
timeCreated: 1482467612 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,868 +0,0 @@ |
||||
/* |
||||
TUIO C# Library - part of the reacTIVision project |
||||
Copyright (c) 2005-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
|
||||
This library is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU Lesser General Public |
||||
License as published by the Free Software Foundation; either |
||||
version 3.0 of the License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Lesser General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Lesser General Public |
||||
License along with this library. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Threading; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
using OSC.NET; |
||||
|
||||
namespace TUIO |
||||
{ |
||||
/** |
||||
* <remarks> |
||||
* The TuioClient class is the central TUIO protocol decoder component. It provides a simple callback infrastructure using the {@link TuioListener} interface. |
||||
* In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events |
||||
* which are broadcasted to all registered classes that implement the {@link TuioListener} interface. |
||||
* </remarks> |
||||
* <example> |
||||
* <code> |
||||
* TuioClient client = new TuioClient(); |
||||
* client.addTuioListener(myTuioListener); |
||||
* client.start(); |
||||
* </code> |
||||
* </example> |
||||
* |
||||
* @author Martin Kaltenbrunner |
||||
* @version 1.1,5 |
||||
*/ |
||||
public class TuioClient |
||||
{ |
||||
private bool connected = false; |
||||
private int port = 3333; |
||||
private OSCReceiver receiver; |
||||
private Thread thread; |
||||
|
||||
private object cursorSync = new object(); |
||||
private object objectSync = new object(); |
||||
private object blobSync = new object(); |
||||
|
||||
private Dictionary<long, TuioObject> objectList = new Dictionary<long, TuioObject>(32); |
||||
private List<long> aliveObjectList = new List<long>(32); |
||||
private List<long> newObjectList = new List<long>(32); |
||||
private Dictionary<long, TuioCursor> cursorList = new Dictionary<long, TuioCursor>(32); |
||||
private List<long> aliveCursorList = new List<long>(32); |
||||
private List<long> newCursorList = new List<long>(32); |
||||
private Dictionary<long, TuioBlob> blobList = new Dictionary<long, TuioBlob>(32); |
||||
private List<long> aliveBlobList = new List<long>(32); |
||||
private List<long> newBlobList = new List<long>(32); |
||||
private List<TuioObject> frameObjects = new List<TuioObject>(32); |
||||
private List<TuioCursor> frameCursors = new List<TuioCursor>(32); |
||||
private List<TuioBlob> frameBlobs = new List<TuioBlob>(32); |
||||
|
||||
private List<TuioCursor> freeCursorList = new List<TuioCursor>(); |
||||
private int maxCursorID = -1; |
||||
private List<TuioBlob> freeBlobList = new List<TuioBlob>(); |
||||
private int maxBlobID = -1; |
||||
|
||||
private int currentFrame = 0; |
||||
private TuioTime currentTime; |
||||
|
||||
private List<TuioListener> listenerList = new List<TuioListener>(); |
||||
|
||||
#region Constructors |
||||
/** |
||||
* <summary> |
||||
* The default constructor creates a client that listens to the default TUIO port 3333</summary> |
||||
*/ |
||||
public TuioClient() { } |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor creates a client that listens to the provided port</summary> |
||||
* <param name="port">the listening port number</param> |
||||
*/ |
||||
public TuioClient(int port) |
||||
{ |
||||
this.port = port; |
||||
} |
||||
#endregion |
||||
|
||||
#region Connection Methods |
||||
/** |
||||
* <summary> |
||||
* Returns the port number listening to.</summary> |
||||
* <returns>the listening port number</returns> |
||||
*/ |
||||
public int getPort() |
||||
{ |
||||
return port; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* The TuioClient starts listening to TUIO messages on the configured UDP port |
||||
* All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners</summary> |
||||
*/ |
||||
public void connect() |
||||
{ |
||||
|
||||
TuioTime.initSession(); |
||||
currentTime = new TuioTime(); |
||||
currentTime.reset(); |
||||
|
||||
try |
||||
{ |
||||
receiver = new OSCReceiver(port); |
||||
connected = true; |
||||
thread = new Thread(new ThreadStart(listen)); |
||||
thread.Start(); |
||||
} |
||||
catch (Exception e) |
||||
{ |
||||
Console.WriteLine("failed to connect to port " + port); |
||||
Console.WriteLine(e.Message); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* The TuioClient stops listening to TUIO messages on the configured UDP port</summary> |
||||
*/ |
||||
public void disconnect() |
||||
{ |
||||
connected = false; |
||||
if (receiver != null) receiver.Close(); |
||||
receiver = null; |
||||
|
||||
aliveObjectList.Clear(); |
||||
aliveCursorList.Clear(); |
||||
aliveBlobList.Clear(); |
||||
objectList.Clear(); |
||||
cursorList.Clear(); |
||||
blobList.Clear(); |
||||
frameObjects.Clear(); |
||||
frameCursors.Clear(); |
||||
frameBlobs.Clear(); |
||||
freeCursorList.Clear(); |
||||
freeBlobList.Clear(); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns true if this TuioClient is currently connected.</summary> |
||||
* <returns>true if this TuioClient is currently connected</returns> |
||||
*/ |
||||
public bool isConnected() { return connected; } |
||||
|
||||
private void listen() |
||||
{ |
||||
while (connected) |
||||
{ |
||||
try |
||||
{ |
||||
OSCPacket packet = receiver.Receive(); |
||||
if (packet != null) |
||||
{ |
||||
if (packet.IsBundle()) |
||||
{ |
||||
ArrayList messages = packet.Values; |
||||
for (int i = 0; i < messages.Count; i++) |
||||
{ |
||||
processMessage((OSCMessage)messages[i]); |
||||
} |
||||
} |
||||
else processMessage((OSCMessage)packet); |
||||
} |
||||
else Console.WriteLine("null packet"); |
||||
} |
||||
catch (Exception e) { Console.WriteLine(e.Message); } |
||||
} |
||||
} |
||||
#endregion |
||||
|
||||
/** |
||||
* <summary> |
||||
* The OSC callback method where all TUIO messages are received and decoded |
||||
* and where the TUIO event callbacks are dispatched</summary> |
||||
* <param name="message">the received OSC message</param> |
||||
*/ |
||||
private void processMessage(OSCMessage message) |
||||
{ |
||||
string address = message.Address; |
||||
ArrayList args = message.Values; |
||||
string command = (string)args[0]; |
||||
|
||||
if (address == "/tuio/2Dobj") |
||||
{ |
||||
if (command == "set") |
||||
{ |
||||
|
||||
long s_id = (int)args[1]; |
||||
int f_id = (int)args[2]; |
||||
float xpos = (float)args[3]; |
||||
float ypos = (float)args[4]; |
||||
float angle = (float)args[5]; |
||||
float xspeed = (float)args[6]; |
||||
float yspeed = (float)args[7]; |
||||
float rspeed = (float)args[8]; |
||||
float maccel = (float)args[9]; |
||||
float raccel = (float)args[10]; |
||||
|
||||
lock (objectSync) |
||||
{ |
||||
if (!objectList.ContainsKey(s_id)) |
||||
{ |
||||
TuioObject addObject = new TuioObject(s_id, f_id, xpos, ypos, angle); |
||||
frameObjects.Add(addObject); |
||||
} |
||||
else |
||||
{ |
||||
TuioObject tobj = objectList[s_id]; |
||||
if (tobj == null) return; |
||||
if ((tobj.X != xpos) || (tobj.Y != ypos) || (tobj.Angle != angle) || (tobj.XSpeed != xspeed) || (tobj.YSpeed != yspeed) || (tobj.RotationSpeed != rspeed) || (tobj.MotionAccel != maccel) || (tobj.RotationAccel != raccel)) |
||||
{ |
||||
|
||||
TuioObject updateObject = new TuioObject(s_id, f_id, xpos, ypos, angle); |
||||
updateObject.update(xpos, ypos, angle, xspeed, yspeed, rspeed, maccel, raccel); |
||||
frameObjects.Add(updateObject); |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
else if (command == "alive") |
||||
{ |
||||
|
||||
newObjectList.Clear(); |
||||
for (int i = 1; i < args.Count; i++) |
||||
{ |
||||
// get the message content |
||||
long s_id = (int)args[i]; |
||||
newObjectList.Add(s_id); |
||||
// reduce the object list to the lost objects |
||||
if (aliveObjectList.Contains(s_id)) |
||||
aliveObjectList.Remove(s_id); |
||||
} |
||||
|
||||
// remove the remaining objects |
||||
lock (objectSync) |
||||
{ |
||||
for (int i = 0; i < aliveObjectList.Count; i++) |
||||
{ |
||||
long s_id = aliveObjectList[i]; |
||||
TuioObject removeObject = objectList[s_id]; |
||||
removeObject.remove(currentTime); |
||||
frameObjects.Add(removeObject); |
||||
} |
||||
} |
||||
|
||||
} |
||||
else if (command == "fseq") |
||||
{ |
||||
int fseq = (int)args[1]; |
||||
bool lateFrame = false; |
||||
|
||||
if (fseq > 0) |
||||
{ |
||||
if (fseq > currentFrame) currentTime = TuioTime.SessionTime; |
||||
if ((fseq >= currentFrame) || ((currentFrame - fseq) > 100)) currentFrame = fseq; |
||||
else lateFrame = true; |
||||
} |
||||
else if ((TuioTime.SessionTime.TotalMilliseconds - currentTime.TotalMilliseconds) > 100) |
||||
{ |
||||
currentTime = TuioTime.SessionTime; |
||||
} |
||||
|
||||
if (!lateFrame) |
||||
{ |
||||
|
||||
IEnumerator<TuioObject> frameEnum = frameObjects.GetEnumerator(); |
||||
while (frameEnum.MoveNext()) |
||||
{ |
||||
TuioObject tobj = frameEnum.Current; |
||||
|
||||
switch (tobj.TuioState) |
||||
{ |
||||
case TuioObject.TUIO_REMOVED: |
||||
TuioObject removeObject = tobj; |
||||
removeObject.remove(currentTime); |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.removeTuioObject(removeObject); |
||||
} |
||||
lock (objectSync) |
||||
{ |
||||
objectList.Remove(removeObject.SessionID); |
||||
} |
||||
break; |
||||
case TuioObject.TUIO_ADDED: |
||||
TuioObject addObject = new TuioObject(currentTime, tobj.SessionID, tobj.SymbolID, tobj.X, tobj.Y, tobj.Angle); |
||||
lock (objectSync) |
||||
{ |
||||
objectList.Add(addObject.SessionID, addObject); |
||||
} |
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.addTuioObject(addObject); |
||||
} |
||||
break; |
||||
default: |
||||
TuioObject updateObject = getTuioObject(tobj.SessionID); |
||||
if ((tobj.X != updateObject.X && tobj.XSpeed == 0) || (tobj.Y != updateObject.Y && tobj.YSpeed == 0)) |
||||
updateObject.update(currentTime, tobj.X, tobj.Y, tobj.Angle); |
||||
else |
||||
updateObject.update(currentTime, tobj.X, tobj.Y, tobj.Angle, tobj.XSpeed, tobj.YSpeed, tobj.RotationSpeed, tobj.MotionAccel, tobj.RotationAccel); |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.updateTuioObject(updateObject); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.refresh(new TuioTime(currentTime)); |
||||
} |
||||
|
||||
List<long> buffer = aliveObjectList; |
||||
aliveObjectList = newObjectList; |
||||
// recycling the List |
||||
newObjectList = buffer; |
||||
} |
||||
frameObjects.Clear(); |
||||
} |
||||
|
||||
} |
||||
else if (address == "/tuio/2Dcur") |
||||
{ |
||||
|
||||
if (command == "set") |
||||
{ |
||||
|
||||
long s_id = (int)args[1]; |
||||
float xpos = (float)args[2]; |
||||
float ypos = (float)args[3]; |
||||
float xspeed = (float)args[4]; |
||||
float yspeed = (float)args[5]; |
||||
float maccel = (float)args[6]; |
||||
|
||||
lock (cursorList) |
||||
{ |
||||
if (!cursorList.ContainsKey(s_id)) |
||||
{ |
||||
|
||||
TuioCursor addCursor = new TuioCursor(s_id, -1, xpos, ypos); |
||||
frameCursors.Add(addCursor); |
||||
|
||||
} |
||||
else |
||||
{ |
||||
TuioCursor tcur = (TuioCursor)cursorList[s_id]; |
||||
if (tcur == null) return; |
||||
if ((tcur.X != xpos) || (tcur.Y != ypos) || (tcur.XSpeed != xspeed) || (tcur.YSpeed != yspeed) || (tcur.MotionAccel != maccel)) |
||||
{ |
||||
TuioCursor updateCursor = new TuioCursor(s_id, tcur.CursorID, xpos, ypos); |
||||
updateCursor.update(xpos, ypos, xspeed, yspeed, maccel); |
||||
frameCursors.Add(updateCursor); |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
else if (command == "alive") |
||||
{ |
||||
|
||||
newCursorList.Clear(); |
||||
for (int i = 1; i < args.Count; i++) |
||||
{ |
||||
// get the message content |
||||
long s_id = (int)args[i]; |
||||
newCursorList.Add(s_id); |
||||
// reduce the cursor list to the lost cursors |
||||
if (aliveCursorList.Contains(s_id)) |
||||
aliveCursorList.Remove(s_id); |
||||
} |
||||
|
||||
// remove the remaining cursors |
||||
lock (cursorSync) |
||||
{ |
||||
for (int i = 0; i < aliveCursorList.Count; i++) |
||||
{ |
||||
long s_id = aliveCursorList[i]; |
||||
if (!cursorList.ContainsKey(s_id)) continue; |
||||
TuioCursor removeCursor = cursorList[s_id]; |
||||
removeCursor.remove(currentTime); |
||||
frameCursors.Add(removeCursor); |
||||
} |
||||
} |
||||
|
||||
} |
||||
else if (command == "fseq") |
||||
{ |
||||
int fseq = (int)args[1]; |
||||
bool lateFrame = false; |
||||
|
||||
if (fseq > 0) |
||||
{ |
||||
if (fseq > currentFrame) currentTime = TuioTime.SessionTime; |
||||
if ((fseq >= currentFrame) || ((currentFrame - fseq) > 100)) currentFrame = fseq; |
||||
else lateFrame = true; |
||||
} |
||||
else if ((TuioTime.SessionTime.TotalMilliseconds - currentTime.TotalMilliseconds) > 100) |
||||
{ |
||||
currentTime = TuioTime.SessionTime; |
||||
} |
||||
|
||||
if (!lateFrame) |
||||
{ |
||||
|
||||
IEnumerator<TuioCursor> frameEnum = frameCursors.GetEnumerator(); |
||||
while (frameEnum.MoveNext()) |
||||
{ |
||||
TuioCursor tcur = frameEnum.Current; |
||||
switch (tcur.TuioState) |
||||
{ |
||||
case TuioCursor.TUIO_REMOVED: |
||||
TuioCursor removeCursor = tcur; |
||||
removeCursor.remove(currentTime); |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.removeTuioCursor(removeCursor); |
||||
} |
||||
lock (cursorSync) |
||||
{ |
||||
cursorList.Remove(removeCursor.SessionID); |
||||
|
||||
if (removeCursor.CursorID == maxCursorID) |
||||
{ |
||||
maxCursorID = -1; |
||||
|
||||
if (cursorList.Count > 0) |
||||
{ |
||||
|
||||
IEnumerator<KeyValuePair<long, TuioCursor>> clist = cursorList.GetEnumerator(); |
||||
while (clist.MoveNext()) |
||||
{ |
||||
int f_id = clist.Current.Value.CursorID; |
||||
if (f_id > maxCursorID) maxCursorID = f_id; |
||||
} |
||||
|
||||
List<TuioCursor> freeCursorBuffer = new List<TuioCursor>(); |
||||
IEnumerator<TuioCursor> flist = freeCursorList.GetEnumerator(); |
||||
while (flist.MoveNext()) |
||||
{ |
||||
TuioCursor testCursor = flist.Current; |
||||
if (testCursor.CursorID < maxCursorID) freeCursorBuffer.Add(testCursor); |
||||
} |
||||
freeCursorList = freeCursorBuffer; |
||||
} |
||||
else freeCursorList.Clear(); |
||||
} |
||||
else if (removeCursor.CursorID < maxCursorID) freeCursorList.Add(removeCursor); |
||||
} |
||||
break; |
||||
|
||||
case TuioCursor.TUIO_ADDED: |
||||
TuioCursor addCursor; |
||||
lock (cursorSync) |
||||
{ |
||||
int c_id = cursorList.Count; |
||||
if ((cursorList.Count <= maxCursorID) && (freeCursorList.Count > 0)) |
||||
{ |
||||
TuioCursor closestCursor = freeCursorList[0]; |
||||
IEnumerator<TuioCursor> testList = freeCursorList.GetEnumerator(); |
||||
while (testList.MoveNext()) |
||||
{ |
||||
TuioCursor testCursor = testList.Current; |
||||
if (testCursor.getDistance(tcur) < closestCursor.getDistance(tcur)) closestCursor = testCursor; |
||||
} |
||||
c_id = closestCursor.CursorID; |
||||
freeCursorList.Remove(closestCursor); |
||||
} |
||||
else maxCursorID = c_id; |
||||
|
||||
addCursor = new TuioCursor(currentTime, tcur.SessionID, c_id, tcur.X, tcur.Y); |
||||
cursorList.Add(addCursor.SessionID, addCursor); |
||||
} |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.addTuioCursor(addCursor); |
||||
} |
||||
break; |
||||
|
||||
default: |
||||
TuioCursor updateCursor = getTuioCursor(tcur.SessionID); |
||||
if ((tcur.X != updateCursor.X && tcur.XSpeed == 0) || (tcur.Y != updateCursor.Y && tcur.YSpeed == 0)) |
||||
updateCursor.update(currentTime, tcur.X, tcur.Y); |
||||
else |
||||
updateCursor.update(currentTime, tcur.X, tcur.Y, tcur.XSpeed, tcur.YSpeed, tcur.MotionAccel); |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.updateTuioCursor(updateCursor); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.refresh(new TuioTime(currentTime)); |
||||
} |
||||
|
||||
List<long> buffer = aliveCursorList; |
||||
aliveCursorList = newCursorList; |
||||
// recycling the List |
||||
newCursorList = buffer; |
||||
} |
||||
frameCursors.Clear(); |
||||
} |
||||
|
||||
} |
||||
else if (address == "/tuio/2Dblb") |
||||
{ |
||||
|
||||
if (command == "set") |
||||
{ |
||||
|
||||
long s_id = (int)args[1]; |
||||
float xpos = (float)args[2]; |
||||
float ypos = (float)args[3]; |
||||
float angle = (float)args[4]; |
||||
float width = (float)args[5]; |
||||
float height = (float)args[6]; |
||||
float area = (float)args[7]; |
||||
float xspeed = (float)args[8]; |
||||
float yspeed = (float)args[9]; |
||||
float rspeed = (float)args[10]; |
||||
float maccel = (float)args[11]; |
||||
float raccel = (float)args[12]; |
||||
|
||||
lock (blobList) |
||||
{ |
||||
if (!blobList.ContainsKey(s_id)) |
||||
{ |
||||
TuioBlob addBlob = new TuioBlob(s_id, -1, xpos, ypos, angle, width, height, area); |
||||
frameBlobs.Add(addBlob); |
||||
} |
||||
else |
||||
{ |
||||
TuioBlob tblb = (TuioBlob)blobList[s_id]; |
||||
if (tblb == null) return; |
||||
if ((tblb.X != xpos) || (tblb.Y != ypos) || (tblb.Angle != angle) || (tblb.Width != width) || (tblb.Height != height) || (tblb.Area != area) || (tblb.XSpeed != xspeed) || (tblb.YSpeed != yspeed) || (tblb.RotationSpeed != rspeed) || (tblb.MotionAccel != maccel) || (tblb.RotationAccel != raccel)) |
||||
{ |
||||
TuioBlob updateBlob = new TuioBlob(s_id, tblb.BlobID, xpos, ypos, angle, width, height, area); |
||||
updateBlob.update(xpos, ypos, angle, width, height, area, xspeed, yspeed, rspeed, maccel, raccel); |
||||
frameBlobs.Add(updateBlob); |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
else if (command == "alive") |
||||
{ |
||||
|
||||
newBlobList.Clear(); |
||||
for (int i = 1; i < args.Count; i++) |
||||
{ |
||||
// get the message content |
||||
long s_id = (int)args[i]; |
||||
newBlobList.Add(s_id); |
||||
// reduce the blob list to the lost blobs |
||||
if (aliveBlobList.Contains(s_id)) |
||||
aliveBlobList.Remove(s_id); |
||||
} |
||||
|
||||
// remove the remaining blobs |
||||
lock (blobSync) |
||||
{ |
||||
for (int i = 0; i < aliveBlobList.Count; i++) |
||||
{ |
||||
long s_id = aliveBlobList[i]; |
||||
if (!blobList.ContainsKey(s_id)) continue; |
||||
TuioBlob removeBlob = blobList[s_id]; |
||||
removeBlob.remove(currentTime); |
||||
frameBlobs.Add(removeBlob); |
||||
} |
||||
} |
||||
|
||||
} |
||||
else if (command == "fseq") |
||||
{ |
||||
int fseq = (int)args[1]; |
||||
bool lateFrame = false; |
||||
|
||||
if (fseq > 0) |
||||
{ |
||||
if (fseq > currentFrame) currentTime = TuioTime.SessionTime; |
||||
if ((fseq >= currentFrame) || ((currentFrame - fseq) > 100)) currentFrame = fseq; |
||||
else lateFrame = true; |
||||
} |
||||
else if ((TuioTime.SessionTime.TotalMilliseconds - currentTime.TotalMilliseconds) > 100) |
||||
{ |
||||
currentTime = TuioTime.SessionTime; |
||||
} |
||||
|
||||
if (!lateFrame) |
||||
{ |
||||
|
||||
IEnumerator<TuioBlob> frameEnum = frameBlobs.GetEnumerator(); |
||||
while (frameEnum.MoveNext()) |
||||
{ |
||||
TuioBlob tblb = frameEnum.Current; |
||||
switch (tblb.TuioState) |
||||
{ |
||||
case TuioBlob.TUIO_REMOVED: |
||||
TuioBlob removeBlob = tblb; |
||||
removeBlob.remove(currentTime); |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.removeTuioBlob(removeBlob); |
||||
} |
||||
lock (blobSync) |
||||
{ |
||||
blobList.Remove(removeBlob.SessionID); |
||||
|
||||
if (removeBlob.BlobID == maxBlobID) |
||||
{ |
||||
maxBlobID = -1; |
||||
|
||||
if (blobList.Count > 0) |
||||
{ |
||||
|
||||
IEnumerator<KeyValuePair<long, TuioBlob>> blist = blobList.GetEnumerator(); |
||||
while (blist.MoveNext()) |
||||
{ |
||||
int b_id = blist.Current.Value.BlobID; |
||||
if (b_id > maxBlobID) maxBlobID = b_id; |
||||
} |
||||
|
||||
List<TuioBlob> freeBlobBuffer = new List<TuioBlob>(); |
||||
IEnumerator<TuioBlob> flist = freeBlobList.GetEnumerator(); |
||||
while (flist.MoveNext()) |
||||
{ |
||||
TuioBlob testBlob = flist.Current; |
||||
if (testBlob.BlobID < maxBlobID) freeBlobBuffer.Add(testBlob); |
||||
} |
||||
freeBlobList = freeBlobBuffer; |
||||
} |
||||
else freeBlobList.Clear(); |
||||
} |
||||
else if (removeBlob.BlobID < maxBlobID) freeBlobList.Add(removeBlob); |
||||
} |
||||
break; |
||||
|
||||
case TuioBlob.TUIO_ADDED: |
||||
TuioBlob addBlob; |
||||
lock (blobSync) |
||||
{ |
||||
int b_id = blobList.Count; |
||||
if ((blobList.Count <= maxBlobID) && (freeBlobList.Count > 0)) |
||||
{ |
||||
TuioBlob closestBlob = freeBlobList[0]; |
||||
IEnumerator<TuioBlob> testList = freeBlobList.GetEnumerator(); |
||||
while (testList.MoveNext()) |
||||
{ |
||||
TuioBlob testBlob = testList.Current; |
||||
if (testBlob.getDistance(tblb) < closestBlob.getDistance(tblb)) closestBlob = testBlob; |
||||
} |
||||
b_id = closestBlob.BlobID; |
||||
freeBlobList.Remove(closestBlob); |
||||
} |
||||
else maxBlobID = b_id; |
||||
|
||||
addBlob = new TuioBlob(currentTime, tblb.SessionID, b_id, tblb.X, tblb.Y, tblb.Angle, tblb.Width, tblb.Height, tblb.Area); |
||||
blobList.Add(addBlob.SessionID, addBlob); |
||||
} |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.addTuioBlob(addBlob); |
||||
} |
||||
break; |
||||
|
||||
default: |
||||
TuioBlob updateBlob = getTuioBlob(tblb.SessionID); |
||||
if ((tblb.X != updateBlob.X && tblb.XSpeed == 0) || (tblb.Y != updateBlob.Y && tblb.YSpeed == 0) || (tblb.Angle != updateBlob.Angle && tblb.RotationSpeed == 0)) |
||||
updateBlob.update(currentTime, tblb.X, tblb.Y, tblb.Angle, tblb.Width, tblb.Height, tblb.Area); |
||||
else |
||||
updateBlob.update(currentTime, tblb.X, tblb.Y, tblb.Angle, tblb.Width, tblb.Height, tblb.Area, tblb.XSpeed, tblb.YSpeed, tblb.RotationSpeed, tblb.MotionAccel, tblb.RotationAccel); |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.updateTuioBlob(updateBlob); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
|
||||
for (int i = 0; i < listenerList.Count; i++) |
||||
{ |
||||
TuioListener listener = (TuioListener)listenerList[i]; |
||||
if (listener != null) listener.refresh(new TuioTime(currentTime)); |
||||
} |
||||
|
||||
List<long> buffer = aliveBlobList; |
||||
aliveBlobList = newBlobList; |
||||
// recycling the List |
||||
newBlobList = buffer; |
||||
} |
||||
frameBlobs.Clear(); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
#region Listener Management |
||||
/** |
||||
* <summary> |
||||
* Adds the provided TuioListener to the list of registered TUIO event listeners</summary> |
||||
* <param name="listener">the TuioListener to add</param> |
||||
*/ |
||||
public void addTuioListener(TuioListener listener) |
||||
{ |
||||
listenerList.Add(listener); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Removes the provided TuioListener from the list of registered TUIO event listeners</summary> |
||||
* <param name="listener">the TuioListener to remove</param> |
||||
*/ |
||||
public void removeTuioListener(TuioListener listener) |
||||
{ |
||||
listenerList.Remove(listener); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Removes all TuioListener from the list of registered TUIO event listeners</summary> |
||||
*/ |
||||
public void removeAllTuioListeners() |
||||
{ |
||||
listenerList.Clear(); |
||||
} |
||||
#endregion |
||||
|
||||
#region Object Management |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns a List of all currently active TuioObjects</summary> |
||||
* <returns>a List of all currently active TuioObjects</returns> |
||||
*/ |
||||
public List<TuioObject> getTuioObjects() |
||||
{ |
||||
List<TuioObject> listBuffer; |
||||
lock (objectSync) |
||||
{ |
||||
listBuffer = new List<TuioObject>(objectList.Values); |
||||
} |
||||
return listBuffer; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns a List of all currently active TuioCursors</summary> |
||||
* <returns>a List of all currently active TuioCursors</returns> |
||||
*/ |
||||
public List<TuioCursor> getTuioCursors() |
||||
{ |
||||
List<TuioCursor> listBuffer; |
||||
lock (cursorSync) |
||||
{ |
||||
listBuffer = new List<TuioCursor>(cursorList.Values); |
||||
} |
||||
return listBuffer; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns a List of all currently active TuioBlobs</summary> |
||||
* <returns>a List of all currently active TuioBlobs</returns> |
||||
*/ |
||||
public List<TuioBlob> getTuioBlobs() |
||||
{ |
||||
List<TuioBlob> listBuffer; |
||||
lock (blobSync) |
||||
{ |
||||
listBuffer = new List<TuioBlob>(blobList.Values); |
||||
} |
||||
return listBuffer; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the TuioObject corresponding to the provided Session ID |
||||
* or NULL if the Session ID does not refer to an active TuioObject</summary> |
||||
* <returns>an active TuioObject corresponding to the provided Session ID or NULL</returns> |
||||
*/ |
||||
public TuioObject getTuioObject(long s_id) |
||||
{ |
||||
TuioObject tobject = null; |
||||
lock (objectSync) |
||||
{ |
||||
objectList.TryGetValue(s_id, out tobject); |
||||
} |
||||
return tobject; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the TuioCursor corresponding to the provided Session ID |
||||
* or NULL if the Session ID does not refer to an active TuioCursor</summary> |
||||
* <returns>an active TuioCursor corresponding to the provided Session ID or NULL</returns> |
||||
*/ |
||||
public TuioCursor getTuioCursor(long s_id) |
||||
{ |
||||
TuioCursor tcursor = null; |
||||
lock (cursorSync) |
||||
{ |
||||
cursorList.TryGetValue(s_id, out tcursor); |
||||
} |
||||
return tcursor; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the TuioBlob corresponding to the provided Session ID |
||||
* or NULL if the Session ID does not refer to an active TuioBlob</summary> |
||||
* <returns>an active TuioBlob corresponding to the provided Session ID or NULL</returns> |
||||
*/ |
||||
public TuioBlob getTuioBlob(long s_id) |
||||
{ |
||||
TuioBlob tblob = null; |
||||
lock (blobSync) |
||||
{ |
||||
blobList.TryGetValue(s_id, out tblob); |
||||
} |
||||
return tblob; |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: a6249948503ed8e46a389f399a008aee |
||||
timeCreated: 1482467613 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,454 +0,0 @@ |
||||
/* |
||||
TUIO C# Library - part of the reacTIVision project |
||||
Copyright (c) 2005-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
|
||||
This library is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU Lesser General Public |
||||
License as published by the Free Software Foundation; either |
||||
version 3.0 of the License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Lesser General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Lesser General Public |
||||
License along with this library. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace TUIO |
||||
{ |
||||
|
||||
/** |
||||
* <remarks>The abstract TuioContainer class defines common attributes that apply |
||||
* to both subclasses (TuioObject and TuioCursor).</remarks> |
||||
* <seealso cref="TuioObject"/> |
||||
* <seealso cref="TuioCursor"/> |
||||
* |
||||
* @author Martin Kaltenbrunner |
||||
* @version 1.1.5 |
||||
*/ |
||||
public abstract class TuioContainer : TuioPoint |
||||
{ |
||||
|
||||
/** |
||||
* <summary> |
||||
* The unique session ID number that is assigned to each TUIO object or cursor.</summary> |
||||
*/ |
||||
protected long session_id; |
||||
/** |
||||
* <summary> |
||||
* The X-axis velocity value.</summary> |
||||
*/ |
||||
protected float x_speed; |
||||
/** |
||||
* <summary> |
||||
* The Y-axis velocity value.</summary> |
||||
*/ |
||||
protected float y_speed; |
||||
/** |
||||
* <summary> |
||||
* The motion speed value.</summary> |
||||
*/ |
||||
protected float motion_speed; |
||||
/** |
||||
* <summary> |
||||
* The motion acceleration value.</summary> |
||||
*/ |
||||
protected float motion_accel; |
||||
/** |
||||
* <summary> |
||||
* A Vector of TuioPoints containing all the previous positions of the TUIO component.</summary> |
||||
*/ |
||||
protected List<TuioPoint> path; |
||||
|
||||
#region State Enumeration Values |
||||
/** |
||||
* <summary> |
||||
* Defines the ADDED state.</summary> |
||||
*/ |
||||
public const int TUIO_ADDED = 0; |
||||
/** |
||||
* <summary> |
||||
* Defines the ACCELERATING state.</summary> |
||||
*/ |
||||
public const int TUIO_ACCELERATING = 1; |
||||
/** |
||||
* <summary> |
||||
* Defines the DECELERATING state.</summary> |
||||
*/ |
||||
public const int TUIO_DECELERATING = 2; |
||||
/** |
||||
* <summary> |
||||
* Defines the STOPPED state.</summary> |
||||
*/ |
||||
public const int TUIO_STOPPED = 3; |
||||
/** |
||||
* <summary> |
||||
* Defines the REMOVED state.</summary> |
||||
*/ |
||||
public const int TUIO_REMOVED = 4; |
||||
#endregion |
||||
/** |
||||
* <summary> |
||||
* Reflects the current state of the TuioComponent</summary> |
||||
*/ |
||||
protected int state; |
||||
|
||||
#region Constructors |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes a TuioTime argument and assigns it along with the provided |
||||
* Session ID, X and Y coordinate to the newly created TuioContainer.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="si">the Session ID to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
*/ |
||||
public TuioContainer(TuioTime ttime, long si, float xp, float yp) |
||||
: base(ttime, xp, yp) |
||||
{ |
||||
session_id = si; |
||||
x_speed = 0.0f; |
||||
y_speed = 0.0f; |
||||
motion_speed = 0.0f; |
||||
motion_accel = 0.0f; |
||||
|
||||
path = new List<TuioPoint>(); |
||||
path.Add(new TuioPoint(currentTime, xpos, ypos)); |
||||
state = TUIO_ADDED; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the provided Session ID, X and Y coordinate |
||||
* and assigs these values to the newly created TuioContainer.</summary> |
||||
* |
||||
* <param name="si">the Session ID to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
*/ |
||||
public TuioContainer(long si, float xp, float yp) |
||||
: base(xp, yp) |
||||
{ |
||||
session_id = si; |
||||
x_speed = 0.0f; |
||||
y_speed = 0.0f; |
||||
motion_speed = 0.0f; |
||||
motion_accel = 0.0f; |
||||
path = new List<TuioPoint>(); |
||||
path.Add(new TuioPoint(currentTime, xpos, ypos)); |
||||
state = TUIO_ADDED; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the atttibutes of the provided TuioContainer |
||||
* and assigs these values to the newly created TuioContainer.</summary> |
||||
* |
||||
* <param name="tcon">the TuioContainer to assign</param> |
||||
*/ |
||||
public TuioContainer(TuioContainer tcon) |
||||
: base(tcon) |
||||
{ |
||||
session_id = tcon.SessionID; |
||||
x_speed = 0.0f; |
||||
y_speed = 0.0f; |
||||
motion_speed = 0.0f; |
||||
motion_accel = 0.0f; |
||||
path = new List<TuioPoint>(); |
||||
path.Add(new TuioPoint(currentTime, xpos, ypos)); |
||||
state = TUIO_ADDED; |
||||
} |
||||
#endregion |
||||
|
||||
#region Update Methods |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes a TuioTime argument and assigns it along with the provided |
||||
* X and Y coordinate to the private TuioContainer attributes. |
||||
* The speed and accleration values are calculated accordingly.</summary> |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
*/ |
||||
public new void update(TuioTime ttime, float xp, float yp) |
||||
{ |
||||
TuioPoint lastPoint = path[path.Count - 1]; |
||||
base.update(ttime, xp, yp); |
||||
|
||||
TuioTime diffTime = currentTime - lastPoint.TuioTime; |
||||
float dt = diffTime.TotalMilliseconds / 1000.0f; |
||||
float dx = this.xpos - lastPoint.X; |
||||
float dy = this.ypos - lastPoint.Y; |
||||
float dist = (float)Math.Sqrt(dx * dx + dy * dy); |
||||
float last_motion_speed = this.motion_speed; |
||||
|
||||
this.x_speed = dx / dt; |
||||
this.y_speed = dy / dt; |
||||
this.motion_speed = dist / dt; |
||||
this.motion_accel = (motion_speed - last_motion_speed) / dt; |
||||
|
||||
path.Add(new TuioPoint(currentTime, xpos, ypos)); |
||||
if (motion_accel > 0) state = TUIO_ACCELERATING; |
||||
else if (motion_accel < 0) state = TUIO_DECELERATING; |
||||
else state = TUIO_STOPPED; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This method is used to calculate the speed and acceleration values of |
||||
* TuioContainers with unchanged positions.</summary> |
||||
*/ |
||||
public void stop(TuioTime ttime) |
||||
{ |
||||
update(ttime, this.xpos, this.ypos); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes a TuioTime argument and assigns it along with the provided |
||||
* X and Y coordinate, X and Y velocity and acceleration |
||||
* to the private TuioContainer attributes.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="xs">the X velocity to assign</param> |
||||
* <param name="ys">the Y velocity to assign</param> |
||||
* <param name="ma">the acceleration to assign</param> |
||||
*/ |
||||
public void update(TuioTime ttime, float xp, float yp, float xs, float ys, float ma) |
||||
{ |
||||
base.update(ttime, xp, yp); |
||||
x_speed = xs; |
||||
y_speed = ys; |
||||
motion_speed = (float)Math.Sqrt(x_speed * x_speed + y_speed * y_speed); |
||||
motion_accel = ma; |
||||
path.Add(new TuioPoint(currentTime, xpos, ypos)); |
||||
if (motion_accel > 0) state = TUIO_ACCELERATING; |
||||
else if (motion_accel < 0) state = TUIO_DECELERATING; |
||||
else state = TUIO_STOPPED; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Assigns the provided X and Y coordinate, X and Y velocity and acceleration |
||||
* to the private TuioContainer attributes. The TuioTime time stamp remains unchanged.</summary> |
||||
* |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="xs">the X velocity to assign</param> |
||||
* <param name="ys">the Y velocity to assign</param> |
||||
* <param name="ma">the acceleration to assign</param> |
||||
*/ |
||||
public void update(float xp, float yp, float xs, float ys, float ma) |
||||
{ |
||||
base.update(xp, yp); |
||||
|
||||
x_speed = xs; |
||||
y_speed = ys; |
||||
motion_speed = (float)Math.Sqrt(x_speed * x_speed + y_speed * y_speed); |
||||
motion_accel = ma; |
||||
path.Add(new TuioPoint(currentTime, xpos, ypos)); |
||||
if (motion_accel > 0) state = TUIO_ACCELERATING; |
||||
else if (motion_accel < 0) state = TUIO_DECELERATING; |
||||
else state = TUIO_STOPPED; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes the atttibutes of the provided TuioContainer |
||||
* and assigs these values to this TuioContainer. |
||||
* The TuioTime time stamp of this TuioContainer remains unchanged.</summary> |
||||
* |
||||
* <param name="tcon">the TuioContainer to assign</param> |
||||
*/ |
||||
public void update(TuioContainer tcon) |
||||
{ |
||||
base.update(tcon.X, tcon.Y); |
||||
|
||||
x_speed = tcon.XSpeed; |
||||
y_speed = tcon.YSpeed; |
||||
motion_speed = (float)Math.Sqrt(x_speed * x_speed + y_speed * y_speed); |
||||
motion_accel = tcon.MotionAccel; |
||||
path.Add(new TuioPoint(currentTime, xpos, ypos)); |
||||
if (motion_accel > 0) state = TUIO_ACCELERATING; |
||||
else if (motion_accel < 0) state = TUIO_DECELERATING; |
||||
else state = TUIO_STOPPED; |
||||
} |
||||
#endregion |
||||
|
||||
/** |
||||
* <summary> |
||||
* Assigns the REMOVE state to this TuioContainer and sets |
||||
* its TuioTime time stamp to the provided TuioTime argument.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
*/ |
||||
public void remove(TuioTime ttime) |
||||
{ |
||||
currentTime = ttime; |
||||
state = TUIO_REMOVED; |
||||
} |
||||
|
||||
#region Properties & Getter/Setter Methods |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the Session ID of this TuioContainer.</summary> |
||||
* <returns>the Session ID of this TuioContainer</returns> |
||||
*/ |
||||
public long SessionID |
||||
{ |
||||
get { return session_id; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property SessionID instead is recommended.")] |
||||
public long getSessionID() |
||||
{ |
||||
return SessionID; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the X velocity of this TuioContainer.</summary> |
||||
* <returns>the X velocity of this TuioContainer</returns> |
||||
*/ |
||||
public float XSpeed |
||||
{ |
||||
get { return x_speed; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property XSpeed instead is recommended.")] |
||||
public float getXSpeed() |
||||
{ |
||||
return XSpeed; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the Y velocity of this TuioContainer.</summary> |
||||
* <returns>the Y velocity of this TuioContainer</returns> |
||||
*/ |
||||
public float YSpeed |
||||
{ |
||||
get { return y_speed; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property YSpeed instead is recommended.")] |
||||
public float getYSpeed() |
||||
{ |
||||
return YSpeed; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the position of this TuioContainer.</summary> |
||||
* <returns>the position of this TuioContainer</returns> |
||||
*/ |
||||
public TuioPoint Position |
||||
{ |
||||
get { return new TuioPoint(xpos, ypos); } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property Position instead is recommended.")] |
||||
public TuioPoint getPosition() |
||||
{ |
||||
return Position; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the path of this TuioContainer.</summary> |
||||
* <returns>the path of this TuioContainer</returns> |
||||
*/ |
||||
public List<TuioPoint> Path |
||||
{ |
||||
get { return path; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property Path instead is recommended.")] |
||||
public List<TuioPoint> getPath() |
||||
{ |
||||
return Path; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the motion speed of this TuioContainer.</summary> |
||||
* <returns>the motion speed of this TuioContainer</returns> |
||||
*/ |
||||
public float MotionSpeed |
||||
{ |
||||
get { return motion_speed; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property MotionSpeed instead is recommended.")] |
||||
public float getMotionSpeed() |
||||
{ |
||||
return MotionSpeed; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the motion acceleration of this TuioContainer.</summary> |
||||
* <returns>the motion acceleration of this TuioContainer</returns> |
||||
*/ |
||||
public float MotionAccel |
||||
{ |
||||
get { return motion_accel; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property MotionAccel instead is recommended.")] |
||||
public float getMotionAccel() |
||||
{ |
||||
return MotionAccel; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the TUIO state of this TuioContainer.</summary> |
||||
* <returns>the TUIO state of this TuioContainer</returns> |
||||
*/ |
||||
public int TuioState |
||||
{ |
||||
get { return state; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property TuioState instead is recommended.")] |
||||
public int getTuioState() |
||||
{ |
||||
return TuioState; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns true of this TuioContainer is moving.</summary> |
||||
* <returns>true of this TuioContainer is moving</returns> |
||||
*/ |
||||
public virtual bool isMoving |
||||
{ |
||||
get |
||||
{ |
||||
if ((state == TUIO_ACCELERATING) || (state == TUIO_DECELERATING)) return true; |
||||
else return false; |
||||
} |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property isMoving instead is recommended.")] |
||||
public virtual bool getIsMoving() |
||||
{ |
||||
return isMoving; |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 4b7eb4a9908ba6e4083e3a5f8917f2e7 |
||||
timeCreated: 1482467612 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,109 +0,0 @@ |
||||
/* |
||||
TUIO C# Library - part of the reacTIVision project |
||||
Copyright (c) 2005-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
|
||||
This library is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU Lesser General Public |
||||
License as published by the Free Software Foundation; either |
||||
version 3.0 of the License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Lesser General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Lesser General Public |
||||
License along with this library. |
||||
*/ |
||||
|
||||
using System; |
||||
|
||||
namespace TUIO |
||||
{ |
||||
|
||||
/** |
||||
* <summary> |
||||
* The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors.</summary> |
||||
* |
||||
* @author Martin Kaltenbrunner |
||||
* @version 1.1.5 |
||||
*/ |
||||
public class TuioCursor : TuioContainer |
||||
{ |
||||
|
||||
/** |
||||
* <summary> |
||||
* The individual cursor ID number that is assigned to each TuioCursor.</summary> |
||||
*/ |
||||
protected int cursor_id; |
||||
|
||||
#region Constructors |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes a TuioTime argument and assigns it along with the provided |
||||
* Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="si">the Session ID to assign</param> |
||||
* <param name="ci">the Cursor ID to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
*/ |
||||
public TuioCursor(TuioTime ttime, long si, int ci, float xp, float yp) |
||||
: base(ttime, si, xp, yp) |
||||
{ |
||||
cursor_id = ci; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the provided Session ID, Cursor ID, X and Y coordinate |
||||
* and assigs these values to the newly created TuioCursor.</summary> |
||||
* |
||||
* <param name="si">the Session ID to assign</param> |
||||
* <param name="ci">the Cursor ID to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
*/ |
||||
public TuioCursor(long si, int ci, float xp, float yp) |
||||
: base(si, xp, yp) |
||||
{ |
||||
cursor_id = ci; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the atttibutes of the provided TuioCursor |
||||
* and assigs these values to the newly created TuioCursor.</summary> |
||||
* |
||||
* <param name="tcur">the TuioCursor to assign</param> |
||||
*/ |
||||
public TuioCursor(TuioCursor tcur) |
||||
: base(tcur) |
||||
{ |
||||
cursor_id = tcur.CursorID; |
||||
} |
||||
#endregion |
||||
|
||||
#region Properties & Getter/Setter Methods |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the Cursor ID of this TuioCursor.</summary> |
||||
* <returns>the Cursor ID of this TuioCursor</returns> |
||||
*/ |
||||
public int CursorID |
||||
{ |
||||
get { return cursor_id; } |
||||
} |
||||
|
||||
[Obsolete("This method has been depracated and is provided only for compatability with legacy code. The CursorID property should be used instead.")] |
||||
public int getCursorID() |
||||
{ |
||||
return cursor_id; |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 54bb8d387f6dcc1479661811db078497 |
||||
timeCreated: 1482467613 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,131 +0,0 @@ |
||||
/* |
||||
TUIO C# Library - part of the reacTIVision project |
||||
Copyright (c) 2005-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
|
||||
This library is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU Lesser General Public |
||||
License as published by the Free Software Foundation; either |
||||
version 3.0 of the License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Lesser General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Lesser General Public |
||||
License along with this library. |
||||
*/ |
||||
|
||||
using System; |
||||
|
||||
namespace TUIO |
||||
{ |
||||
|
||||
/** |
||||
* <remarks |
||||
* <para> |
||||
* The TuioListener interface provides a simple callback infrastructure which is used by the {@link TuioClient} class
|
||||
* to dispatch TUIO events to all registered instances of classes that implement the TuioListener interface defined here. |
||||
* </para> |
||||
* <para> |
||||
* Any class that implements the TuioListener interface is required to implement all of the callback methods defined here. |
||||
* The {@link TuioClient} makes use of these interface methods in order to dispatch TUIO events to all registered TuioListener implementations. |
||||
* </para> |
||||
* </remarks> |
||||
* <example> |
||||
* <code> |
||||
* public class MyTuioListener implements TuioListener |
||||
* ... |
||||
* MyTuioListener listener = new MyTuioListener(); |
||||
* TuioClient client = new TuioClient(); |
||||
* client.addTuioListener(listener); |
||||
* client.start(); |
||||
* </code> |
||||
* </example> |
||||
* |
||||
* @author Martin Kaltenbrunner |
||||
* @version 1.1.5 |
||||
*/ |
||||
public interface TuioListener |
||||
{ |
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient when a new TuioObject is added to the session.</summary> |
||||
* |
||||
* <param name="tobj">the TuioObject reference associated to the addTuioObject event</param> |
||||
*/ |
||||
void addTuioObject(TuioObject tobj); |
||||
|
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session.</summary> |
||||
* |
||||
* <param name="tobj">the TuioObject reference associated to the updateTuioObject event</param> |
||||
*/ |
||||
void updateTuioObject(TuioObject tobj); |
||||
|
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session.</summary> |
||||
* |
||||
* <param name="tobj">the TuioObject reference associated to the removeTuioObject event</param> |
||||
*/ |
||||
void removeTuioObject(TuioObject tobj); |
||||
|
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient when a new TuioCursor is added to the session.</summary> |
||||
* |
||||
* <param name="tcur">the TuioCursor reference associated to the addTuioCursor event</param> |
||||
*/ |
||||
void addTuioCursor(TuioCursor tcur); |
||||
|
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session.</summary> |
||||
* |
||||
* <param name="tcur">the TuioCursor reference associated to the updateTuioCursor event</param> |
||||
*/ |
||||
void updateTuioCursor(TuioCursor tcur); |
||||
|
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session.</summary> |
||||
* |
||||
* <param name="tcur">the TuioCursor reference associated to the removeTuioCursor event</param> |
||||
*/ |
||||
void removeTuioCursor(TuioCursor tcur); |
||||
|
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient when a new TuioBlob is added to the session.</summary> |
||||
* |
||||
* <param name="tblb">the TuioBlob reference associated to the addTuioBlob event</param> |
||||
*/ |
||||
void addTuioBlob(TuioBlob tblb); |
||||
|
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient when an existing TuioBlob is updated during the session.</summary> |
||||
* |
||||
* <param name="tblb">the TuioBlob reference associated to the updateTuioBlob event</param> |
||||
*/ |
||||
void updateTuioBlob(TuioBlob tblb); |
||||
|
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient when an existing TuioBlob is removed from the session.</summary> |
||||
* |
||||
* <param name="tblb">the TuioBlob reference associated to the removeTuioBlob event</param> |
||||
*/ |
||||
void removeTuioBlob(TuioBlob tblb); |
||||
|
||||
/** |
||||
* <summary> |
||||
* This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle.</summary> |
||||
* |
||||
* <param name="ftime">the TuioTime associated to the current TUIO message bundle</param> |
||||
*/ |
||||
void refresh(TuioTime ftime); |
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 46bcfef90b64a5a4bb73b7fbe12418f4 |
||||
timeCreated: 1482467612 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,336 +0,0 @@ |
||||
/* |
||||
TUIO C# Library - part of the reacTIVision project |
||||
Copyright (c) 2005-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
|
||||
This library is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU Lesser General Public |
||||
License as published by the Free Software Foundation; either |
||||
version 3.0 of the License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Lesser General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Lesser General Public |
||||
License along with this library. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace TUIO |
||||
{ |
||||
|
||||
/** |
||||
* <remarks> |
||||
* The TuioObject class encapsulates /tuio/2Dobj TUIO objects. |
||||
* </remarks> |
||||
* |
||||
* @author Martin Kaltenbrunner |
||||
* @version 1.1.5 |
||||
*/ |
||||
public class TuioObject : TuioContainer |
||||
{ |
||||
/** |
||||
* <summary> |
||||
* The individual symbol ID number that is assigned to each TuioObject.</summary> |
||||
*/ |
||||
protected int symbol_id; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The rotation angle value.</summary> |
||||
*/ |
||||
protected float angle; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The rotation speed value.</summary> |
||||
*/ |
||||
protected float rotation_speed; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The rotation acceleration value.</summary> |
||||
*/ |
||||
protected float rotation_accel; |
||||
|
||||
#region State Enumeration Values |
||||
|
||||
/** |
||||
* <summary> |
||||
* Defines the ROTATING state.</summary> |
||||
*/ |
||||
public static readonly int TUIO_ROTATING = 5; |
||||
#endregion |
||||
|
||||
#region Constructors |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes a TuioTime argument and assigns it along with the provided |
||||
* Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="si">the Session ID to assign</param> |
||||
* <param name="sym">the Symbol ID to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle to assign</param> |
||||
*/ |
||||
public TuioObject(TuioTime ttime, long si, int sym, float xp, float yp, float a) |
||||
: base(ttime, si, xp, yp) |
||||
{ |
||||
symbol_id = sym; |
||||
angle = a; |
||||
rotation_speed = 0.0f; |
||||
rotation_accel = 0.0f; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the provided Session ID, Symbol ID, X and Y coordinate |
||||
* and angle, and assigs these values to the newly created TuioObject.</summary> |
||||
* |
||||
* <param name="si">the Session ID to assign</param> |
||||
* <param name="sym">the Symbol ID to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle to assign</param> |
||||
*/ |
||||
public TuioObject(long si, int sym, float xp, float yp, float a) |
||||
: base(si, xp, yp) |
||||
{ |
||||
symbol_id = sym; |
||||
angle = a; |
||||
rotation_speed = 0.0f; |
||||
rotation_accel = 0.0f; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the atttibutes of the provided TuioObject |
||||
* and assigs these values to the newly created TuioObject.</summary> |
||||
* |
||||
* <param name="tobj">the TuioObject to assign</param> |
||||
*/ |
||||
public TuioObject(TuioObject tobj) |
||||
: base(tobj) |
||||
{ |
||||
symbol_id = tobj.SymbolID; |
||||
angle = tobj.Angle; |
||||
rotation_speed = 0.0f; |
||||
rotation_accel = 0.0f; |
||||
} |
||||
#endregion |
||||
|
||||
#region Update Methods |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes a TuioTime argument and assigns it along with the provided |
||||
* X and Y coordinate, angle, X and Y velocity, motion acceleration, |
||||
* rotation speed and rotation acceleration to the private TuioObject attributes.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle coordinate to assign</param> |
||||
* <param name="xs">the X velocity to assign</param> |
||||
* <param name="ys">the Y velocity to assign</param> |
||||
* <param name="rs">the rotation velocity to assign</param> |
||||
* <param name="ma">the motion acceleration to assign</param> |
||||
* <param name="ra">the rotation acceleration to assign</param> |
||||
*/ |
||||
public void update(TuioTime ttime, float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) |
||||
{ |
||||
base.update(ttime, xp, yp, xs, ys, ma); |
||||
angle = a; |
||||
rotation_speed = rs; |
||||
rotation_accel = ra; |
||||
if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration |
||||
* rotation velocity and rotation acceleration to the private TuioContainer attributes. |
||||
* The TuioTime time stamp remains unchanged.</summary> |
||||
* |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle coordinate to assign</param> |
||||
* <param name="xs">the X velocity to assign</param> |
||||
* <param name="ys">the Y velocity to assign</param> |
||||
* <param name="rs">the rotation velocity to assign</param> |
||||
* <param name="ma">the motion acceleration to assign</param> |
||||
* <param name="ra">the rotation acceleration to assign</param> |
||||
*/ |
||||
public void update(float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) |
||||
{ |
||||
base.update(xp, yp, xs, ys, ma); |
||||
angle = a; |
||||
rotation_speed = rs; |
||||
rotation_accel = ra; |
||||
if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes a TuioTime argument and assigns it along with the provided |
||||
* X and Y coordinate and angle to the private TuioObject attributes. |
||||
* The speed and accleration values are calculated accordingly.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
* <param name="a">the angle coordinate to assign</param> |
||||
*/ |
||||
public void update(TuioTime ttime, float xp, float yp, float a) |
||||
{ |
||||
TuioPoint lastPoint = path[path.Count - 1]; |
||||
base.update(ttime, xp, yp); |
||||
|
||||
TuioTime diffTime = currentTime - lastPoint.TuioTime; |
||||
float dt = diffTime.TotalMilliseconds / 1000.0f; |
||||
float last_angle = angle; |
||||
float last_rotation_speed = rotation_speed; |
||||
angle = a; |
||||
|
||||
float da = (angle - last_angle) / (2.0f * (float)Math.PI); |
||||
if (da > 0.75f) da -= 1.0f; |
||||
else if (da < -0.75f) da += 1.0f; |
||||
|
||||
rotation_speed = da / dt; |
||||
rotation_accel = (rotation_speed - last_rotation_speed) / dt; |
||||
if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes the atttibutes of the provided TuioObject |
||||
* and assigs these values to this TuioObject. |
||||
* The TuioTime time stamp of this TuioContainer remains unchanged.</summary> |
||||
* |
||||
* <param name="tobj">the TuioContainer to assign</param> |
||||
*/ |
||||
public void update(TuioObject tobj) |
||||
{ |
||||
base.update(tobj); |
||||
angle = tobj.Angle; |
||||
rotation_speed = tobj.RotationSpeed; |
||||
rotation_accel = tobj.RotationAccel; |
||||
if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This method is used to calculate the speed and acceleration values of a |
||||
* TuioObject with unchanged position and angle.</summary> |
||||
*/ |
||||
public new void stop(TuioTime ttime) |
||||
{ |
||||
update(ttime, this.xpos, this.ypos, this.angle); |
||||
} |
||||
#endregion |
||||
|
||||
#region Properties & Getter/Setter Methods |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the symbol ID of this TuioObject.</summary> |
||||
* <returns>the symbol ID of this TuioObject</returns> |
||||
*/ |
||||
public int SymbolID |
||||
{ |
||||
get { return symbol_id; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public int getSymbolID() |
||||
{ |
||||
return SymbolID; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the rotation angle of this TuioObject.</summary> |
||||
* <returns>the rotation angle of this TuioObject</returns> |
||||
*/ |
||||
public float Angle |
||||
{ |
||||
get { return angle; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getAngle() |
||||
{ |
||||
return Angle; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the rotation angle in degrees of this TuioObject.</summary> |
||||
* <returns>the rotation angle in degrees of this TuioObject</returns> |
||||
*/ |
||||
public float AngleDegrees |
||||
{ |
||||
get { return angle / (float)Math.PI * 180.0f; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getAngleDegrees() |
||||
{ |
||||
return AngleDegrees; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the rotation speed of this TuioObject.</summary> |
||||
* <returns>the rotation speed of this TuioObject</returns> |
||||
*/ |
||||
public float RotationSpeed |
||||
{ |
||||
get { return rotation_speed; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getRotationSpeed() |
||||
{ |
||||
return RotationSpeed; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the rotation acceleration of this TuioObject.</summary> |
||||
* <returns>the rotation acceleration of this TuioObject</returns> |
||||
*/ |
||||
public float RotationAccel |
||||
{ |
||||
get { return rotation_accel; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getRotationAccel() |
||||
{ |
||||
return RotationAccel; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns true of this TuioObject is moving.</summary> |
||||
* <returns>true of this TuioObject is moving</returns> |
||||
*/ |
||||
public override bool isMoving |
||||
{ |
||||
get |
||||
{ |
||||
if ((state == TUIO_ACCELERATING) || (state == TUIO_DECELERATING) || (state == TUIO_ROTATING)) return true; |
||||
else return false; |
||||
} |
||||
} |
||||
#endregion |
||||
} |
||||
|
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: a8acb1fc36a04454ea75ddb6b663b4dd |
||||
timeCreated: 1482467613 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,353 +0,0 @@ |
||||
/* |
||||
TUIO C# Library - part of the reacTIVision project |
||||
Copyright (c) 2005-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
|
||||
This library is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU Lesser General Public |
||||
License as published by the Free Software Foundation; either |
||||
version 3.0 of the License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Lesser General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Lesser General Public |
||||
License along with this library. |
||||
*/ |
||||
|
||||
using System; |
||||
|
||||
namespace TUIO |
||||
{ |
||||
|
||||
/** |
||||
* The TuioPoint class on the one hand is a simple container and utility class to handle TUIO positions in general, |
||||
* on the other hand the TuioPoint is the base class for the TuioCursor and TuioObject classes. |
||||
* |
||||
* @author Martin Kaltenbrunner |
||||
* @version 1.1.5 |
||||
*/ |
||||
public class TuioPoint |
||||
{ |
||||
#region Member Variables |
||||
|
||||
/** |
||||
* <summary> |
||||
* X coordinate, representated as a floating point value in a range of 0..1</summary> |
||||
*/ |
||||
protected float xpos; |
||||
|
||||
/** |
||||
* <summary> |
||||
* Y coordinate, representated as a floating point value in a range of 0..1</summary> |
||||
*/ |
||||
protected float ypos; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The time stamp of the last update represented as TuioTime (time since session start)</summary> |
||||
*/ |
||||
protected TuioTime currentTime; |
||||
|
||||
/** |
||||
* <summary> |
||||
* The creation time of this TuioPoint represented as TuioTime (time since session start)</summary> |
||||
*/ |
||||
protected TuioTime startTime; |
||||
|
||||
#endregion |
||||
|
||||
#region Constructors |
||||
|
||||
/** |
||||
* <summary> |
||||
* The default constructor takes no arguments and sets |
||||
* its coordinate attributes to zero and its time stamp to the current session time.</summary> |
||||
*/ |
||||
public TuioPoint() |
||||
{ |
||||
xpos = 0.0f; |
||||
ypos = 0.0f; |
||||
currentTime = TuioTime.SessionTime; |
||||
startTime = new TuioTime(currentTime); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes two floating point coordinate arguments and sets |
||||
* its coordinate attributes to these values and its time stamp to the current session time.</summary> |
||||
* |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
*/ |
||||
public TuioPoint(float xp, float yp) |
||||
{ |
||||
xpos = xp; |
||||
ypos = yp; |
||||
currentTime = TuioTime.SessionTime; |
||||
startTime = new TuioTime(currentTime); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes a TuioPoint argument and sets its coordinate attributes |
||||
* to the coordinates of the provided TuioPoint and its time stamp to the current session time.</summary> |
||||
* |
||||
* <param name="tpoint">the TuioPoint to assign</param> |
||||
*/ |
||||
public TuioPoint(TuioPoint tpoint) |
||||
{ |
||||
xpos = tpoint.X; |
||||
ypos = tpoint.Y; |
||||
currentTime = TuioTime.SessionTime; |
||||
startTime = new TuioTime(currentTime); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes a TuioTime object and two floating point coordinate arguments and sets |
||||
* its coordinate attributes to these values and its time stamp to the provided TUIO time object.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
*/ |
||||
public TuioPoint(TuioTime ttime, float xp, float yp) |
||||
{ |
||||
xpos = xp; |
||||
ypos = yp; |
||||
currentTime = new TuioTime(ttime); |
||||
startTime = new TuioTime(currentTime); |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Update Methods |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes a TuioPoint argument and updates its coordinate attributes |
||||
* to the coordinates of the provided TuioPoint and leaves its time stamp unchanged.</summary> |
||||
* |
||||
* <param name="tpoint">the TuioPoint to assign</param> |
||||
*/ |
||||
public void update(TuioPoint tpoint) |
||||
{ |
||||
xpos = tpoint.X; |
||||
ypos = tpoint.Y; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes two floating point coordinate arguments and updates its coordinate attributes |
||||
* to the coordinates of the provided TuioPoint and leaves its time stamp unchanged.</summary> |
||||
* |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
*/ |
||||
public void update(float xp, float yp) |
||||
{ |
||||
xpos = xp; |
||||
ypos = yp; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes |
||||
* to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to assign</param> |
||||
* <param name="xp">the X coordinate to assign</param> |
||||
* <param name="yp">the Y coordinate to assign</param> |
||||
*/ |
||||
public void update(TuioTime ttime, float xp, float yp) |
||||
{ |
||||
xpos = xp; |
||||
ypos = yp; |
||||
currentTime = new TuioTime(ttime); |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Properties & Getter/Setter Methods |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the X coordinate of this TuioPoint.</summary> |
||||
* <returns>the X coordinate of this TuioPoint</returns> |
||||
*/ |
||||
public float X |
||||
{ |
||||
get { return xpos; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getX() |
||||
{ |
||||
return X; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the Y coordinate of this TuioPoint.</summary> |
||||
* <returns>the Y coordinate of this TuioPoint</returns> |
||||
*/ |
||||
public float Y |
||||
{ |
||||
get { return ypos; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public float getY() |
||||
{ |
||||
return Y; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the distance to the provided coordinates</summary> |
||||
* |
||||
* <param name="xp">the X coordinate of the distant point</param> |
||||
* <param name="yp">the Y coordinate of the distant point</param> |
||||
* <returns>the distance to the provided coordinates</returns> |
||||
*/ |
||||
public float getDistance(float x, float y) |
||||
{ |
||||
float dx = xpos - x; |
||||
float dy = ypos - y; |
||||
return (float)Math.Sqrt(dx * dx + dy * dy); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the distance to the provided TuioPoint</summary> |
||||
* |
||||
* <param name="tpoint">the distant TuioPoint</param> |
||||
* <returns>the distance to the provided TuioPoint</returns> |
||||
*/ |
||||
public float getDistance(TuioPoint tpoint) |
||||
{ |
||||
return getDistance(tpoint.X, tpoint.Y); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the angle to the provided coordinates</summary> |
||||
* |
||||
* <param name="xp">the X coordinate of the distant point</param> |
||||
* <param name="yp">the Y coordinate of the distant point</param> |
||||
* <returns>the angle to the provided coordinates</returns> |
||||
*/ |
||||
public float getAngle(float xp, float yp) |
||||
{ |
||||
|
||||
float side = xp - xpos; |
||||
float height = yp - ypos; |
||||
float distance = getDistance(xp, yp); |
||||
|
||||
float angle = (float)(Math.Asin(side / distance) + Math.PI / 2); |
||||
if (height < 0) angle = 2.0f * (float)Math.PI - angle; |
||||
|
||||
return angle; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the angle to the provided TuioPoint</summary> |
||||
* |
||||
* <param name="tpoint">the distant TuioPoint</param> |
||||
* <returns>the angle to the provided TuioPoint</returns> |
||||
*/ |
||||
public float getAngle(TuioPoint tpoint) |
||||
{ |
||||
return getAngle(tpoint.X, tpoint.Y); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the angle in degrees to the provided coordinates</summary> |
||||
* |
||||
* <param name="xp">the X coordinate of the distant point</param> |
||||
* <param name="yp">the Y coordinate of the distant point</param> |
||||
* <returns>the angle in degrees to the provided TuioPoint</returns> |
||||
*/ |
||||
public float getAngleDegrees(float xp, float yp) |
||||
{ |
||||
return (getAngle(xp, yp) / (float)Math.PI) * 180.0f; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the angle in degrees to the provided TuioPoint</summary> |
||||
* |
||||
* <param name="tpoint">the distant TuioPoint</param> |
||||
* <returns>the angle in degrees to the provided TuioPoint</returns> |
||||
*/ |
||||
public float getAngleDegrees(TuioPoint tpoint) |
||||
{ |
||||
return (getAngle(tpoint) / (float)Math.PI) * 180.0f; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the X coordinate in pixels relative to the provided screen width.</summary> |
||||
* |
||||
* <param name="width">the screen width</param> |
||||
* <returns>the X coordinate of this TuioPoint in pixels relative to the provided screen width</returns> |
||||
*/ |
||||
public int getScreenX(int width) |
||||
{ |
||||
return (int)Math.Round(xpos * width); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the Y coordinate in pixels relative to the provided screen height.</summary> |
||||
* |
||||
* <param name="height">the screen height</param> |
||||
* <returns>the Y coordinate of this TuioPoint in pixels relative to the provided screen height</returns> |
||||
*/ |
||||
public int getScreenY(int height) |
||||
{ |
||||
return (int)Math.Round(ypos * height); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the time stamp of this TuioPoint as TuioTime.</summary> |
||||
* |
||||
* <returns>the time stamp of this TuioPoint as TuioTime</returns> |
||||
*/ |
||||
public TuioTime TuioTime |
||||
{ |
||||
get { return new TuioTime(currentTime); } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public TuioTime getTuioTime() |
||||
{ |
||||
return TuioTime; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the start time of this TuioPoint as TuioTime.</summary> |
||||
* |
||||
* <returns>the start time of this TuioPoint as TuioTime</returns> |
||||
*/ |
||||
public TuioTime StartTime |
||||
{ |
||||
get { return new TuioTime(startTime); } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] |
||||
public TuioTime getStartTime() |
||||
{ |
||||
return StartTime; |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 4cc3fc32f3d1d59478d3f5f84aa13d2e |
||||
timeCreated: 1482467613 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,315 +0,0 @@ |
||||
/* |
||||
TUIO C# Library - part of the reacTIVision project |
||||
Copyright (c) 2005-2014 Martin Kaltenbrunner <martin@tuio.org> |
||||
|
||||
This library is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU Lesser General Public |
||||
License as published by the Free Software Foundation; either |
||||
version 3.0 of the License, or (at your option) any later version. |
||||
|
||||
This library is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
Lesser General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU Lesser General Public |
||||
License along with this library. |
||||
*/ |
||||
|
||||
using System; |
||||
|
||||
namespace TUIO |
||||
{ |
||||
|
||||
/** |
||||
* <remarks> |
||||
* The TuioTime class is a simple structure that is used to reprent the time that has elapsed since the session start. |
||||
* The time is internally represented as seconds and fractions of microseconds which should be more than sufficient for gesture related timing requirements. |
||||
* Therefore at the beginning of a typical TUIO session the static method initSession() will set the reference time for the session. |
||||
* Another important static method getSessionTime will return a TuioTime object representing the time elapsed since the session start. |
||||
* The class also provides various addtional convience method, which allow some simple time arithmetics. |
||||
* </remarks> |
||||
* |
||||
* @author Martin Kaltenbrunner |
||||
* @version 1.1.5 |
||||
*/ |
||||
public class TuioTime |
||||
{ |
||||
|
||||
/** |
||||
* <summary> |
||||
* the time since session start in seconds</summary> |
||||
*/ |
||||
private long seconds = 0; |
||||
|
||||
/** |
||||
* <summary> |
||||
* time fraction in microseconds</summary> |
||||
*/ |
||||
private long micro_seconds = 0; |
||||
|
||||
/** |
||||
* <summary> |
||||
* the session start time in seconds</summary> |
||||
*/ |
||||
private static long start_seconds = 0; |
||||
|
||||
/** |
||||
* <summary> |
||||
* start time fraction in microseconds</summary> |
||||
*/ |
||||
private static long start_micro_seconds = 0; |
||||
|
||||
#region Constructors |
||||
|
||||
/** |
||||
* <summary> |
||||
* The default constructor takes no arguments and sets |
||||
* the Seconds and Microseconds attributes of the newly created TuioTime both to zero.</summary> |
||||
*/ |
||||
public TuioTime() |
||||
{ |
||||
this.seconds = 0; |
||||
this.micro_seconds = 0; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the provided time represented in total Milliseconds |
||||
* and assigs this value to the newly created TuioTime.</summary> |
||||
* |
||||
* <param name="msec">the total time in Millseconds</param> |
||||
*/ |
||||
public TuioTime(long msec) |
||||
{ |
||||
this.seconds = msec / 1000; |
||||
this.micro_seconds = 1000 * (msec % 1000); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the provided time represented in Seconds and Microseconds |
||||
* and assigs these value to the newly created TuioTime.</summary> |
||||
* |
||||
* <param name="sec">the total time in seconds</param> |
||||
* <param name="usec">the microseconds time component</param> |
||||
*/ |
||||
public TuioTime(long sec, long usec) |
||||
{ |
||||
this.seconds = sec; |
||||
this.micro_seconds = usec; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This constructor takes the provided TuioTime |
||||
* and assigs its Seconds and Microseconds values to the newly created TuioTime.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime used to copy</param> |
||||
*/ |
||||
public TuioTime(TuioTime ttime) |
||||
{ |
||||
this.seconds = ttime.Seconds; |
||||
this.micro_seconds = ttime.Microseconds; |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Operator Overloads |
||||
|
||||
/** |
||||
* <summary> |
||||
* Sums the provided time value represented in total Microseconds to the base TuioTime.</summary> |
||||
* |
||||
* <param name="btime">the base TuioTime</param> |
||||
* <param name="us">the total time to add in Microseconds</param> |
||||
* <returns>the sum of this TuioTime with the provided argument in microseconds</returns> |
||||
*/ |
||||
public static TuioTime operator +(TuioTime atime, long us) |
||||
{ |
||||
long sec = atime.Seconds + us / 1000000; |
||||
long usec = atime.Microseconds + us % 1000000; |
||||
return new TuioTime(sec, usec); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Sums the provided TuioTime to the base TuioTime.</summary> |
||||
* |
||||
* <param name="btime">the base TuioTime</param> |
||||
* <param name="ttime">the TuioTime to add</param> |
||||
* <returns>the sum of this TuioTime with the provided TuioTime argument</returns> |
||||
*/ |
||||
public static TuioTime operator +(TuioTime btime, TuioTime ttime) |
||||
{ |
||||
long sec = btime.Seconds + ttime.Seconds; |
||||
long usec = btime.Microseconds + ttime.Microseconds; |
||||
sec += usec / 1000000; |
||||
usec = usec % 1000000; |
||||
return new TuioTime(sec, usec); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Subtracts the provided time represented in Microseconds from the base TuioTime.</summary> |
||||
* |
||||
* <param name="btime">the base TuioTime</param> |
||||
* <param name="us">the total time to subtract in Microseconds</param> |
||||
* <returns>the subtraction result of this TuioTime minus the provided time in Microseconds</returns> |
||||
*/ |
||||
public static TuioTime operator -(TuioTime btime, long us) |
||||
{ |
||||
long sec = btime.Seconds - us / 1000000; |
||||
long usec = btime.Microseconds - us % 1000000; |
||||
|
||||
if (usec < 0) |
||||
{ |
||||
usec += 1000000; |
||||
sec--; |
||||
} |
||||
|
||||
return new TuioTime(sec, usec); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Subtracts the provided TuioTime from the private Seconds and Microseconds attributes.</summary> |
||||
* |
||||
* <param name="btime">the base TuioTime</param> |
||||
* <param name="ttime">the TuioTime to subtract</param> |
||||
* <returns>the subtraction result of this TuioTime minus the provided TuioTime</returns> |
||||
*/ |
||||
public static TuioTime operator -(TuioTime btime, TuioTime ttime) |
||||
{ |
||||
long sec = btime.Seconds - ttime.Seconds; |
||||
long usec = btime.Microseconds - ttime.Microseconds; |
||||
|
||||
if (usec < 0) |
||||
{ |
||||
usec += 1000000; |
||||
sec--; |
||||
} |
||||
|
||||
return new TuioTime(sec, usec); |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Takes a TuioTime argument and compares the provided TuioTime to the private Seconds and Microseconds attributes.</summary> |
||||
* |
||||
* <param name="ttime">the TuioTime to compare</param> |
||||
* <returns>true if the two TuioTime have equal Seconds and Microseconds attributes</returns> |
||||
*/ |
||||
public bool Equals(TuioTime ttime) |
||||
{ |
||||
if ((seconds == ttime.Seconds) && (micro_seconds == ttime.Microseconds)) return true; |
||||
else return false; |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
/** |
||||
* <summary> |
||||
* Resets the seconds and micro_seconds attributes to zero.</summary> |
||||
*/ |
||||
public void reset() |
||||
{ |
||||
seconds = 0; |
||||
micro_seconds = 0; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the TuioTime Seconds component.</summary> |
||||
* <returns>the TuioTime Seconds component</returns> |
||||
*/ |
||||
public long Seconds |
||||
{ |
||||
get { return seconds; } |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the TuioTime Microseconds component.</summary> |
||||
* <returns>the TuioTime Microseconds component</returns> |
||||
*/ |
||||
public long Microseconds |
||||
{ |
||||
get { return micro_seconds; } |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the total TuioTime in Milliseconds.</summary> |
||||
* <returns>the total TuioTime in Milliseconds</returns> |
||||
*/ |
||||
public long TotalMilliseconds |
||||
{ |
||||
get { return seconds * 1000 + micro_seconds / 1000; } |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* This static method globally resets the TUIO session time.</summary> |
||||
*/ |
||||
public static void initSession() |
||||
{ |
||||
TuioTime startTime = SystemTime; |
||||
start_seconds = startTime.Seconds; |
||||
start_micro_seconds = startTime.Microseconds; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the present TuioTime representing the time since session start.</summary> |
||||
* <returns>the present TuioTime representing the time since session start</returns> |
||||
*/ |
||||
public static TuioTime SessionTime |
||||
{ |
||||
get { return SystemTime - StartTime; } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property SessionTime instead is recommended.")] |
||||
public static TuioTime getSessionTime() |
||||
{ |
||||
return SessionTime; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the absolut TuioTime representing the session start.</summary> |
||||
* <returns>the absolut TuioTime representing the session start</returns> |
||||
*/ |
||||
public static TuioTime StartTime |
||||
{ |
||||
get { return new TuioTime(start_seconds, start_micro_seconds); } |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property StartTime instead is recommended.")] |
||||
public static TuioTime getStartTime() |
||||
{ |
||||
return StartTime; |
||||
} |
||||
|
||||
/** |
||||
* <summary> |
||||
* Returns the absolut TuioTime representing the current system time.</summary> |
||||
* <returns>the absolut TuioTime representing the current system time</returns> |
||||
*/ |
||||
public static TuioTime SystemTime |
||||
{ |
||||
get |
||||
{ |
||||
long usec = DateTime.Now.Ticks / 10; |
||||
return new TuioTime(usec / 1000000, usec % 1000000); |
||||
} |
||||
} |
||||
|
||||
[Obsolete("This method is provided only for compatability with legacy code. Use of the property SystemTime instead is recommended.")] |
||||
public static TuioTime getSystemTime() |
||||
{ |
||||
return SystemTime; |
||||
} |
||||
} |
||||
} |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 6d85dc9dcd5a4584ebd92f2b0ae13d17 |
||||
timeCreated: 1482467613 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,9 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 835588de3ec3de54f8e357889ed10313 |
||||
folderAsset: yes |
||||
timeCreated: 1482488022 |
||||
licenseType: Free |
||||
DefaultImporter: |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,9 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: c2b099cde0bbd1b48807dff5ed3cc2cd |
||||
folderAsset: yes |
||||
timeCreated: 1503912043 |
||||
licenseType: Free |
||||
DefaultImporter: |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 88204e8fb26f80e4b9bdbb88d9519645 |
||||
timeCreated: 1503547507 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,13 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 750a2064e88b8dc45a94694b4d2c324b |
||||
timeCreated: 1523594583 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: fe29c1405d598044db227a4b345e815d |
||||
timeCreated: 1489129364 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 513b3b72b9bf8a4438d7c4bb4aab849e |
||||
timeCreated: 1489145429 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,13 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 7aa9f9acee84c6544ae78641b47946d8 |
||||
timeCreated: 1489050306 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: |
||||
- ball: {fileID: 10912, guid: 0000000000000000f000000000000000, type: 0} |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 679afa98eba7ead4a83f5e68ad3a9ee1 |
||||
timeCreated: 1482468162 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: efb261ab42149004580a10ea28a14a0f |
||||
timeCreated: 1482474047 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,13 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: eb0056bd31eee42408783d0f4d22afe6 |
||||
timeCreated: 1523591670 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,13 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: c0cf9367f1409d14eacc224f20a139d4 |
||||
timeCreated: 1523595222 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,13 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 2af43f939ed5a924a830f88cc306c952 |
||||
timeCreated: 1523593745 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,13 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 1fd92776ea9677a429b8f921fc0e9935 |
||||
timeCreated: 1523605961 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: a1b8f7bfe9062b34fa444249c80bb93a |
||||
timeCreated: 1490240076 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,154 +0,0 @@ |
||||
%YAML 1.1 |
||||
%TAG !u! tag:unity3d.com,2011: |
||||
--- !u!1001 &100100000 |
||||
Prefab: |
||||
m_ObjectHideFlags: 1 |
||||
serializedVersion: 2 |
||||
m_Modification: |
||||
m_TransformParent: {fileID: 0} |
||||
m_Modifications: [] |
||||
m_RemovedComponents: [] |
||||
m_ParentPrefab: {fileID: 0} |
||||
m_RootGameObject: {fileID: 1641997025252556} |
||||
m_IsPrefabParent: 1 |
||||
--- !u!1 &1641997025252556 |
||||
GameObject: |
||||
m_ObjectHideFlags: 0 |
||||
m_PrefabParentObject: {fileID: 0} |
||||
m_PrefabInternal: {fileID: 100100000} |
||||
serializedVersion: 5 |
||||
m_Component: |
||||
- component: {fileID: 4472652550524646} |
||||
- component: {fileID: 114540009425154000} |
||||
- component: {fileID: 114872970294644716} |
||||
- component: {fileID: 114080462365263002} |
||||
- component: {fileID: 114569137293014918} |
||||
- component: {fileID: 114504107585269582} |
||||
- component: {fileID: 114833196982375236} |
||||
m_Layer: 0 |
||||
m_Name: UCEventSystem |
||||
m_TagString: Untagged |
||||
m_Icon: {fileID: 0} |
||||
m_NavMeshLayer: 0 |
||||
m_StaticEditorFlags: 4294967295 |
||||
m_IsActive: 1 |
||||
--- !u!4 &4472652550524646 |
||||
Transform: |
||||
m_ObjectHideFlags: 1 |
||||
m_PrefabParentObject: {fileID: 0} |
||||
m_PrefabInternal: {fileID: 100100000} |
||||
m_GameObject: {fileID: 1641997025252556} |
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} |
||||
m_LocalPosition: {x: 0, y: 0, z: 0} |
||||
m_LocalScale: {x: 1, y: 1, z: 1} |
||||
m_Children: [] |
||||
m_Father: {fileID: 0} |
||||
m_RootOrder: 0 |
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
||||
--- !u!114 &114080462365263002 |
||||
MonoBehaviour: |
||||
m_ObjectHideFlags: 1 |
||||
m_PrefabParentObject: {fileID: 0} |
||||
m_PrefabInternal: {fileID: 100100000} |
||||
m_GameObject: {fileID: 1641997025252556} |
||||
m_Enabled: 1 |
||||
m_EditorHideFlags: 0 |
||||
m_Script: {fileID: 11500000, guid: 513b3b72b9bf8a4438d7c4bb4aab849e, type: 3} |
||||
m_Name: |
||||
m_EditorClassIdentifier: |
||||
m_HorizontalAxis: Horizontal |
||||
m_VerticalAxis: Vertical |
||||
m_SubmitButton: Submit |
||||
m_CancelButton: Cancel |
||||
m_InputActionsPerSecond: 10 |
||||
m_RepeatDelay: 0.5 |
||||
m_ForceModuleActive: 0 |
||||
forceProcessMouseEvent: 1 |
||||
--- !u!114 &114504107585269582 |
||||
MonoBehaviour: |
||||
m_ObjectHideFlags: 1 |
||||
m_PrefabParentObject: {fileID: 0} |
||||
m_PrefabInternal: {fileID: 100100000} |
||||
m_GameObject: {fileID: 1641997025252556} |
||||
m_Enabled: 1 |
||||
m_EditorHideFlags: 0 |
||||
m_Script: {fileID: 11500000, guid: 7aa9f9acee84c6544ae78641b47946d8, type: 3} |
||||
m_Name: |
||||
m_EditorClassIdentifier: |
||||
ball: {fileID: 10912, guid: 0000000000000000f000000000000000, type: 0} |
||||
debugInput: 0 |
||||
--- !u!114 &114540009425154000 |
||||
MonoBehaviour: |
||||
m_ObjectHideFlags: 1 |
||||
m_PrefabParentObject: {fileID: 0} |
||||
m_PrefabInternal: {fileID: 100100000} |
||||
m_GameObject: {fileID: 1641997025252556} |
||||
m_Enabled: 1 |
||||
m_EditorHideFlags: 0 |
||||
m_Script: {fileID: 11500000, guid: efb261ab42149004580a10ea28a14a0f, type: 3} |
||||
m_Name: |
||||
m_EditorClassIdentifier: |
||||
blobFilters: |
||||
- {fileID: 114872970294644716} |
||||
objectFilters: [] |
||||
TouchFps: 0 |
||||
ObjectFps: 0 |
||||
TuioPort: 3333 |
||||
AddTuioObjectEvent: |
||||
m_PersistentCalls: |
||||
m_Calls: [] |
||||
m_TypeName: TUIOManager+TuioObjectHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, |
||||
PublicKeyToken=null |
||||
UpdateTuioObjectEvent: |
||||
m_PersistentCalls: |
||||
m_Calls: [] |
||||
m_TypeName: TUIOManager+TuioObjectHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, |
||||
PublicKeyToken=null |
||||
RemoveTuioObjectEvent: |
||||
m_PersistentCalls: |
||||
m_Calls: [] |
||||
m_TypeName: TUIOManager+TuioObjectHandler, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, |
||||
PublicKeyToken=null |
||||
--- !u!114 &114569137293014918 |
||||
MonoBehaviour: |
||||
m_ObjectHideFlags: 1 |
||||
m_PrefabParentObject: {fileID: 0} |
||||
m_PrefabInternal: {fileID: 100100000} |
||||
m_GameObject: {fileID: 1641997025252556} |
||||
m_Enabled: 1 |
||||
m_EditorHideFlags: 0 |
||||
m_Script: {fileID: 11500000, guid: fe29c1405d598044db227a4b345e815d, type: 3} |
||||
m_Name: |
||||
m_EditorClassIdentifier: |
||||
ignoreAppFocus: 0 |
||||
--- !u!114 &114833196982375236 |
||||
MonoBehaviour: |
||||
m_ObjectHideFlags: 1 |
||||
m_PrefabParentObject: {fileID: 0} |
||||
m_PrefabInternal: {fileID: 100100000} |
||||
m_GameObject: {fileID: 1641997025252556} |
||||
m_Enabled: 1 |
||||
m_EditorHideFlags: 0 |
||||
m_Script: {fileID: 11500000, guid: a1b8f7bfe9062b34fa444249c80bb93a, type: 3} |
||||
m_Name: |
||||
m_EditorClassIdentifier: |
||||
m_FirstSelected: {fileID: 0} |
||||
m_sendNavigationEvents: 1 |
||||
m_DragThreshold: 5 |
||||
--- !u!114 &114872970294644716 |
||||
MonoBehaviour: |
||||
m_ObjectHideFlags: 1 |
||||
m_PrefabParentObject: {fileID: 0} |
||||
m_PrefabInternal: {fileID: 100100000} |
||||
m_GameObject: {fileID: 1641997025252556} |
||||
m_Enabled: 1 |
||||
m_EditorHideFlags: 0 |
||||
m_Script: {fileID: 11500000, guid: c0cf9367f1409d14eacc224f20a139d4, type: 3} |
||||
m_Name: |
||||
m_EditorClassIdentifier: |
||||
customRoi: |
||||
serializedVersion: 2 |
||||
x: 0 |
||||
y: 0 |
||||
width: 0 |
||||
height: 0 |
||||
@ -1,8 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 1f68bf7cec2600e49a46d2f0554453c8 |
||||
timeCreated: 1490242242 |
||||
licenseType: Free |
||||
NativeFormatImporter: |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1,12 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 8254c9084159a264e81e721f51ae2066 |
||||
timeCreated: 1496388358 |
||||
licenseType: Pro |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
@ -1 +1 @@ |
||||
Subproject commit da27a6820768fa330cc335ae0b470e874cad395f |
||||
Subproject commit ca704e07d74af1887017c9b8a295f5bfd2fd8a41 |
||||
@ -0,0 +1 @@ |
||||
Subproject commit e594dfc8647586530b53cd990d56caa0d07adde2 |
||||
@ -0,0 +1 @@ |
||||
Subproject commit a91e9cf29e230c28d7fd72f78e790c9b68513d62 |
||||
Loading…
Reference in new issue