"attached-splines" container

From TrainzOnline
(Redirected from Attached-splines)
Jump to: navigation, search

The "attached-splines" container is a top-level config.txt file entry used by the KIND Track content type.

The container provides a mechanism for having child splines attached which run parallel to the shape of a parent spline at a slight offset. Attached splines are used where a spline with one set of rendering or functional behaviour needs to be coupled with a spline with a different set of rendering or functional behaviours. For example, a bridge (scenery) with attached track (functional), or a set of pylons (no stretching or shearing) with some wires strung between them (shearing and stretching to fit.) The attached splines may be render-only splines which effectively don't exist beyond of their rendering behaviour, or they may be fully functional splines whose only specialty is that they move and delete with their parent.

This page describes trainz-build 4.5.


Contents

Supported Tags

The "attached-splines" container is a list of subcontainers with no standalone tags. Each attached-splines subcontainer supports the following tags. Each tag is shown here with its default value.

attached-splines
{
  0
  {
    lateral-offset 0.0
    use-same-direction 1
    spline-kuid <NULL>
    visual-only 0
    follows-spline-gradient 1
    start-gap 0
    end-gap 0
  }
  etc...
}

lateral-offset

This decimal tag defines the number of meters that the child spline is offset sideways from its parent's position. The parent is at position 0.0, with positive offsets to the right, and negative offsets to the left.


use-same-direction

If set (1), this boolean tag causes the child spline to face in the same direction as the parent If clear (0), the child faces backward (180° rotation) to the parent.


spline-kuid

This KUID tag defines the asset type to use for the child spline. A parent spline may have multiple children, which may be of the same or differing types.


visual-only

If set (1), this boolean tag causes the child spline to exist only while being actively rendered. This also removes all functional aspects of the child spline (such as carz, the use of the spline as railway track, connection of other splines, etc.) If clear (0), the child spline is fully instantiated along with the parent. Manual editing of the child spline is prevented in Surveyor but in all other aspects the child spline reacts as if placed manually.


follows-spline-gradient

If set (1), this boolean tag causes the child spline to follow the gradient of this spline rather than leaving the child to determine whether it should follow the spline gradient or the ground height. This is useful when the child is an asset which would normally follow the ground height (such as a regular track) but where the attachment location on the parent does not follow the ground height (such as on a bridge.)


start-gap

Defines the distance in meters between the start of the spline and the start of the child's geometry, as measured along the path of the spline. Defaults to 0m, which means that the geometry starts with the spline. Positive numbers inset the geometry within the spline. Negative numbers are not permitted. If the 'start-gap' and 'end-gap' offsets cause the geometry length to drop to zero, no spline geometry is rendered, however any endcaps will still be rendered. This tag is valid only for 'visual-only' children and should not be present otherwise. Endcaps (if present) will also be inset by the specified distance.

This tag was introduced at trainz-build 4.5.


end-gap

Defines the distance in meters between the end of the child's geometry and the end of the spline, as measured along the path of the spline. Defaults to 0m, which means that the geometry ends with the spline. Positive numbers inset the geometry within the spline. Negative numbers are not permitted. If the 'start-gap' and 'end-gap' offsets cause the geometry length to drop to zero, no spline geometry is rendered, however any endcaps will still be rendered. This tag is valid only for 'visual-only' children and should not be present otherwise. Endcaps (if present) will also be inset by the specified distance.

This tag was introduced at trainz-build 4.5.

Performance Notes

  • It is strongly recommended to avoid nesting of multiple layers of splines (eg. a single parent asset should have one or more child assets, and no grandchildren.)
  • Visual-only splines should be used where possible, as this gives a substantial performance benefit.
  • Any use of attached splines comes with a performance penalty. Where possible, a single spline which includes all the necessary features is preferred.
  • There is no connection between the LOD level of a parent spline, and the LOD level of a child spline. Do not assume that they will change LOD levels at the same time.
Personal tools