All data and functions exist in a global object accessible as ReactiveSpaces or simple RS.
Stores the base host/url for connecting to the desktop client. In most cases, this should not be changed. If you wanted to try launching the desktop app on another PC and then use its Kinect, it should theoretically work by changing this address. Default value : "ws://localhost"
Stores the port on which to connect to the desktop app. Only change this value if you needed to change the connection port in the desktop app. Default value : 8080
Stores the number of milliseconds delay required between each sent message. Shortening this value could cause instability and lag in the system and server. If you’re game requires messages more often than this, you should look at using a true multiplayer system. Default value : 100 RS.SUPORTED_PLAYERS = 2; Represents the maximum number of local players that will ever be tracked. Changing this value has no effect. Default value : 2
Boolean value denoting weather or not to blend skeleton frame data and create smoother joint movement. Turning this off can improve performance, but blended joint positions will no longer update. Default value : true
Stores weather or not the browser supports web sockets. If false, Reactive Spaces will not be able to connect to the desktop app or server.
Stores the current socket connection to the desktop app (if any).
Boolean value representing the current connection status of Reactive Spaces.
UNIX timestamp denoting the last time a message was sent from Reactive Spaces to the desktop app.
Stores the RS.StationProfile object representing the local station information. If no connection to the desktop app has been made, this value can also be null.
Stores a list of RS.StationProfile objects representing the remote stations that are in the same game session.
Stores a list of RS.Skeleton objects representing the current local players.
Stores a list of RS.Skeleton objects representing the current remote players.
UNIX timestamp denoting the last time the blended skeleton data was updated.
Stores all event listeners added to Reactive Spaces
Provides basic error logging capabilities for Reactive Spaces. Also defines a Global Message object which has an enumerator for message types defined as Message.type = {“MESSAGE” : 0, “WARNING” : 1, “ERROR” : 2}
Stores information about the connected web app. Members are: name, version, maxPeers. Default Value:{ name: "Default App Name", version: 0, maxPeers: 4 }
appName : name of web app that is connecting appVersion : version of app that is connecting (int or float). Only app instances with the same version will be matched on the server features : list of features that are required by the app. Use enumerator RS.Features. port (optional): connection port to use. If omitted, RS.LOCALPORT will be used Attempts to connect to the Reactive Spaces Desktop App. Returns true or false depending on whether connection was successful or not.
Disconnects from the desktop app and server.
DUpdates the blended skeleton positions. Called automatically when RS.MOVEMENT_BLENDING is true on connection. Can be called manually on your apps update loop if desired.
Reactive Spaces provides an optional messenger system to display messages, warnings and errors easily. Include the messenger in you project with script src=” http://reactivespacesapi.com/lib/Messenger.js And then call this function to upgrade RS.messenger to this advanced messenger. Post your own messages with RS.messenger.display( Messenge.type type, string message, string solution).
event : string denoting the envent to listen to. Use enumerator RS.Events or see RS.Events in the documentation for a full list callback : function pointer for function to be called when event fires
This function currently has no effect
Tobject: javascript object to send Sends the given object to all stations in the current app session.
Draws given skeleton on the given 2D context. Maps screen position to the bounds of the canvas. context: valid 2D drawing context for an html 5 canvas skeleton: valid skeleton object from ReactiveSpaces color (optional): string canvas color identifier, default is "#FFF" blend (optional): boolean - sets weather or not to use the blended skeleton. RS.MOVEMENT_BLEND must be set to true (default is false)
Describes the skeleton object that ReactiveSpaces uses to store Kinect data
skeleton: the skeleton object to copy the data from Updates the joint positions and data from another skeleton object. This is used for incoming data streams from the desktop.
Blends previous skeleton with current skeleton. ****
skeleton: the skeleton object to copy the data from Describes a skeleton joint object
joint: valid RS.SkeletonJoint object Copies data of the given joint into this one
Called by ReactiveSpaces to update the smoothed screenPosition. Also updates joint velocities.
x (optional): inital x value, default is 0 y (optional): inital y value, default is 0 z (optional): inital z value, default is 0 A simple object which defines a 3D point (x, y, z)
x (optional): inital x value, default is 0 y (optional): inital y value, default is 0 z (optional): inital z value, default is 0 A simple object which defines a 3D point (x, y, z)
vector: object to copy from {x, y, z} Sets the value of this vector from another vector. If x, y, or z are unset on the object it sets 0.
vector: object to add {x, y, z} Adds given vector.
vector: object to subract {x, y, z} Subtracts given vector.
scalar: number to multiple vector by Multiplies the vector by given scalar.
Normalizes vector, length of vector = 1.
Returns the length of the vector.
Returns the squared length of the vector.
Shows what features are supported.
Kinect | 0 |
To pick joints from the skeleton object.
Head | 0 |
SHOULDER_CENTER | 1 |
SPINE | 2 |
HIP_CENTER | 3 |
SHOULDER_LEFT | 4 |
SHOULDER_RIGHT | 5 |
ELBOW_LEFT | 6 |
ELBOW_RIGHT | 7 |
WRIST_LEFT | 8 |
WRIST_RIGHT | 9 |
HAND_LEFT | 10 |
HAND_RIGHT | 11 |
HIP_LEFT | 12 |
HIP_RIGHT | 13 |
KNEE_LEFT | 14 |
KNEE_RIGHT | 15 |
ANKLE_LEFT | 16 |
ANKLE_RIGHT | 17 |
FOOT_LEFT | 18 |
FOOT_RIGHT | 19 |
Enumerator for incoming web socket messages.
APP_INFO | 0 |
CUSTOM | 1 |
KINECT | 2 |
REMOTE_KINECT | 3 |
STATION_PROFILE | 4 |
PEER_CONNECT | 5 |
PEER_UPDATE | 6 |
PEER_DISCONNECT | 7 |
LOCAL_PLAYER_ENTER | 8 |
LOCAL_PLAYER_EXIT | 9 |
REMOTE_PLAYER_ENTER | 10 |
REMOTE_PLAYER_EXIT | 11 |
FEATURE_MISSING | 12 |
A simple list of event types dispatched by ReactiveSpaces.
connect |
disconnect |
localkinectT |
remotekinect |
message |
featuremissing |
stationlocal |
stationconnect |
stationupdate |
satationdisconnect |
localplayerenter |
localplayerexit |
remoteplayerenter |
remoteplayerexit |
Carleton University | Canal Building Ottawa, Ontario
Zara Tooth Ryan Bottriell Matthew Fournier Marco Brito