Home About XEngine Engine API SceneGraph Changelog Programming Guide


| Scene Description Language | camera | directory | eventmessage | geometry | group | input | light | node | primitives | root | spinner | transformation | user |

Root Node

Derived from: Group3D
Class name: World3D

This is the containing node of all other scene graph nodes in the hierarchy. Similarly, if a scene description file is provided, it is the topmost tag of the XML scene file. It must be unique as it represents the root of the whole scene graph. It provides global attributes and operations, such as the reset message and access to the entire list of node names..


Function List

Name XE_scene_set_file
Arguments const char* scene_filename
Return Type bool
Description Sets an external scene file (as shown in the example)

- scene_filename, the path

Returns true if the scene_filename was found

Name XE_scene_parse_file
Arguments none
Return Type bool
Description Explicit parsing call for the external file (implicitly is parsed on XE_engine_initialize)

Returns true if the parsing was successful

Name XE_scene_append_app_path
Arguments const char* path
Return Type void
Description Adds a new application path. Application paths are used in conjunction with relative data paths or shader paths (which are always relative) to locate data files or shader files. This decouples the need to associate the data and shader locations with the executable location.
By default, the executable's location is the first app path.

- path, the application path
Notes: This call can coexist with the external XML configuration file. This function must be called before XE_engine_create

Name XE_scene_append_data_path
Arguments const char* path, bool is_relative
Return Type void
Description Adds a new data path. Data paths are used as the root folder to of locations data such as geometry files, textures, scene files, etc. Since, most data lie on their respective folders, an extra call to XE_scene_append_directory is used to add a specific directory to the data paths.
In the example, the root data folder is EngineData which is located one folder above the executable folder. Then, the call should be XE_scene_append_data_path("../EngineData", true);
To load the .obj file located in EngineData/Reassembled_DoraEmbrasure we perform an additional call to XE_scene_append_directory("Reassembled_DoraEmbrasure") in order to inform the application to look for the obj file in this folder.

The reason this is separate is because Data paths are global engine settings.
Directory paths are scene specific settings (they can also be set with the directory tag within the XML scene file).

- path, the data path
- is_relative, a flag indicating whether this path is a relative path and should be attached to the application paths
Notes: This call can coexist with the external XML configuration file. This function must be called before XE_engine_create

Name XE_scene_read_name
Arguments const char* scene_filename
Return Type void
Description If an external configuration file has been provided with a scene filename, then this function reads the scene name.

scene_filename, retrieves the scene_filename, otherwise sets the parameter to null


Scene Description Language Declaration

Derived from: Group3D
Class name: World3D
Placement: Topmost tag. Can only be one in each scene file.
Special notes: The world node has a predefined name: %root, which cannot be overriden.
Inherited attributes: visible, active
New attributes:
attribute type description
ambient VEC3 The global ambient color. If the ambient_occlusion method is set to none, ambient is additively blended with the direct illumination. Otherwise, it is first modulated by the ambient occlusion term. Default is (0.1,0.1,0.1).
background VEC3 The background color.
Default is (0.15,0.15,0.15).
event name condition
init When the scene graph is ready to run, after the init procedure has finished.
Inherited events: -
New messages:
attribute value description
Inherited messages: enable, disable, activate, deactivate, hide, show, visible, active
Redefined messages: -
Obsolete messages: -


<world ambient="0.3 0.3 0.3" background="0.2 0.2 0.2">
    <transformation name="environment" scale="1.0,1.0,1.0" translation="0,0,-10">
        <object name="geom2" file="arena.obj"></object>
    <object name="geom1" file="fighter.obj"></object>

Last updated: 3 Jun. 2013