Transformation Type A – step 0030 – December 2009

1 Purpose of SrrTransformationA

Basically, SrrTrains vehicles are moved over the tracks by sending a deltaEss event to all axles of the vehicle.

The axle maintains a reference to the parent edge and increases/decreases the ess property, considering changes of the parent edge at the boundaries between two edges.

The provided track geometry takes the properties of the axle and their parent edge and calculates the transformation of each axle.

This transformation is an input to calculate the transformation of the vehicle, as well as it is an output to the user (model author), to display the axle at the right position and orientation.

SrrTransformationA transports a transformation in an SrrTrains specific way. Additionally it provides (currently only) one calculation method to adapt a transformation to some values useful for the model author.

2 User Interface of SrrTransformationA (uiObj)

SrrTransformationA is an external prototype that is available at the directory srr/.

<ProtoDeclare name='SrrTransformationA'>

<ProtoInterface>

<field accessType="inputOutput" name="transformation" type="MFVec3f"/>

<field accessType="inputOnly" name="transfToX3D" type="MFVec3f"/>

<field accessType="outputOnly" name="translation" type="SFVec3f"/>

<field accessType="outputOnly" name="rotation1" type="SFRotation"/>

<field accessType="outputOnly" name="rotation2" type="SFRotation"/>

</ProtoInterface>

transformation holds a transformation in following form:
transformation[0]: translation of the axle/vehicle/vehicle part
transformation[1]: unit vector “forward”
transformation[2]: unit vector “up”
transformation[3]: unit vector “right”

transfToX3D takes the value from transformation and outputs the values translation, rotation1 and rotation2.

translation, rotation1 and rotation2 can be taken as input values for two cascaded <Transform>-nodes. The outer <Transform> node will take translation and rotation1 to bring the origin of the model to the right place and to bring the “forward” unit vector into the right orientation. The inner <Transform> node will take rotation2 to rotate the model around the “forward” vector into the correct orientation.