-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpenbveCSV.code-snippet
270 lines (270 loc) · 24.1 KB
/
OpenbveCSV.code-snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
"CreateMeshBuilder": {
"prefix": "cmb",
"body": "CreateMeshBuilder",
"description": "insert CreateMeshBuilder command
This command marks the beginning of a new section of faces. It must precede any of the following commands. There might be as many CreateMeshBuilder sections as desired in the object file. All subsequent commands will then relate to the last CreateMeshBuilder section opened."
}
"AddVertex": {
"prefix": "av",
"body": "AddVertex, ${1:vX}, ${2:vY}, ${3:vZ}, ${4:nX}, ${5:nY}, ${6:nZ} $0",
"description": "insert AddVertex command
This command creates a new vertex which can then be used to create faces via the AddFace or AddFace2 commands. There can be as many AddVertex commands as desired within a CreateMeshBuilder section. However, the order of the vertices given is important for other commands. The first vertex given has index 0, and subsequent vertices have indices 1, 2, 3 and so on.
The normal is the direction perpendicular to the face at a particular point. If all vertices in a face have the same normal, the face will look flat. If used appropriately, you can give the illusion of a curved face by specifying different normals per vertex, but using the same normal on all vertices that share the same spatial coordinate - across multiple faces. If left all zero, the normal will be calculated automatically.
Default value is 0
vX: The x-coordinate for the vertex in meters. Negative values are left, positive ones right.
vY: The y-coordinate for the vertex in meters. Negative values are down, positive ones up.
vZ: The z-coordinate for the vertex in meters. Negative values are backward, positive ones forward.
nX: The x-coordinate for the normal of this vertex.
nY: The y-coordinate for the normal of this vertex.
nZ: The z-coordinate for the normal of this vertex."
},
"AddVertex4x": {
"prefix": "avv",
"body": [
"AddVertex, ${1:vX}, ${2:vY}, ${3:vZ}, ${4:nX}, ${5:nY}, ${6:nZ}",
"AddVertex, ${7:vX}, ${8:vY}, ${9:vZ}, ${10:nX}, ${11:nY}, ${12:nZ}",
"AddVertex, ${13:vX}, ${14:vY}, ${15:vZ}, ${16:nX}, ${17:nY}, ${18:nZ}",
"AddVertex, ${19:vX}, ${20:vY}, ${21:vZ}, ${22:nX}, ${23:nY}, ${24:nZ}$0"
],
"description": "insert AddVertex command 4 times, explanation is same as AddVertex command."
},
"AddFace": {
"prefix": "af",
"body": "AddFace, ${1:v1}, ${2:v2}, ${3:v3}, ${4:v4}$0",
"description": "insert AddFace command
This command creates a face given an arbitrary long list of vertex indices. The index corresponds to the order in which the vertices have been created by the AddVertex command, thus the AddFace command needs to be stated after the corresponding AddVertex commands. The first AddVertex command used creates index 0, and subsequent AddVertex commands create indices 1, 2, 3 and so on. The order in which the vertex indices appear is important. They need to be given in clockwise order when looking at the front of the face. The back of the face will not be visible. However, the AddFace2 command can be used to create a face which is visible from both sides. Only convex polygons are supported.
vi: The vertex index to include in this face. Allowed values are 0 through n-1, where n is the number of AddVertex commands used."
},
"AddFace 4x": {
"prefix": "aff",
"body": [
"AddFace, ${1:v1}, ${2:v2}, ${3:v3}, ${4:v4}",
"AddFace, ${5:v1}, ${6:v2}, ${7:v3}, ${4:v4}",
"AddFace, ${8:v1}, ${9:v2}, ${10:v3}, ${4:v4}",
"AddFace, ${11:v1}, ${12:v2}, ${13:v3}, ${14:v4}$0"
],
"description": "insert AddFace command 4 times, explanation is same as AddFace command"
},
"AddFace2": {
"prefix": "af2",
"body": "AddFace2, ${1:v1}, ${2:v2}, ${3:v3}, ${4:v4}$0",
"description": "insert AddFace2 command
same as AddFace command but The back of the face will also be visible, however, lighting on the back face might be the same as on the front face.
vi: The vertex index to include in this face. Allowed values are 0 through n-1, where n is the number of AddVertex commands used."
},
"AddFace2 4x": {
"prefix": "af22",
"body": [
"AddFace2, ${1:v1}, ${2:v2}, ${3:v3}, ${4:v4}",
"AddFace2, ${5:v1}, ${6:v2}, ${7:v3}, ${4:v4}",
"AddFace2, ${8:v1}, ${9:v2}, ${10:v3}, ${4:v4}",
"AddFace2, ${11:v1}, ${12:v2}, ${13:v3}, ${14:v4}$0"
],
"description": "insert AddFace2 command 4 times, explanation is same as AddFace2 command"
},
"Cube": {
"prefix": "cb",
"body": "Cube, ${1:HalfWidth}, ${2:HalfHeight}, ${3:HalfDepth}$0",
"description": "insert cube command,
This command creates a cube having dimensions as specified by HalfWidth, HalfHeight and HalfDepth. The cube will be centered on the origin (0,0,0). Thus, on the x-axis, the cube extends from -HalfWidth to HalfWidth, on the y-axis from -HalfHeight to HalfHeight and on the z-axis from -HalfDepth to HalfDepth. The cube always has 8 vertices and 6 faces.
! The Cube command is equivalent to a series of AddVertex and AddFace commands, which you need to account for when using other commands in the same CreateMeshBuilder section.
HalfWidth: A floating-point number representing half the width of the cube in meters.
HalfHeight: A floating-point number representing half the height of the cube in meters.
HalfDepth: A floating-point number representing half the depth of the cube in meters."
},
"Cylinder": {
"prefix": "cy",
"body": "Cylinder, ${1:n}, ${2:UpperRadius}, ${3:LowerRadius}, ${4:Height}$0",
"description": "insert cylinder command
This command creates a frustum. If LowerRadius and UpperRadius are equal, the object generated will reduce to a prism, which can be used as an approximation to the cylinder. If either LowerRadius or UpperRadius are zero, the object generated will reduce to a pyramid. The frustum will be centered on the origin (0,0,0). On the x- and z-axes, the frustum extends from -LowerRadius to LowerRadius for the lower base and from -UpperRadius to UpperRadius for the upper base. On the y-axis, the frustum extends from -½*Height to ½*Height.
The number of vertices n will usually suffice to be 6 or 8 when only small radii are used, for example to create a pole. Regardless of the values of UpperRadius, LowerRadius and n, the frustum will always have 2*n vertices, and usually n+2 faces unless any of the caps are omitted. If UpperRadius or LowerRadius are negative, the absolute value is being taken, but the respective caps are not created. If Height is negative, the roles of top and bottom are reversed and the faces will be visible from the inside, while otherwise, they will be visible from the outside.
! The Cylinder command is equivalent to a series of AddVertex and AddFace commands, which you need to account for when using other commands in the same CreateMeshBuilder section.
n: An integer representing the number of vertices to be used for the base of the frustum.
UpperRadius: A floating-point number representing the radius for the upper base of the frustum in meters. Can be negative to indicate that the top cap is to be omitted.
LowerRadius: A floating-point number representing the radius for the lower base of the frustum in meters. Can be negative to indicate that the bottom cap is to be omitted.
Height: A floating-point number representing the height of the prism in meters. Can be negative, which will flip the frustum vertically and display it inside-out."
},
"Translate": {
"prefix": "tl",
"body": "Translate, ${1:X}, ${2:Y}, ${3:Z}$0",
"description": "insert Translate command
The Translate command moves all vertices that have been created so far in the CreateMeshBuilder section via the AddVertex, Cube or Cylinder commands. Subsequent vertices are not affected. You can use as many Translate commands as desired in a CreateMeshBuilder section.
Default value is 0
X: A floating-point number representing the translation on the x-coordinate in meters. Negative values translate to the left, positive ones right.
Y: A floating-point number representing the translation on the y-coordinate in meters. Negative values translate down, positive ones up.
Z: A floating-point number representing the translation on the z-coordinate in meters. Negative values translate backward, positive ones forward."
},
"TranslateAll": {
"prefix": "tll",
"body": "TranslateAll, ${1:X}, ${2:Y}, ${3:Z}$0",
"description": "insert TranslateAll command
The TranslateAll command not only affects the vertices generated in the current CreateMeshBuilder section, but also those created in previous CreateMeshBuilder sections. This is useful to insert at the end of the file in order to translate the whole object.
X: A floating-point number representing the translation on the x-coordinate in meters. Negative values translate to the left, positive ones right.
Y: A floating-point number representing the translation on the y-coordinate in meters. Negative values translate down, positive ones up.
Z: A floating-point number representing the translation on the z-coordinate in meters. Negative values translate backward, positive ones forward."
},
"Scale": {
"prefix": "sc",
"body": "Scale, ${1:X}, ${2:Y}, ${3:Z}$0",
"description": "insert Scale command
The Scale command scales all vertices that have been created so far in the CreateMeshBuilder section via the AddVertex, Cube or Cylinder commands. Subsequent vertices are not affected. You can use as many Scale commands as desired in a CreateMeshBuilder section
X: A non-zero floating-point number representing the scale factor on the x-coordinate. The default value is 1.
Y: A non-zero floating-point number representing the scale factor on the y-coordinate. The default value is 1.
Z: non-zero A floating-point number representing the scale factor on the z-coordinate. The default value is 1"
},
"ScaleAll": {
"prefix": "scc",
"body": "ScaleAll, ${1:X}, ${2:Y}, ${3:Z}$0",
"description": "insert ScaleAll command
The ScaleAll command not only affects the vertices generated in the current CreateMeshBuilder section, but also those created in previous CreateMeshBuilder sections. This is useful to insert at the end of the file in order to scale the whole object.
X: A non-zero floating-point number representing the scale factor on the x-coordinate. The default value is 1.
Y: A non-zero floating-point number representing the scale factor on the y-coordinate. The default value is 1.
Z: non-zero A floating-point number representing the scale factor on the z-coordinate. The default value is 1."
},
"Rotate": {
"prefix": "rt",
"body": "Rotate, ${1:X}, ${2:Y}, ${3:Z}$0",
"description": "insert Rotate command
The Rotate command rotates all vertices that have been created so far in the current CreateMeshBuilder section via the AddVertex, Cube or Cylinder commands. Subsequent vertices are not affected. The axis of rotation is specified via the X, Y and Z values. Rotation will occur in the plane perpendicular to that direction. A zero vector for this axis is treated as (1,0,0). All other directions are normalized.You can use as many Rotate commands as desired in a CreateMeshBuilder section.
X: The x-direction of the rotational axis. Negative values point to the left, positive ones to the right. The default value is 0.
Y: The y-direction of the rotational axis. Negative values point down, positive ones up. The default value is 0.
Z: The z-direction of the rotational axis. Negative values point backward, positive ones forward. The default value is 0."
},
"RotateAll": {
"prefix": "rtt",
"body": "RotateAll, ${1:X}, ${2:Y}, ${3:Z}$0",
"description": "insert RotateAll command
The RotateAll command not only affects the vertices generated in the current CreateMeshBuilder section, but also those created in previous CreateMeshBuilder sections. This is useful to insert at the end of the file in order to rotate the whole object.
X: The x-direction of the rotational axis. Negative values point to the left, positive ones to the right. The default value is 0.
Y: The y-direction of the rotational axis. Negative values point down, positive ones up. The default value is 0.
Z: The z-direction of the rotational axis. Negative values point backward, positive ones forward. The default value is 0."
},
"Mirror": {
"prefix": "mr",
"body": "Mirror, ${1:X}, ${2:Y}, ${3:Z}$0",
"description": "insert Mirror command
The Mirror command mirrors all vertices that have been created so far in the current CreateMeshBuilder section via the AddVertex, Cube or Cylinder commands. Subsequent vertices are not affected. The direction(s) to mirror are specified via the X, Y and Z values. You can use as many Mirror commands as desired in a CreateMeshBuilder section.
X: Whether the x-axis should be mirrored. The default value is 0 (false).
Y: Whether the y-axis should be mirrored. The default value is 0 (false).
Z: Whether the z-axis should be mirrored. The default value is 0 (false)."
},
"MirrorAll": {
"prefix": "mrr",
"body": "MirrorAll, ${1:X}, ${2:Y}, ${3:Z}$0",
"description": "insert MirrorAll command
The MirrorAll command not only affects the vertices generated in the current CreateMeshBuilder section, but also those created in previous CreateMeshBuilder sections. This is useful to insert at the end of the file in order to mirror the whole object.
X: Whether the x-axis should be mirrored. The default value is 0 (false).
Y: Whether the y-axis should be mirrored. The default value is 0 (false).
Z: Whether the z-axis should be mirrored. The default value is 0 (false)."
},
"Shear": {
"prefix": "sh",
"body": "Shear, ${1:dX}, ${2:dY}, ${3:dZ}, ${4:sX}, ${5:sY}, ${6:sZ}, ${7:r}$0",
"description": "insert Shear command.
The Shear command performs a shear mapping for all vertices that have been created so far in the current CreateMeshBuilder section.
Default value is 0
dX: The x-coordinate of the vector D
dY: The y-coordinate of the vector D
dZ: The z-coordinate of the vector D
sX: The x-coordinate of the vector S
sY: The y-coordinate of the vector S
sZ: The z-coordinate of the vector S
r: The ratio that indicates how much to displace vectors."
},
"ShearAll": {
"prefix": "shh",
"body": "ShearAll, ${1:X}, ${2:Y}, ${3:Z}$0",
"description": "insert ShearAll command
The ShearAll command not only affects the vertices generated in the current CreateMeshBuilder section, but also those created in previous CreateMeshBuilder sections. This is useful to insert at the end of the file in order to shear the whole object.
Default value is 0
dX: The x-coordinate of the vector D
dY: The y-coordinate of the vector D
dZ: The z-coordinate of the vector D
sX: The x-coordinate of the vector S
sY: The y-coordinate of the vector S
sZ: The z-coordinate of the vector S
r: The ratio that indicates how much to displace vectors."
},
"SetColor": {
"prefix": "scr",
"body": "SetColor, ${1:Red}, ${2:Green}, ${3:Blue}, ${4:Alpha}$0",
"description": "insert SetColor command
This command sets the color for all faces that were already created in the current CreateMeshBuilder section. If no texture is used, the faces will be colored using the color data as specified by Red, Greenand Blue. If a texture is used, the pixels in the texture will be multiplied by the color, where multiplying with black results in black and multiplying with white does not change the color of the texture pixels. Values in-between make the texture pixels darker. When lighting is used in the route, the actual color can change depending on the lighting conditions, but will usually become darker.
Red: The red component of the color. Measured from 0 (black) to 255 (red). The default value is 255.
Green: The green component of the color. Measured from 0 (black) to 255 (green). The default value is 255.
Blue: The blue component of the color. Measured from 0 (black) to 255 (blue). The default value is 255.
Alpha: The alpha component of the color. Measured from 0 (transparent) to 255 (opaque). The default value is 255."
},
"SetEmissiveColor": {
"prefix": "sec",
"body": "SetEmissiveColor, ${1:Red}, ${2:Green}, ${3:Blue}$0",
"description": "insert SetColor command
This command sets the emissive color for all faces that were already created in the current CreateMeshBuilder section. The difference between the SetColor command and the SetEmissiveColor command is that the SetColor command is affected by lighting, while the SetEmissiveColor command is not. Thus, the SetEmissiveColor command should be used for faces which would emit light themselves, including signals, lamps, windows and the like. The actual color contribution to the faces will be the sum of the light-affected color data and the static emissive color data.
Red: The red component of the color. Measured from 0 (black) to 255 (red). The default value is 0.
Green: The green component of the color. Measured from 0 (black) to 255 (green). The default value is 0.
Blue: The blue component of the color. Measured from 0 (black) to 255 (blue). The default value is 0."
},
"SetBlendMode": {
"prefix": "sbm",
"body": "SetBlendMode, ${1|Normal,Additive|}, ${2:GlowHalfDistance}, ${3:|DivideExponent2,DivideExponent4|}$0",
"description": "insert SetBlendMode command
This command sets the blend mode for all faces in the current CreateMeshBuilder section. The Normal mode replaces screen pixels with texture pixels. The Additive mode adds the color of texture pixels to the color of screen pixels, where adding black does not change the screen pixel, while adding white results in white. If GlowHalfDistance is 0, glow attenuation will be disabled, which is the default. If glow attenuation is to be used, GlowHalfDistance represents the distance in meters at which the glow is exactly at 50% of its intensity. When the camera approaches the face, the face will gradually fade out (become transparent). The function used to determine the exact intensity for a given distance can be influenced with the setting of GlowAttenuationMode. DivideExponent2 creates a smoother transition, but will converge to the maximum intensity very slowly, while DivideExponent4 creates a sharper transition which converges more quickly.
BlendMode: The blend mode to use. The default is Normal.
GlowHalfDistance: The distance at which the glow is at 50% of its intensity, measured in meters. The value must be an integer in the range from 1 to 4095, or 0 to disable glow attenuation. The default value is 0.
GlowAttenuationMode: The glow attenuation mode to use. The default is DivideExponent4.
▸ Available options for BlendMode:
Normal: The faces are rendered normally
Additive: The faces are rendered additively.
▸ Available options for GlowAttenuationMode:
DivideExponent2: The glow intensity is determined via the function x2 / (x2 + GlowHalfDistance2), where x is the distance from the camera to the object in meters.
DivideExponent4: The glow intensity is determined via the function x4 / (x4 + GlowHalfDistance4), where x is the distance from the camera to the object in meters."
},
"LoadTexture": {
"prefix": "lt",
"body": "LoadTexture, ${1:DaytimeTexture}, ${2:NighttimeTexture}$0",
"description": "insert LoadTexture command
This command loads a texture and uses it for all faces in the current CreateMeshBuilder section. The file name is relative to the directory the object file is stored in. You can use PNG, which supports full alpha channels, but use the alpha channel only if absolutely required as it reduces performance. Prefer using a texture without an alpha channel in conjunction with the SetDecalTransparentColor command in order to use color-key transparency
If NighttimeTexture is used, it specifies the texture to be used on nighttime lighting conditions, while DaytimeTexture then specifies the texture to be used on daytime lighting conditions. The textures might blend into each other and should be designed accordingly. If NighttimeTexture is used, DaytimeTexture must also be specified. If NighttimeTexture is not used, low lighting conditions will make the daytime version darker. Nighttime textures are meant for use with train interior/exterior objects.
DaytimeTexture: The file name of the daytime version of the texture to load, relative to the directory the object file is stored in.
NighttimeTexture: The file name of the nighttime version of the texture to load, relative to the directory the object file is stored in."
},
"SetDecalTransparentColor": {
"prefix": "sdtc",
"body": "SetDecalTransparentColor, ${1:Red}, ${2:Green}, ${3:Blue}$0",
"description": "insert SetDecalTransparentColor command
This command sets the color used for screendoor transparency for all faces that were already created. The texture loaded via the Load command will become transparent for all pixels which match exactly with the color specified via the Red, Green and Blue parameters. The use of screendoor transparency is much more efficient than using a full alpha channel, so prefer using a texture without an alpha channel and use this command instead to make parts of the texture transparent. You need to specify texture coordinates via the Coordinate command in order for the texture to correctly appear on the faces.
Red: The red component of the color. Measured from 0 (black) to 255 (red). The default value is 0.
Green: The green component of the color. Measured from 0 (black) to 255 (green). The default value is 0.
Blue: The blue component of the color. Measured from 0 (black) to 255 (blue). The default value is 0."
},
"EnableCrossfading": {
"prefix": "ecf",
"body": "EnableCrossfading, ${1|false,true|}$0",
"description": "insert EnableCrossfading command
This command controls the blending mode when both a daytime and a nighttime texture are specified.
When this is set to false the behavior is as follows:
The daytime texture is drawn.
The opacity level for the nighttime texture is calculated from the Track.Brightness value, where a value of 255 produces a fully opaque texture, and a value of 0 produces a fully transparent texture.
The nighttime texture is drawn.
When this is set to true the behaviour is as follows:
The opacity level for each texture is blended proportionately, so that for example, a Track.Brightness value of 128 would produce an (approximately) 50% blend of each texture and so-on.
value: Either true to enable cross-fading, or false (default) to disable."
}
"SetTextureCoordinates": {
"prefix": "stc",
"body": "SetTextureCoordinates, ${1:VertexIndex}, ${2:X}, ${3:Y}$0",
"description": "insert SetTextureCoordinates command
This command associates a coordinate in the texture to the vertex specified by VertexIndex. The index corresponds to the order in which the vertices have been created by the AddVertex command, thus the Coordinates command needs to be stated after the corresponding AddVertex command. The X and Y values do not necessarily need to be in the range between 0 (left or top) to 1 (right or bottom), but can have any other value. It is assumed in this case that the texture is repeated on an infinite grid where integer values for X and Y correspond to the corners of the texture
VertexIndex: The vertex index the coordinate is referring to. Allowed values are 0 through n-1, where n is the number of AddVertex commands used.
X: The x-coordinate of the texture. Integer values correspond to the left/right edge of the texture. If only values between 0 and 1 are to be considered, 0 corresponds to the left and 1 to the right.
Y: The y-coordinate of the texture. Integer values correspond to the top/bottom edge of the texture. If only values between 0 and 1 are to be considered, 0 corresponds to the top and 1 to the bottom."
}
"SetTextureCoordinates 4x": {
"prefix": "stcc",
"body": [
"SetTextureCoordinates, ${1:VertexIndex}, ${2:X}, ${3:Y}",
"SetTextureCoordinates, ${4:VertexIndex}, ${5:X}, ${6:Y}",
"SetTextureCoordinates, ${7:VertexIndex}, ${8:X}, ${9:Y}",
"SetTextureCoordinates, ${10:VertexIndex}, ${11:X}, ${12:Y}$0",
]
"description": "insert SetTextureCoordinates command 4 times, explanation is same as SetTextureCoodinates"