OpenRacing Universal Track Interface: Difference between revisions

From SpaceElevatorWiki.com
Jump to navigationJump to search
No edit summary
No edit summary
Line 45: Line 45:
* TrackManager - discovers, loads, unload, checks tracks
* TrackManager - discovers, loads, unload, checks tracks
** scan(directory) - scans directory recursively to find track definitions (*.uti) files
** scan(directory) - scans directory recursively to find track definitions (*.uti) files
blah
** list() - list of tracks found by scan()
** list() - list of tracks found by scan()
** load(filename) - loads a track to the simulator
** load(filename) - loads a track to the simulator (visual, physical, gameplay)
** query(filename) - queries info about a given track (length, dificulty, and so on)
** query(filename) - queries info about a given track (length, dificulty, and so on)
** check(filename) - check the integrity of a track (all part of the
** check(filename) - check the integrity of a track (all part of the track is accessible, no missing files, constraint checks, version, checks and so on)
 
*TrackPhys - main interface for a loaded track's physical attributes
**double trackheight(double x, double z) - returns the height of the track at the given world coordinate
** (OBS) extern tdble TrackHeightL(tTrkLocPos *p) - obsolete function from simuv2
** (OBS) extern void TrackGlobal2Local(tTrackSeg *segment, tdble X, tdble Y, tTrkLocPos *p, int sides)  - obsolete function from simuv2
** (OBS) extern void TrackLocal2Global(tTrkLocPos *p, tdble *X, tdble *Y) - obsolete function from simuv2
** (OBS) extern void TrackSideNormal(tTrackSeg*, tdble, tdble, int, t3Dd*)  - obsolete function from simuv2
vector3 TrackSurfaceNormal(double x, double z) - returns normal of surface at the global world coordinate
surfaceInfo TrackSurfaceInfo(double x, double z) - returns surface info at the given world coordinate

Revision as of 15:23, 26 February 2009

Discussion

...

Background and goals

Most people think that the base of moderns simulators are about the vehicle they represents. But actually the hearth of the simulation is how the track made of. It defines the visual context, the physical parameters of the whole application. One problem might arise during the developement of a simulator: the physical part of track modeling is done the way that it is so deeply integrated to the application that it sticks the whole simulator to one physical engine.

The effort between OpenRacing Universal Track Interface (ORUTI) is to address the above mentioned issue. By creating a well defined universal interface between the simulator and the physical engine those parts can be separated as well. So one is able to change the Physical engine under OpenRacing or create and apply a new track without knowing anything about the structure of Openracing code. Simply knowing interface makes possible to create new tracks as long as the necesseary functions are implemented.

The UTI adresses three aspect of track creation: visual - that is how a track looks like for the player physical - describes the physical attribute of the track (invisible, that is how the physical engine calculates what would happen) gameplay - defines the tracks and goals for the player to achieve (what route the car should be driven and so on)

The UTI has also helper functions for managing the tracks.

Formats

The UTI uses XML format. From the three aspects, only the gameplay part is defined by UTI interface. The physical and visual parts and its related files are taken care of the plugin using the interface.

.UTI format

- described later -


Requirements

Which informations are needed by OR modules.

Graphics

  • 3D model and textures of the track.

AIs

  • Graph of drivable segments connected together.
    • [...]

Physics

  • [...]

API - Data structures

  • TrackManager - discovers, loads, unload, checks tracks
    • scan(directory) - scans directory recursively to find track definitions (*.uti) files
    • list() - list of tracks found by scan()
    • load(filename) - loads a track to the simulator (visual, physical, gameplay)
    • query(filename) - queries info about a given track (length, dificulty, and so on)
    • check(filename) - check the integrity of a track (all part of the track is accessible, no missing files, constraint checks, version, checks and so on)
  • TrackPhys - main interface for a loaded track's physical attributes
    • double trackheight(double x, double z) - returns the height of the track at the given world coordinate
    • (OBS) extern tdble TrackHeightL(tTrkLocPos *p) - obsolete function from simuv2
    • (OBS) extern void TrackGlobal2Local(tTrackSeg *segment, tdble X, tdble Y, tTrkLocPos *p, int sides) - obsolete function from simuv2
    • (OBS) extern void TrackLocal2Global(tTrkLocPos *p, tdble *X, tdble *Y) - obsolete function from simuv2
    • (OBS) extern void TrackSideNormal(tTrackSeg*, tdble, tdble, int, t3Dd*) - obsolete function from simuv2

vector3 TrackSurfaceNormal(double x, double z) - returns normal of surface at the global world coordinate surfaceInfo TrackSurfaceInfo(double x, double z) - returns surface info at the given world coordinate