The world where the sound scene exists. It can contain an arbitrary number of SSObject.
A SSWorld
presents some settable physical parameters (gravity, friction...), that objects are subject to.
There is a sweet spot in the bottom center of the room, where the objects cannot be located. For a room with dimmension dim =[x,y,z]
, the room center will be [0,0,0]
, and the possible locations: [ -x/2 to x/2, -y/2 to y/2, 0 to z ]. If an object location exceeds world limits, it will be relocated in the equivalent folded position.
The SSWorld
is continuously monitoring what happens inside, and sending to a desired addres the scene description in OSC-SpatDIF format.
It is a subclass of RedWorld1. Notice that, in contraposition with its superclass, the SSWorld is the higher level element. There is, for the moment, not a such thing like SSUniverse.
dim |
Default to [10, 10, 5]. |
gravity |
Default to [0, 0, 0.98] |
maxVel |
Light velocity : maximum velocity allowed in the world, in m/s. Default to 100. |
damping |
Coefficient of energy loss when an object rebounces in the wall. 0 for nothing and 1 for all. Default to 0.25 |
friction |
Coefficient of velocity loss in contact with the medium. 0 for nothing and 1 for all. Default to 0.01 |
timeStep |
Frequency of monitoring changes inside the world, and generating the scene description. Default to 60 Hz. |
netAddr |
Instance of Default to |
Get/set the world dimensions.
value |
|
newSize |
Radius in meters. Default to 2 m |
Get/set the world's update frequency.
Get/set the distance JND: minimum distance change (in spherical coordenates) to be considered as a different position.
Default to 0.05 m.
Get/set the azimuth JND: minimum angle change to be considered as a different position.
Default to 1 degree.
Get/set the elevation JND: minimum angle change to be considered as a different position.
Default to 5 degrees.
Get the world's coordinate system center.
Cartesian()
Get the maximum possible distance from any point to the world's coordinate system center.
Get/set the medium friction parameter. A number between 0 (no friction) and 1 (every time step, velocity will be decreased a 100%)
Stop the time passing.
Resume the time passing, as if nothing happened.
Forces a world update. This can be useful when the world is paused.
This method is called automatically every SSWorld: -stepFreq
Add an object to the world. This method is called automatically from SSObject: *new
obj |
an instance of |
Remove completely the given object from the world
obj |
An instance of |
Remove completely the given object from the world
name |
A |
Ask if the world contains the given object.
ssObj |
An instance of |
Boolean
Get the reference to an object, given its name
objName |
A |
The SSObject
instance, or nil
if not found
an Array with references to all existing SSObjects
an Array with the names of all existing SSObjects
Get the number of exisisting objects in the world
Show the world's view
Hide the world's view
Set the alwaysOnTop property of the world's view
If true
, update world's view only after checking that the scene changed. If false
, update it in a continuous way (every stepFreq.reciprocal
seconds)
Default to false
Show or hide the object names in the view
Closes the window
Get the list of all Classes/SpatialRender
addresses where to send the scene information.
Multiple addresses are allowed, in order to support remote control.
By default, there will be only the NetAddress
provided in instanciation.
Add a NetAddress
to the SSWorld: -renderAddresses
Remove a NetAddress
to the SSWorld: -renderAddresses
The removed NetAddress
if succesful, or nil
if not.
If this
receives any external messages (from SpatDifPlayer
playback or remote control), SSWorld: -receivingFromServer will be automatically set to true. In that case, the world won't update itself (avoiding message redundancy to the server).
The user can set its value at any time through the set method.