Track Part Container

From TrainzOnline
Revision as of 16:18, 29 March 2012 by Windwalkr (Talk | contribs)

Jump to: navigation, search

A Track Part Container is a config.txt file entry used by the Stitched track content type. It does not correspond to a single specific tag, but rather is a format which is reused by several different tags.

Contents

Supported Tags

The Track Part Container supports the following tags. Each tag is shown here with its default value. In some cases, the Track Part Container may inherit the values set on a parent container (excepting the track-lod-tree) rather than using these defaults; see the individual content type descriptions for additional details.

mesh-length 0.0
adjust-height-to-ground-threshold -3.402823466e+38
adjust-height-to-ground-offset 0.0
adjust-cross-section-to-ground 1
use-superelevation 0
track-lod-tree
{
}
coordinate-transformation "spline"
follows-spline-gradient 0

mesh-length

The mesh-length value is a track distance in meters which defines the basic unit length of track that the track-lod-tree describes. The track-lod-tree may supply a single mesh of this length, or may subdivide the unit mesh-length into a number of smaller mesh pieces.

adjust-height-to-ground-threshold

Any vertex with a model-space Z value less than this threshold number will be adjusted based on the height of the ground under that vertex.

The math behind the adjustment is roughly as follows:

outputVertexPosition.z = modelVertexPosition.z + adjustHeightToGroundOffset + groundHeight

Typically, this height adjustment is used when building a bridge or similar structure - the bulk of the model is maintained at the actual spline height, but the bottom vertices of the legs or supporting pillars are dropped to ground height.

adjust-height-to-ground-offset

Provides an offset along the model-space Z axis that is used when a vertex is being adjusted to ground height. If set to the negative of the adjust-height-to-ground-threshold value, this will effectively cause any vertex at that height to be dropped to exactly ground level. Any vertex below that height will drop below ground level. Any vertex above that height will not be modified.

By varying the offset, this allows vertices to float slightly above the actual ground height.

adjust-cross-section-to-ground

If this boolean value is set (1), the track mesh is distorted across its X axis to follow the ground plane upon which it rests. If clear (0) the mesh will assume the ground height from the center point. This setting has no effect on vertices which are within the adjust-height-to-ground-threshold range.

use-superelevation

Not supported. Leave as zero (0).

track-lod-tree

The "track-lod-tree" container is used to select appropriate meshes for runtime mesh stitching.

coordinate-transformation

The coordinate-transformation setting determines how vertices from the model are mapped into the world. The following techniques are available:

  • "spline" (default) - this option gives you the default, fit-to-spline behavior.
  • "linear" - this option gives you a simple linear scaling. This will not attempt to shear the ends of the mesh to fit the neighbors.
  • "shear" - this option gives you a simple linear scaling. This will 'shear' (linear stretch) the ends of the mesh to fit the neighbors.

follows-spline-gradient

(candidate for v3.8) If this boolean value is set (1), the mesh is deformed to smoothly follow the height-gradient of the spline. If clear (0), the mesh is instead deformed to follow the ground height along the centre-line of the spline ("adjust-cross-section-to-ground 1") or under each vertex ("adjust-cross-section-to-ground 0"). Certain in-game state, such as having set a height gradient onto the spline (yellow track vertices in Surveyor) or residing on a parent bridge spline, may override this option.

follows-ground-height-at-ends-of-mesh

(candidate for v3.8) If this boolean value is set(1), the spline height is effectively deformed such that the end-points of each repeat of the mesh follow the ground height. Spline height throughout the mesh varies in a linear fashion. If clear (0), the spline height is not affected. Certain other options, such as ("follows-spline-gradient 0") or ("coordinate-transformation spline") may cause this option to be largely meaningless.

Personal tools