Class WorldObjects


@RestController @RequestMapping("/vrspace/api/world") public class WorldObjects extends ClientControllerBase
Interact with the current world: add, remove, and change basic properties of VRObject instances. Instances of VRObject subclasses (e.g. User, Terrain) cannot be accessed this way. To be removed or changed, the object must be owned, and present in the scene (i.e. visible).
Author:
joe
  • Field Details

  • Constructor Details

    • WorldObjects

      public WorldObjects()
  • Method Details

    • addObject

      @PutMapping("/add") public VRObject addObject(jakarta.servlet.http.HttpSession session, @RequestBody VRObject obj)
      Add a shared object to the world, equivalent of websocket Add command. Once created, the object is immediately published, i.e. pushed to all clients, including the creator, through websockets. Unlike Add command, that can be used to create world objects of any class, e.g. Terrain, this can only create VRObject class instances.
      Parameters:
      obj - VRObject to create, must not have an id
      Returns:
      the created VRObject, including the id
    • removeObject

      @DeleteMapping("/remove") public void removeObject(jakarta.servlet.http.HttpSession session, String id)
      Remove a shared VRObject.
      Parameters:
      id - object id
    • objectCoordinates

      @PatchMapping("/coordinates") public void objectCoordinates(jakarta.servlet.http.HttpSession session, @RequestBody VRObject changes)
      Change position, rotation and/or scale of an object. All other object properties are ignored.