VR Source
(To be removed) Read data from virtual world to Simulink model
VR Source will be removed in a future release. For more information, see Version History.
Libraries:
Simulink 3D Animation
Description
Use the VR Source block to provide interactivity between a user navigating the virtual world and the simulation of a Simulink® model. The VR Source block registers user interactions with the virtual world and passes that data to the model to affect the simulation of the model. The VR Source reads values from virtual world fields specified in the Block Parameters dialog box and inputs their values to a model.
Examples of some ways that you can use a VR Source block to input data from a virtual world to a Simulink model include:
Use sensor data from a virtual world to control a simulation. For details, see Add Sensors to Virtual Worlds and Detect Object Collisions.
Provide interactivity between user navigation and interaction in a virtual world and the simulation of the model.
Have a simulation react to virtual world events, such as time ticks or outputs from scripts.
Use static information from the virtual world, such as the size of a box, to control a simulation.
For example, you can specify setpoints in the virtual world, so that user can specify the location of a virtual world object interactively. The simulation then responds to the changed location of the object. The VR Source block can read into the model events from the virtual world, such as time ticks or outputs from scripts. The VR Source block can also read into the model static information about the virtual world (for example, the size of a box defined in the virtual world 3D file).
Note
The current internal viewer window (vrfigure
) properties are
saved together with the Simulink model. The next time that you open the model, the internal viewer
window opens with the same parameters that were saved, such as position, size, and
navigation mode. When closing the viewer window, the Simulink software does not alert you if these properties have changed.
To open the Block Parameters dialog box VR Source block:
When you first add a VR Source block and it is still not associated with a virtual world, double-click the block.
Otherwise, in the Simulink 3D Animation™ Viewer, select SimulationBlock parameters. If the viewer is not already open, you can open it by double-clicking the VR Source block.
You cannot use the Simulink Coder™ software to compile a model that includes a VR Source block.