Example Track Section Type A – step 0022 – December 2009
SrrTrackSectionA can be used to create a 545mm gauge track section within a module.
The graphical representation of the track will be created according to the “ABI Track Geometry” and with the help of a small texture file.
Figure
1: Definition of the "ABI Track Geometry"
Figure
2: Texture file for display of a track element
SrrTrackSectionA is an external prototype that is available in the directory tg/
It will require some prototypes of the SRR framework and will search them at ../srr/.
<ProtoDeclare name='SrrTrackSectionA'>
<ProtoInterface>
<field accessType='inputOutput' name='objType' type='SFString' value='SrrTrackSectionA'/>
<field accessType='inputOutput' name='version' type='SFFloat' value='0.0023'/>
<field accessType='inputOutput' name='objId' type='SFString'/>
<field accessType='inputOutput' name='vectorA' type='SFVec3f'/>
<field accessType='inputOutput' name='vectorB' type='SFVec3f'/>
<field accessType='inputOutput' name='vectorI' type='SFVec3f'/>
<field accessType='inputOutput' name='normalA' type='SFVec3f'/>
<field accessType='inputOutput' name='normalB' type='SFVec3f'/>
<field accessType='inputOutput' name='neighbourA' type='SFString'/>
<field accessType='inputOutput' name='neighbourB' type='SFString'/>
<field accessType='inputOutput' name='modParam' type='SFNode'/>
<field accessType='inputOutput' name='exitViewpoint' type='SFNode'/>
</ProtoInterface>
objId
The user sets the objId before initialization of the track section object. The objId is unique within the module.
Track Geometry
The track geometry is defined by the parameters vectorA, vectorB, vectorI, normalA and normalB, prior to initialization
Linking of track sections and turnouts
The names of the neighbour nodes (their object ID) are defined by the parameters neighbourA and neighbourB, prior to initialization. The own track nodes will get the object IDs <objId>.A and <objId>.B, respectively.
Initialization
The user forwards the modParam event from the SrrModCoord to the track section to initialize the track section.
Exit Viewpoint
The module author can assign an exit viewpoint to each track section. The reference to this exit viewpoint will be forwarded to each vehicle passing this track section. The vehicle model can bind this viewpoint, when the avatar exits (wants to exit) the vehicle.