@@ -1222,6 +1222,53 @@ in the .cvf header, that is the right side viewpoint.
12221222
12231223Note that in Open Rails you may have more than three cabviewpoints defined for 2D cabs.
12241224
1225+ Advanced cab viewport positioning
1226+ ---------------------------------
1227+
1228+ .. index ::
1229+ single: ORTSShapeHierarchy
1230+
1231+ In some unusual cases, it may be desired to have the cab view point move not with the main
1232+ locomotive body, but with a sub object of the locomotive, such as a bogie. To do this, the
1233+ parameter ``ORTSShapeHierarchy ( MATRIXNAME ) `` can be added inside the .cvf file, once
1234+ for each viewport. If this is used, the position of the viewport will no longer be measured
1235+ relative to the locomotive itself, but relative to the sub object with the given name. As
1236+ the sub object translates and rotates, the cab view will do the same in sync. Each viewport
1237+ can be attached to a different sub object, though in many cases attaching all three to the
1238+ same sub object will make the most sense::
1239+
1240+ Comment ( A hypothetical cab view where the cab is attached to the BOGIE1 sub object of the locomotive shape. )
1241+ Tr_CabViewFile (
1242+ CabViewType ( 3 )
1243+ CabViewFile ( Front.ace )
1244+ CabViewWindow ( 0 0 640 400 )
1245+ CabViewWindowFile ( "" )
1246+ Position ( 1.265 3.44 6.24 )
1247+ Direction ( 7 -20 1 )
1248+ ORTSShapeHierarchy ( BOGIE1 )
1249+ CabViewFile ( Rear.ace )
1250+ CabViewWindow ( 0 0 640 480 )
1251+ CabViewWindowFile ( "" )
1252+ Position ( 1.26 3.44 6.24 )
1253+ Direction ( 6 179 0 )
1254+ ORTSShapeHierarchy ( BOGIE1 )
1255+ CabViewFile ( Right.ace )
1256+ CabViewWindow ( 0 0 640 480 )
1257+ CabViewWindowFile ( "" )
1258+ Position ( 1.26 3.44 6.24 )
1259+ Direction ( 12 36 0 )
1260+ ORTSShapeHierarchy ( BOGIE1 )
1261+
1262+ Matrix names can be determined using shape viewing utilities. If the named matrix can't
1263+ be found in the locomotive shape, a warning will be added to the log and the cab viewport
1264+ will attach to the main shape object. ``ORTSShapeHierarchy `` is entirely optional, and if
1265+ missing the cab viewport will be attached to the main shape object, same as in MSTS.
1266+
1267+ Note that passenger views and 3D cabs also support ``ORTSShapeHierarchy `` but the
1268+ :ref: `implementation is different<features-viewpoint-positioning> `, as it is not done
1269+ inside the .cvf file.
1270+
1271+
122512723D cabs
12261273=======
12271274
@@ -1271,40 +1318,48 @@ Development Rules
12711318- Within the Wagon section of the .eng file a block like the following one
12721319 has to be generated::
12731320
1274- ORTS3DCab(
1321+ ORTS3DCab (
12751322 ORTS3DCabFile ( Cab.s )
12761323 ORTS3DCabHeadPos ( -0.9 2.4 5.2 )
12771324 RotationLimit ( 40 60 0 )
12781325 StartDirection ( 12 0 0 )
1326+ ORTSShapeOffset ( 0 0 0 )
1327+ ORTSShapeHierarchy ( MAIN )
12791328 )
12801329
12811330- If also a rear cab is present, a second ``ORTS3DCab `` has to be added,
12821331 as follows::
12831332
1284- ORTS3DCab(
1333+ ORTS3DCab (
12851334 ORTS3DCabFile ( Cab.s )
12861335 ORTS3DCabHeadPos ( 0.9 2.4 5.2 )
12871336 RotationLimit ( 40 60 0 )
12881337 StartDirection ( 12 180 0 )
1338+ ORTSShapeOffset ( 0 0 0 )
1339+ ORTSShapeHierarchy ( MAIN )
12891340 )
12901341
1342+ - Similarly to :ref: `passenger views<features-viewpoint-positioning> `,
1343+ ``ORTSShapeOffset `` and ``ORTSShapeHierarchy `` are optional and
1344+ give more control over the location of the cab shape and camera
1345+ location, but aren't needed for standard rolling stock.
1346+
12911347- Alternate 3D cab viewpoints may be added, as in the example here below::
12921348
1293- ORTSAlternate3DCabViewPoints
1294- (
1295- ORTSAlternate3DCabViewPoint(
1296- ORTS3DCabFile ( Cab.s )
1297- ORTS3DCabHeadPos ( 0.9 2.4 5.2 )
1298- RotationLimit ( 40 60 0 )
1299- StartDirection ( 12 0 0 )
1300- )
1301- ORTSAlternate3DCabViewPoint(
1302- ORTS3DCabFile ( Cab.s )
1303- ORTS3DCabHeadPos ( -0.8 2.4 5.2 )
1304- RotationLimit ( 40 60 0 )
1305- StartDirection ( 12 30 0 )
1306- )
1307- )
1349+ ORTSAlternate3DCabViewPoints (
1350+ ORTSAlternate3DCabViewPoint (
1351+ ORTS3DCabFile ( Cab.s )
1352+ ORTS3DCabHeadPos ( 0.9 2.4 5.2 )
1353+ RotationLimit ( 40 60 0 )
1354+ StartDirection ( 12 0 0 )
1355+ )
1356+ ORTSAlternate3DCabViewPoint (
1357+ ORTS3DCabFile ( Cab.s )
1358+ ORTS3DCabHeadPos ( -0.8 2.4 5.2 )
1359+ RotationLimit ( 40 60 0 )
1360+ StartDirection ( 12 30 0 )
1361+ )
1362+ )
13081363
13091364
13101365- To switch between alternate cab viewpoints ``Ctrl-Shift-1 `` must be pressed.
0 commit comments