We’re very excited about today’s progress.
The first thing we did this morning was to explore how to identify WonderBlocks and WonderBlock Connections via mouse click in-world. This turned out to be simpler than we anticipated. The solution involved adding Blocks and Connections to their own Java3D branch groups, rather than adding every component to one large branch group like we’d been doing previously. The mouse listeners available in the Wonderland API are able to identify a branch group when an object inside it is clicked on in-world. Thus, we now use a HashMap that maps BranchGroups to BlockIDs/BlockConnectionIDs in order to identify an object when it is clicked on.
With the newfound ability to identify in-world objects on click, we then fully implemented in-world deletion of Blocks and their associated connections. Objects can be deleted simply by choosing the ‘delete’ button from the WonderBlocks HUD, which will put the client in Delete Mode. Clicking on any Block then deletes that Block and any connections associated with it, while clicking on a connection simply deletes that connection. These changes are triggered on any given client, which then notifies the server that a deletion should take place. After updating its own internal model of the WonderBlocks state, the server instructs all connected clients to locally perform the delete operation.
An architectural change we made is to have each client contain seperate copies of the two manager classes, BlockManager and BlockConnectionManager. This makes it very easy to perform deletions graphically; the same algorithms that are used to manage the server’s state can also be used to remove objects from the screen on the client (such as deleting a Block’s associated connections when the Block itself is deleted.)
Tomorrow, we’ll most likely explore how to implement creating new WonderBlocks or connections in-world.