Friday, July 2, 2010

system.presences

Concretizing our concept of presences and separating the entities from presences, we have a new reference to system.presences in the Emerson.  At present, we have two addressable arrays:  system.presences and system.addressable .  Presences are the self address of the hosted entity each in different space. IT is just a logical connection. Currently, we just store the spaceID of the space in the presence javascript object which should be sufficient for most purposes.  Addressables lets the script to refer other presences of other entities. However, addressables will contain presences too.

Following this, work needs to be done to unify addressables and presences. The idea is that a presence can do few things synchronously too while addressables will always require the asynchronous messaging. A bit more thought has to go into designing this. Currently addressable does not store the space information of the entity. And this has to be incorporated too.

Next thing would be to add functionalities like system.presences[0].setMesh  and other functionalities similar to this. All these are inbuilt into system currently and assumes the default connection to the space.These have to be made space specific.

Thursday, July 1, 2010

system.create_entity

Emerson finally has the ability to create scripted entities from an executing script. This is achieved by following


           system.create_entity(Vector3d pos&)


The (presence of )new entity will be at the position specified by pos and with other default location properties. Entity creation is an asynchronous operation and will not block the running script. The script for the new entity is initialized only after the new entity is connected to space.


There are few things that need to be solved as followup of this feature:



  1. create_entity can take more arguments. 
    1. Texture
    2. Reference to existing entity
    3.  may beLocation features like orientation, velocity
    4. A script to attach to the script
  2. The addressable array for all the neighboring entities and the new entity should be updated to reflect the new entity. This can be done by adding a callback in ObjectScript and calling it when the space confirms the new entity is connected.


Screen Shots of new entities. The small cubes were created while running the "create.js" script.