Track Part Container

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
m
m (updates for v3.7)
Line 8: Line 8:
 
  adjust-height-to-ground-offset 0.0
 
  adjust-height-to-ground-offset 0.0
 
  adjust-cross-section-to-ground 1
 
  adjust-cross-section-to-ground 1
use-superelevation 0
 
 
  track-lod-tree
 
  track-lod-tree
 
  {
 
  {
Line 14: Line 13:
 
  coordinate-transformation "spline"
 
  coordinate-transformation "spline"
 
  follows-spline-gradient 0
 
  follows-spline-gradient 0
 +
follows-ground-height-at-ends-of-mesh 0
 +
dont-scale-mesh-to-fit-length 0
  
 
====mesh-length====
 
====mesh-length====
Line 36: Line 37:
 
If clear (0) the mesh will assume the ground height from the center point.
 
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.
 
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====
 
====track-lod-tree====
Line 46: Line 44:
 
The coordinate-transformation setting determines how vertices from the model are mapped into the world. The following techniques are available:
 
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.
+
* "spline" (default) - this option gives 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.
+
* "linear" - this option gives 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.
+
* "shear" - this option gives simple linear scaling. This will 'shear' (linear stretch) the ends of the mesh to fit the neighbors.
 +
* "horizontal" - this option gives an effect similar to 'linear' except that height is fixed throughout a given component mesh. This is useful if lack of vertical distortion is more important that meeting end-to-end with the next mesh.
 +
* "horizontal shear" - this option gives an effect similar to 'shear' except that height is fixed throughout a given component mesh. This is useful if lack of vertical distortion is more important that meeting end-to-end with the next mesh.
  
 
====follows-spline-gradient====
 
====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 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").
 
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").
Line 57: Line 56:
  
 
====follows-ground-height-at-ends-of-mesh====
 
====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 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.
 
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.
 
Certain other options, such as ("follows-spline-gradient 0") or ("coordinate-transformation spline") may cause this option to be largely meaningless.
 +
 +
====dont-scale-mesh-to-fit-length====
 +
If this boolean value is clear (0), the length of each component mesh is scaled to fit the available area in the spline. Since the number of repeats and subdivisions is integer, spline meshes are typically stretched or contracted slightly to ensure that the mesh repeats end-to-end.
 +
If set (1), the mesh is rendered at its natural length, even if this means that meshes will overlap or stretch apart and not touch each other. This might typically used where a spline represents a set of repeating poles or pylons, rather than a continuous beam.
  
  

Revision as of 16:29, 24 September 2012

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
track-lod-tree
{
}
coordinate-transformation "spline"
follows-spline-gradient 0
follows-ground-height-at-ends-of-mesh 0
dont-scale-mesh-to-fit-length 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.

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 the default, fit-to-spline behavior.
  • "linear" - this option gives simple linear scaling. This will not attempt to shear the ends of the mesh to fit the neighbors.
  • "shear" - this option gives simple linear scaling. This will 'shear' (linear stretch) the ends of the mesh to fit the neighbors.
  • "horizontal" - this option gives an effect similar to 'linear' except that height is fixed throughout a given component mesh. This is useful if lack of vertical distortion is more important that meeting end-to-end with the next mesh.
  • "horizontal shear" - this option gives an effect similar to 'shear' except that height is fixed throughout a given component mesh. This is useful if lack of vertical distortion is more important that meeting end-to-end with the next mesh.

follows-spline-gradient

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

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.

dont-scale-mesh-to-fit-length

If this boolean value is clear (0), the length of each component mesh is scaled to fit the available area in the spline. Since the number of repeats and subdivisions is integer, spline meshes are typically stretched or contracted slightly to ensure that the mesh repeats end-to-end. If set (1), the mesh is rendered at its natural length, even if this means that meshes will overlap or stretch apart and not touch each other. This might typically used where a spline represents a set of repeating poles or pylons, rather than a continuous beam.

Personal tools