SceneGraph
| Home | About XEngine | Engine API | SceneGraph | Changelog | Programming Guide |
Index| Scene Description Language | camera | directory | eventmessage | geometry | group | input | light | node | primitives | root | spinner | transformation | user | |
Root Node
| Derived from: | Group3D |
| Class name: | World3D |
| Description: | 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) Parameters: - scene_filename, the path Returns true if the scene_filename was found |
| Notes: |
| 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 |
| Notes: |
| 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. Parameters: - 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). Parameters: - 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. Parameters: scene_filename, retrieves the scene_filename, otherwise sets the parameter to null |
| Notes: |
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: |
|
|||||||||
| Events: |
|
|||||||||
| Inherited events: | - | |||||||||
| New messages: |
|
|||||||||
| Inherited messages: | enable, disable, activate, deactivate, hide, show, visible, active | |||||||||
| Redefined messages: | - | |||||||||
| Obsolete messages: | - |
Example
<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> </transformation> <object name="geom1" file="fighter.obj"></object> </world> |
Last updated: 3 Jun. 2013