Main Content

changeWorldSettings

Modify world settings of active scene using MATLAB

Since R2023b

    Description

    example

    changeWorldSettings(rrApp,Name=Value) modifies the world settings of the active scene, including the world origin and scene extents.

    Examples

    collapse all

    Modify world settings of active scene in RoadRunner using the changeWorldSettings function. This example assumes that RoadRunner is installed in its default location in Windows.

    Specify the path to an existing project. For example, this code shows the path to a project located on C:\RR\MyProject. The function returns a roadrunner object, rrApp, that provides functions for performing basic workflow tasks such as opening, closing, and saving scenes and projects.

    projectFolder = "C:\RR\MyProject";
    rrApp = roadrunner(projectFolder, InstallationFolder='C:\Program Files\RoadRunner R2023b\bin\win64');

    Open an existing scene in the current RoadRunner project.

    filename = "FourWayStop.rrscene";
    openScene(rrApp,filename);

    Change the world origin of the scene. Specify the world origin as a 1-by-2 matrix which contains the latitude and longitude.

    changeWorldSettings(rrApp, WorldOrigin=[42.3021 -71.3747]);

    Input Arguments

    collapse all

    RoadRunner application associated with a project, specified as a roadrunner object. This object provides functions for performing common workflow tasks such as opening, closing, and saving scenes and projects. rrApp provides functions that support importing data from files and exporting scenes to other formats from RoadRunner.

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: changeWorldSettings(rrApp, WorldOrigin=[42.3021 -71.3747])

    Clear the current world projection, specified as logical 0 (false) or logical 1 (true). It clears the current world projection if it is set to true. When set to true, it is an error to specify a world origin.

    World origin of the scene, specified as a 1-by-2 array [latitude longitude]. By default, the world origin is not changed.

    Flag to transform scene, specified as logical 0 (false) or logical 1 (true). It transforms the scene after changing the world origin if it is set to logical 1 (true). Transforming the scene can be a costly operation, but it attempts to maintain the correct world location.

    Center of the scene, specified as a 1-by-2 array [x y]. By default, the center of the scene is not changed.

    Extent of the scene, specified as a 1-by-2 array [x y]. By default, the center of the scene is not changed.

    Version History

    Introduced in R2023b