Main Content

vrworld

(To be removed) Create new vrworld object associated with virtual world

vrworld will be removed in a future release. For more information, see Version History.

Syntax

myworld = vrworld(filename)
myworld = vrworld(filename,'reuse')
myworld = vrworld(filename, 'new')
myworld = vrworld
myworld = vrworld('')
myworld = vrworld([])

Arguments

filename

String containing the name of the virtual world 3D file from which the virtual world is loaded. You can specify .wrl, .x3d, or .x3dv). If no file extension is specified, the file extension .wrl is assumed.

'new'

Argument to create a virtual world associated with filename.

Description

myworld = vrworld(filename) creates a virtual world associated with the virtual world 3D file filename and returns its handle. If the virtual world already exists, a handle to the existing virtual world is returned. Specify the file name as a string.

myworld = vrworld(filename,'reuse') has the same functionality as myworld = vrworld(filename).

myworld = vrworld('filename', 'new') creates a virtual world associated with the virtual world 3D file filename and returns its handle. It always creates a new virtual world object, even if another vrworld object associated with the same file already exists.

myworld = vrworld creates an invalid vrworld handle

myworld = vrworld('') creates an empty vrworld object that is not associated with any virtual world 3D file

myworld = vrworld([]) returns an empty array of returns an empty array of vrworld handles.

A vrworld object identifies a virtual world in a way very similar to a handle. All functions that affect virtual worlds accept a vrworld object as an argument to identify the virtual world.

If the given virtual world already exists in memory, the handle to the existing virtual world is returned. A second virtual world is not loaded into memory. If the virtual world does not exist in memory, it is loaded from the associated virtual world 3D file. The newly loaded virtual world is closed and must be opened before you can use it.

The vrworld object associated with a virtual world remains valid until you use either delete or vrclear.

Examples

myworld = vrworld('virtual world object name')

Method Summary

MethodDescription
addexternprotoAdd externproto declaration to virtual world.
closeClose virtual world
deleteRemove virtual world from memory
editOpen virtual world file in external virtual world editor
getProperty value of vrworld object
isvalid1 if vrworld object is valid, 0 if not
nodesList nodes available in virtual world
openOpen virtual world
reloadReload virtual world from virtual world 3D file
saveWrite virtual world to virtual world 3D file
setChange property values of vrworld object
viewView virtual world
optimizeChange geometries to reduce number of vertices
rootReturn the root node of the world

Version History

Introduced before R2006a

collapse all

R2023b: To be removed

The vrworld will be removed in a future release. Instead, use sim3d classes and Simulation 3D blocks to interface MATLAB® and Simulink® with the Unreal Engine® 3D simulation environment. To get started, see Create 3D Simulations in Unreal Engine Environment.