SETObject

/*

Author

2004 - 2008

Till Bovermann 

Neuroinformatics Group 

Faculty of Technology 

Bielefeld University

Germany

*/


Abstract class. See

SETObject.subclasses

for implementations.


Representation of a tangible object in SuperCollider.

Used at [SETOServer].

Each object-change first sets the changed parameter slots to the new values and 

then calls 

SETObject:update


Recognized SETO types are


2Dobj

/tuio/2Dobj set <sessionID> ixyaXYAmr

/tuio/2Dobj alive [sessionID * #numberOfActiveObjects]


3Dobj

/tuio/3Dobj set <sessionID> ixyzabcXYZABCmr

/tuio/3Dobj alive [sessionID * #numberOfActiveObjects]


and a combination of

_[ixyzabcXYZABCmrP]


each object may has

sessionID temporary object ID (required)

i class ID

x,y,z position in [0..1]

a,b,c rotation in [0..2pi], OR

u, v, w rotation in axis notation

X,Y,Z velocity in float

A,B,C rotation velocity in euler coordinates

U,V,W rotation velocity in axis notation

m pos. acceleration

r rot. acceleration

P freely definable


// create a TUIObject, and use it to store messages coming from an [OSCReceiver]

t = SETObject('2DObj', 4711);


r = OSCReceiver('/tuio/2Dobj', nil);

/*

r = OSCReceiver('/tuio/2Dobj', NetAddr("127.0.0.1", 57120));

*/

r.start;

OSCReceiverFunction(r, \set, {|sessionID, i, x, y, a, dX, dY, dA, m, r| 

[sessionID, i, x, y, a, dX, dY, dA, m, r].postln;

// t.id = sessionID; // not possible; id only settable at instantiation.

t.classID = i;

t.pos = [x,y,a];

t.velocity = [dX, dY, dA];

t.acceleration = [m,r];

});


// send some update messages

a = NetAddr("127.0.0.1", 57120);

a.sendMsg('/tuio/2Dobj', \set, 4711, 42, 0, 1, 2, 3, 4, 5, 6, 7);


(

(

("ID:\t"+t.id) + "\n" ++

("Class:\t"+t.classID) + "\n" ++

("Position:\t"+t.pos) + "\n" ++

("Velocity:\t"+t.velocity) + "\n" ++

("Acceleration:\t" +t.acceleration)

).postln;

)