sunrize 2.0.16 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sunrize",
3
3
  "productName": "Sunrize X3D Editor",
4
- "version": "2.0.16",
4
+ "version": "2.1.0",
5
5
  "description": "Sunrize — A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -93,7 +93,7 @@
93
93
  "@vscode/codicons": "^0.0.45",
94
94
  "capitalize": "^2.0.4",
95
95
  "console": "^0.7.2",
96
- "electron": "^41.5.0",
96
+ "electron": "^42.1.0",
97
97
  "electron-prompt": "^1.7.0",
98
98
  "electron-squirrel-startup": "^1.0.1",
99
99
  "electron-tabs": "^1.0.4",
@@ -102,7 +102,7 @@
102
102
  "jquery-ui-dist": "^1.13.3",
103
103
  "jstree": "^3.3.17",
104
104
  "material-icons": "^1.13.14",
105
- "material-symbols": "^0.44.4",
105
+ "material-symbols": "^0.44.8",
106
106
  "md5": "^2.3.0",
107
107
  "mime-types": "^3.0.2",
108
108
  "monaco-editor": "^0.55.1",
@@ -112,7 +112,7 @@
112
112
  "string-similarity": "^4.0.4",
113
113
  "tweakpane": "^4.0.5",
114
114
  "update-electron-app": "^3.2.0",
115
- "x_ite": "^15.0.0",
115
+ "x_ite": "^15.0.2",
116
116
  "x3d-traverse": "^1.0.22"
117
117
  }
118
118
  }
@@ -688,6 +688,10 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
688
688
  label: "LayoutLayer",
689
689
  args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Layout", "LayoutLayer", "children"],
690
690
  },
691
+ {
692
+ label: "LayoutGroup",
693
+ args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Layout", "LayoutGroup", "children"],
694
+ },
691
695
  {
692
696
  label: "ScreenGroup",
693
697
  args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Layout", "ScreenGroup", "children"],
@@ -164,97 +164,97 @@ module .exports = class ScriptEditor extends Interface
164
164
 
165
165
  const conf = {
166
166
  comments: {
167
- lineComment: '//',
168
- blockComment: ['/*', '*/']
167
+ lineComment: "//",
168
+ blockComment: ["/*", "*/"],
169
169
  },
170
170
  brackets: [
171
- ['{', '}'],
172
- ['[', ']'],
173
- ['(', ')']
171
+ ["{", "}"],
172
+ ["[", "]"],
173
+ ["(", ")"],
174
174
  ],
175
175
  autoClosingPairs: [
176
- { open: '[', close: ']' },
177
- { open: '{', close: '}' },
178
- { open: '(', close: ')' },
179
- { open: "'", close: "'", notIn: ['string', 'comment'] },
180
- { open: '"', close: '"', notIn: ['string'] }
176
+ { open: "[", close: "]" },
177
+ { open: "{", close: "}" },
178
+ { open: "(", close: ")" },
179
+ { open: "'", close: "'", notIn: ["string", "comment"] },
180
+ { open: '"', close: '"', notIn: ["string"] },
181
181
  ],
182
182
  surroundingPairs: [
183
- { open: '{', close: '}' },
184
- { open: '[', close: ']' },
185
- { open: '(', close: ')' },
183
+ { open: "{", close: "}" },
184
+ { open: "[", close: "]" },
185
+ { open: "(", close: ")" },
186
186
  { open: '"', close: '"' },
187
- { open: "'", close: "'" }
187
+ { open: "'", close: "'" },
188
188
  ]
189
189
  };
190
190
 
191
191
  const keywords = [
192
- 'break', 'case', 'const', 'continue', 'discard', 'do', 'else', 'flat', 'for', 'highp', 'if', 'in', 'inout', 'invariant', 'lowp', 'mediump', 'out', 'precision', 'return', 'smooth', 'struct', 'switch', 'uniform', 'while',
192
+ "break", "case", "const", "continue", "discard", "do", "else", "flat", "for", "highp", "if", "in", "inout", "invariant", "lowp", "mediump", "out", "precision", "return", "smooth", "struct", "switch", "uniform", "while",
193
193
  ];
194
194
 
195
195
  const types = [
196
- 'bool', 'bvec2', 'bvec3', 'bvec4', 'float', 'int', 'ivec2', 'ivec3', 'ivec4', 'mat2', 'mat2x2', 'mat2x3', 'mat2x4', 'mat3', 'mat3x2', 'mat3x3', 'mat3x4', 'mat4', 'mat4x2', 'mat4x3', 'mat4x4', 'sampler2D', 'sampler3D', 'samplerCube', 'uint', 'uvec2', 'uvec3', 'uvec4', 'vec2', 'vec3', 'vec4', 'void',
196
+ "bool", "bvec2", "bvec3", "bvec4", "float", "int", "ivec2", "ivec3", "ivec4", "mat2", "mat2x2", "mat2x3", "mat2x4", "mat3", "mat3x2", "mat3x3", "mat3x4", "mat4", "mat4x2", "mat4x3", "mat4x4", "sampler2D", "sampler3D", "samplerCube", "uint", "uvec2", "uvec3", "uvec4", "vec2", "vec3", "vec4", "void",
197
197
  ];
198
198
 
199
199
  const functions = [
200
- 'abs', 'acos', 'acosh', 'all', 'any', 'asin', 'asinh', 'atan', 'atanh', 'ceil', 'clamp', 'cos', 'cosh', 'cross ', 'degrees', 'determinant', 'dFdx', 'dFdy', 'distance', 'dot', 'equal', 'exp', 'exp2', 'faceforward', 'floatBitsToInt', 'floatBitsToUint', 'floor', 'fract', 'fwidth', 'greaterThan', 'greaterThanEqual', 'intBitsToFloat', 'inverse', 'inversesqrt', 'isinf', 'isnan', 'length', 'lessThan ', 'lessThanEqual', 'log', 'log2', 'main', 'matrixCompMult', 'max', 'min', 'mix', 'mod', 'modf', 'normalize', 'not', 'notEqual', 'outerProduct', 'packUnorm2x16', 'pow', 'radians', 'reflect', 'refract', 'round', 'roundEven', 'sign', 'sin', 'sinh', 'smoothstep', 'sqrt', 'step', 'tan', 'tanh', 'texelFetch', 'texelFetchOffset', 'texture', 'textureGrad', 'textureGradOffset', 'textureLod', 'textureLodOffset', 'textureProj', 'textureProjGrad', 'textureProjLod', 'textureProjLodOffset', 'textureSize', 'transpose', 'trunc', 'uintBitsToFloat',
200
+ "abs", "acos", "acosh", "all", "any", "asin", "asinh", "atan", "atanh", "ceil", "clamp", "cos", "cosh", "cross ", "degrees", "determinant", "dFdx", "dFdy", "distance", "dot", "equal", "exp", "exp2", "faceforward", "floatBitsToInt", "floatBitsToUint", "floor", "fract", "fwidth", "greaterThan", "greaterThanEqual", "intBitsToFloat", "inverse", "inversesqrt", "isinf", "isnan", "length", "lessThan ", "lessThanEqual", "log", "log2", "main", "matrixCompMult", "max", "min", "mix", "mod", "modf", "normalize", "not", "notEqual", "outerProduct", "packUnorm2x16", "pow", "radians", "reflect", "refract", "round", "roundEven", "sign", "sin", "sinh", "smoothstep", "sqrt", "step", "tan", "tanh", "texelFetch", "texelFetchOffset", "texture", "textureGrad", "textureGradOffset", "textureLod", "textureLodOffset", "textureProj", "textureProjGrad", "textureProjLod", "textureProjLodOffset", "textureSize", "transpose", "trunc", "uintBitsToFloat",
201
201
  ];
202
202
 
203
203
  const constants = [
204
- 'false', 'true',
204
+ "false", "true",
205
205
  ];
206
206
 
207
207
  const builtins = [
208
- 'gl_ClipDistance', 'gl_CullDistance', 'gl_FragCoord', 'gl_FragDepth', 'gl_FrontFacing', 'gl_GlobalInvocationID', 'gl_HelperInvocation', 'gl_InstanceID', 'gl_InvocationID', 'gl_Layer', 'gl_LocalInvocationID', 'gl_LocalInvocationIndex', 'gl_NumSamples', 'gl_NumWorkGroups', 'gl_PatchVerticesIn', 'gl_PointCoord', 'gl_PointSize', 'gl_Position', 'gl_PrimitiveID', 'gl_PrimitiveIDIn', 'gl_SampleID', 'gl_SampleMask', 'gl_SampleMaskIn', 'gl_SamplePosition', 'gl_TessCoord', 'gl_TessLevelInner', 'gl_TessLevelOuter', 'gl_VertexID', 'gl_ViewportIndex', 'gl_WorkGroupID', 'gl_WorkGroupSize',
208
+ "gl_ClipDistance", "gl_CullDistance", "gl_FragCoord", "gl_FragDepth", "gl_FrontFacing", "gl_GlobalInvocationID", "gl_HelperInvocation", "gl_InstanceID", "gl_InvocationID", "gl_Layer", "gl_LocalInvocationID", "gl_LocalInvocationIndex", "gl_NumSamples", "gl_NumWorkGroups", "gl_PatchVerticesIn", "gl_PointCoord", "gl_PointSize", "gl_Position", "gl_PrimitiveID", "gl_PrimitiveIDIn", "gl_SampleID", "gl_SampleMask", "gl_SampleMaskIn", "gl_SamplePosition", "gl_TessCoord", "gl_TessLevelInner", "gl_TessLevelOuter", "gl_VertexID", "gl_ViewportIndex", "gl_WorkGroupID", "gl_WorkGroupSize",
209
209
  ];
210
210
 
211
211
  const language = {
212
- tokenPostfix: '.glsl',
212
+ tokenPostfix: ".glsl",
213
213
  // Set defaultToken to invalid to see what you do not tokenize yet
214
- defaultToken: 'invalid',
214
+ defaultToken: "invalid",
215
215
  keywords,
216
216
  types,
217
217
  functions,
218
218
  constants,
219
219
  builtins,
220
220
  operators: [
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
- '>>>='
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
258
  ],
259
259
  symbols: /[=><!~?:&|+\-*\/\^%]+/,
260
260
  escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
@@ -265,73 +265,73 @@ module .exports = class ScriptEditor extends Interface
265
265
  tokenizer: {
266
266
  root: [
267
267
  // data:mime-type,
268
- [/data:x-shader\/x-(?:vertex|fragment),/, 'string'],
268
+ [/data:x-shader\/x-(?:vertex|fragment),/, "string"],
269
269
 
270
270
  // x3d_SpecialVariable
271
- [/x3d_\w+/, 'keyword'],
271
+ [/x3d_\w+/, "keyword"],
272
272
 
273
273
  // identifiers and keywords
274
274
 
275
275
  [/[a-zA-Z_]\w*/,
276
276
  {
277
277
  cases: {
278
- '@keywords': { token: 'keyword.$0' },
279
- '@types': { token: 'type.identifier' },
280
- '@functions': { token: 'attribute.name' },
281
- '@constants': { token: 'constant' },
282
- '@builtins': { token: 'regexp' },
283
- '@default': 'identifier',
278
+ "@keywords": { token: "keyword.$0" },
279
+ "@types": { token: "type.identifier" },
280
+ "@functions": { token: "attribute.name" },
281
+ "@constants": { token: "constant" },
282
+ "@builtins": { token: "regexp" },
283
+ "@default": "identifier",
284
284
  }
285
285
  }],
286
286
 
287
287
  // Version
288
- [/#version\s+\d+\s+es/, 'keyword.directive'],
288
+ [/#version\s+\d+\s+es/, "keyword.directive"],
289
289
 
290
290
  // Preprocessor directive (#define)
291
- [/^\s*#\s*\w+/, 'keyword.directive'],
291
+ [/^\s*#\s*\w+/, "keyword.directive"],
292
292
 
293
293
  // whitespace
294
- { include: '@whitespace' },
294
+ { include: "@whitespace" },
295
295
 
296
296
  // delimiters and operators
297
- [/[{}()\[\]]/, '@brackets'],
297
+ [/[{}()\[\]]/, "@brackets"],
298
298
  [/@symbols/,
299
299
  {
300
300
  cases: {
301
- '@operators': 'operator',
302
- '@default': ''
301
+ "@operators": "operator",
302
+ "@default": "",
303
303
  }
304
304
  }],
305
305
 
306
306
  // numbers
307
- [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'],
308
- [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, 'number.float'],
309
- [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, 'number.hex'],
310
- [/0[0-7']*[0-7](@integersuffix)/, 'number.octal'],
311
- [/0[bB][0-1']*[0-1](@integersuffix)/, 'number.binary'],
312
- [/\d[\d']*\d(@integersuffix)/, 'number'],
313
- [/\d(@integersuffix)/, 'number'],
307
+ [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, "number.float"],
308
+ [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, "number.float"],
309
+ [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, "number.hex"],
310
+ [/0[0-7']*[0-7](@integersuffix)/, "number.octal"],
311
+ [/0[bB][0-1']*[0-1](@integersuffix)/, "number.binary"],
312
+ [/\d[\d']*\d(@integersuffix)/, "number"],
313
+ [/\d(@integersuffix)/, "number"],
314
314
 
315
315
  // delimiter: after number because of .\d floats
316
- [/[;,.]/, 'delimiter']
316
+ [/[;,.]/, "delimiter"],
317
317
  ],
318
318
 
319
319
  comment: [
320
- [/[^\/*]+/, 'comment'],
321
- [/\/\*/, 'comment', '@push'],
322
- ['\\*/', 'comment', '@pop'],
323
- [/[\/*]/, 'comment']
320
+ [/[^\/*]+/, "comment"],
321
+ [/\/\*/, "comment", "@push"],
322
+ ["\\*/", "comment", "@pop"],
323
+ [/[\/*]/, "comment"],
324
324
  ],
325
325
 
326
326
  whitespace: [
327
- [/[ \t\r\n]+/, 'white'],
328
- [/\/\*/, 'comment', '@comment'],
329
- [/\/\/.*$/, 'comment']
330
- ]
327
+ [/[ \t\r\n]+/, "white"],
328
+ [/\/\*/, "comment", "@comment"],
329
+ [/\/\/.*$/, "comment"],
330
+ ],
331
331
  }
332
332
  };
333
333
 
334
- monaco .languages .register ({ id: "glsl" });
334
+ monaco .languages .register ({ id: "glsl", mimetypes: ["x-shader/x-vertex", "x-shader/x-fragment"] });
335
335
  monaco .languages .setMonarchTokensProvider ("glsl", language);
336
336
  monaco .languages .setLanguageConfiguration ("glsl", conf);
337
337
  }
@@ -870,6 +870,8 @@ function set_field (value, time)
870
870
  print (time, value);
871
871
  }
872
872
  "
873
+
874
+ directOutput TRUE
873
875
  }
874
876
  `);
875
877
 
@@ -1,16 +1,20 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
3
- <X3D profile='Interchange' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
2
+ <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.1//EN" "https://www.web3d.org/specifications/x3d-4.1.dtd">
3
+ <X3D profile='Interchange' version='4.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.1.xsd'>
4
4
  <head>
5
+ <component name='Core' level='2'/>
5
6
  <component name='Layout' level='2'/>
7
+ <component name='Navigation' level='2'/>
8
+ <component name='Networking' level='2'/>
6
9
  <component name='Scripting' level='1'/>
10
+ <component name='Shaders' level='1'/>
7
11
  <component name='X_ITE' level='1'/>
8
12
  <unit category='angle' name='degree' conversionFactor='0.017453292519943295'/>
9
13
  <meta name='comment' content='Rise and Shine'/>
10
14
  <meta name='created' content='Fri, 29 Aug 2014 13:13:27 GMT'/>
11
15
  <meta name='creator' content='Holger Seelig'/>
12
- <meta name='generator' content='Sunrize X3D Editor V1.7.63, https://create3000.github.io/sunrize/'/>
13
- <meta name='modified' content='Sat, 12 Apr 2025 11:32:53 GMT'/>
16
+ <meta name='generator' content='Sunrize X3D Editor V2.1.0, https://create3000.github.io/sunrize/'/>
17
+ <meta name='modified' content='Mon, 11 May 2026 14:22:17 GMT'/>
14
18
  </head>
15
19
  <Scene>
16
20
  <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
@@ -22,8 +26,8 @@
22
26
  <field accessType='inputOutput' type='SFVec3f' name='center'/>
23
27
  <field accessType='inputOutput' type='SFBool' name='centerDisplay'/>
24
28
  <field accessType='inputOutput' type='SFVec3f' name='axisOfRotation'/>
25
- <field accessType='inputOutput' type='SFBool' name='rectangleDisplay'/>
26
- <field accessType='inputOutput' type='SFVec3f' name='rectangleSize' value='1 1 1'/>
29
+ <field accessType='inputOutput' type='SFBool' name='layoutDisplay'/>
30
+ <field accessType='inputOutput' type='SFVec4f' name='layoutRectangle' value='0 0 0 0'/>
27
31
  <field accessType='inputOutput' type='SFBool' name='bboxEvents' value='true'/>
28
32
  <field accessType='inputOutput' type='SFBool' name='bboxDisplay'/>
29
33
  <field accessType='inputOutput' type='SFInt32' name='bboxStyle' value='1'/>
@@ -245,16 +249,15 @@
245
249
  </Group>
246
250
  <Transform DEF='Rectangle'>
247
251
  <IS>
248
- <connect nodeField='visible' protoField='rectangleDisplay'/>
252
+ <connect nodeField='visible' protoField='layoutDisplay'/>
249
253
  </IS>
250
254
  <Shape DEF='Box_1'
251
255
  castShadow='false'>
252
256
  <Appearance>
253
257
  <LineProperties
254
258
  linewidthScaleFactor='2'/>
255
- <Material DEF='BBoxMaterial_1'
259
+ <UnlitMaterial
256
260
  emissiveColor='0 1 0'/>
257
- <ProtoInstance name='ToolShader' USE='_11' containerField='shaders'/>
258
261
  <DepthMode USE='_12'/>
259
262
  </Appearance>
260
263
  <IndexedLineSet
@@ -267,8 +270,8 @@
267
270
  </Collision>
268
271
  <Script DEF='BBoxScript'
269
272
  directOutput='true'>
270
- <field accessType='inputOutput' type='SFBool' name='rectangleDisplay'/>
271
- <field accessType='inputOutput' type='SFVec3f' name='rectangleSize'/>
273
+ <field accessType='inputOutput' type='SFBool' name='layoutDisplay'/>
274
+ <field accessType='inputOutput' type='SFVec4f' name='layoutRectangle'/>
272
275
  <field accessType='inputOutput' type='SFVec3f' name='bboxSize'/>
273
276
  <field accessType='initializeOnly' type='SFNode' name='rectangle'>
274
277
  <Coordinate USE='Rectangle_1'/>
@@ -280,8 +283,8 @@
280
283
  <Coordinate USE='AxesCoord'/>
281
284
  </field>
282
285
  <IS>
283
- <connect nodeField='rectangleDisplay' protoField='rectangleDisplay'/>
284
- <connect nodeField='rectangleSize' protoField='rectangleSize'/>
286
+ <connect nodeField='layoutDisplay' protoField='layoutDisplay'/>
287
+ <connect nodeField='layoutRectangle' protoField='layoutRectangle'/>
285
288
  <connect nodeField='bboxSize' protoField='bboxSize'/>
286
289
  </IS>
287
290
  <![CDATA[ecmascript:
@@ -293,39 +296,39 @@ function initialize ()
293
296
 
294
297
  function eventsProcessed ()
295
298
  {
296
- const bboxSize1_2 = bboxSize .divide (2);
299
+ const { x, y, z } = bboxSize .divide (2);
297
300
 
298
301
  // Axes
299
302
 
300
- axes .point = new MFVec3f (new SFVec3f (-bboxSize1_2 .x, 0, 0),
301
- new SFVec3f ( bboxSize1_2 .x, 0, 0),
302
- new SFVec3f (0, -bboxSize1_2 .y, 0),
303
- new SFVec3f (0, bboxSize1_2 .y, 0),
304
- new SFVec3f (0, 0, -bboxSize1_2 .z),
305
- new SFVec3f (0, 0, bboxSize1_2 .z));
303
+ axes .point = new MFVec3f (new SFVec3f (-x, 0, 0),
304
+ new SFVec3f ( x, 0, 0),
305
+ new SFVec3f ( 0, -y, 0),
306
+ new SFVec3f ( 0, y, 0),
307
+ new SFVec3f ( 0, 0, -z),
308
+ new SFVec3f ( 0, 0, z));
306
309
 
307
310
 
308
311
  // BBox
309
312
 
310
- bbox .point = new MFVec3f (new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, bboxSize1_2 .z),
311
- new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, bboxSize1_2 .z),
312
- new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, bboxSize1_2 .z),
313
- new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, bboxSize1_2 .z),
314
- new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, -bboxSize1_2 .z),
315
- new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, -bboxSize1_2 .z),
316
- new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, -bboxSize1_2 .z),
317
- new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, -bboxSize1_2 .z));
313
+ bbox .point = new MFVec3f (new SFVec3f (-x, y, z),
314
+ new SFVec3f (-x, -y, z),
315
+ new SFVec3f ( x, -y, z),
316
+ new SFVec3f ( x, y, z),
317
+ new SFVec3f (-x, y, -z),
318
+ new SFVec3f (-x, -y, -z),
319
+ new SFVec3f ( x, -y, -z),
320
+ new SFVec3f ( x, y, -z));
318
321
 
319
- if (rectangleDisplay)
322
+ if (layoutDisplay)
320
323
  {
321
- const bboxSize1_2 = rectangleSize .divide (2);
324
+ const [x, y, w, h] = layoutRectangle;
322
325
 
323
326
  // BBox
324
327
 
325
- rectangle .point = new MFVec3f (new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, 0),
326
- new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, 0),
327
- new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, 0),
328
- new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, 0));
328
+ rectangle .point = new MFVec3f (new SFVec3f (x - w / 2, y + h / 2, 0),
329
+ new SFVec3f (x - w / 2, y - h / 2, 0),
330
+ new SFVec3f (x + w / 2, y - h / 2, 0),
331
+ new SFVec3f (x + w / 2, y + h / 2, 0));
329
332
  }
330
333
  }
331
334
  ]]>
@@ -365,14 +368,14 @@ function eventsProcessed ()
365
368
  {
366
369
  // Position the arrows.
367
370
 
368
- const bboxSize1_2 = bboxSize .divide (2);
371
+ const { x, y, z } = bboxSize .divide (2);
369
372
 
370
- xBack .translation = new SFVec3f (-bboxSize1_2 .x, 0, 0);
371
- xFront .translation = new SFVec3f ( bboxSize1_2 .x, 0, 0);
372
- yBack .translation = new SFVec3f (0, -bboxSize1_2 .y, 0);
373
- yFront .translation = new SFVec3f (0, bboxSize1_2 .y, 0);
374
- zBack .translation = new SFVec3f (0, 0, -bboxSize1_2 .z);
375
- zFront .translation = new SFVec3f (0, 0, bboxSize1_2 .z);
373
+ xBack .translation = new SFVec3f (-x, 0, 0);
374
+ xFront .translation = new SFVec3f ( x, 0, 0);
375
+ yBack .translation = new SFVec3f (0, -y, 0);
376
+ yFront .translation = new SFVec3f (0, y, 0);
377
+ zBack .translation = new SFVec3f (0, 0, -z);
378
+ zFront .translation = new SFVec3f (0, 0, z);
376
379
  }
377
380
  ]]>
378
381
  </Script>
@@ -425,7 +428,7 @@ function initialize ()
425
428
 
426
429
  function eventsProcessed ()
427
430
  {
428
- if (vector .x === 0 && vector .y === 0 && vector .z === 0)
431
+ if (vector .equals (SFVec3f .ZERO))
429
432
  {
430
433
  inline .visible = false;
431
434
  }
@@ -847,29 +847,29 @@ function initialize ()
847
847
 
848
848
  function eventsProcessed ()
849
849
  {
850
- const bboxSize1_2 = bboxSize .divide (2);
850
+ const { x, y, z } = bboxSize .divide (2);
851
851
 
852
852
  // Axes
853
853
 
854
854
  axes .point = new MFVec3f (new SFVec3f (),
855
- new SFVec3f ( bboxSize1_2 .x, 0, 0),
856
- new SFVec3f (-bboxSize1_2 .x, 0, 0),
857
- new SFVec3f (0, bboxSize1_2 .y, 0),
858
- new SFVec3f (0, -bboxSize1_2 .y, 0),
859
- new SFVec3f (0, 0, bboxSize1_2 .z),
860
- new SFVec3f (0, 0, -bboxSize1_2 .z));
855
+ new SFVec3f ( x, 0, 0),
856
+ new SFVec3f (-x, 0, 0),
857
+ new SFVec3f ( 0, y, 0),
858
+ new SFVec3f ( 0, -y, 0),
859
+ new SFVec3f ( 0, 0, z),
860
+ new SFVec3f ( 0, 0, -z));
861
861
 
862
862
 
863
863
  // BBox
864
864
 
865
- bbox .point = new MFVec3f (new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, bboxSize1_2 .z),
866
- new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, bboxSize1_2 .z),
867
- new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, bboxSize1_2 .z),
868
- new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, bboxSize1_2 .z),
869
- new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, -bboxSize1_2 .z),
870
- new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, -bboxSize1_2 .z),
871
- new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, -bboxSize1_2 .z),
872
- new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, -bboxSize1_2 .z));
865
+ bbox .point = new MFVec3f (new SFVec3f (-x, y, z),
866
+ new SFVec3f (-x, -y, z),
867
+ new SFVec3f ( x, -y, z),
868
+ new SFVec3f ( x, y, z),
869
+ new SFVec3f (-x, y, -z),
870
+ new SFVec3f (-x, -y, -z),
871
+ new SFVec3f ( x, -y, -z),
872
+ new SFVec3f ( x, y, -z));
873
873
  }
874
874
  ]]>
875
875
  </Script>
@@ -959,27 +959,27 @@ function set_bboxSize ()
959
959
  {
960
960
  // Position the axis handles.
961
961
 
962
- const bboxSize1_2 = bboxSize .divide (2);
962
+ const { x, y, z } = bboxSize .divide (2);
963
963
 
964
- axisHandles [0] .translation = new SFVec3f (bboxSize1_2 .x, 0, 0);
965
- axisHandles [1] .translation = new SFVec3f (0, bboxSize1_2 .y, 0);
966
- axisHandles [2] .translation = new SFVec3f (0, 0, bboxSize1_2 .z);
964
+ axisHandles [0] .translation = new SFVec3f (x, 0, 0);
965
+ axisHandles [1] .translation = new SFVec3f (0, y, 0);
966
+ axisHandles [2] .translation = new SFVec3f (0, 0, z);
967
967
 
968
- axisHandles [3] .translation = new SFVec3f (-bboxSize1_2 .x, 0, 0);
969
- axisHandles [4] .translation = new SFVec3f (0, -bboxSize1_2 .y, 0);
970
- axisHandles [5] .translation = new SFVec3f (0, 0, -bboxSize1_2 .z);
968
+ axisHandles [3] .translation = new SFVec3f (-x, 0, 0);
969
+ axisHandles [4] .translation = new SFVec3f (0, -y, 0);
970
+ axisHandles [5] .translation = new SFVec3f (0, 0, -z);
971
971
 
972
972
  // Position uniform scale handles and set axis rotation of corresponding sensor.
973
973
 
974
- scaleHandles [0] .translation = new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, bboxSize1_2 .z);
975
- scaleHandles [1] .translation = new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, bboxSize1_2 .z);
976
- scaleHandles [2] .translation = new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, bboxSize1_2 .z);
977
- scaleHandles [3] .translation = new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, bboxSize1_2 .z);
974
+ scaleHandles [0] .translation = new SFVec3f ( x, y, z);
975
+ scaleHandles [1] .translation = new SFVec3f (-x, y, z);
976
+ scaleHandles [2] .translation = new SFVec3f (-x, -y, z);
977
+ scaleHandles [3] .translation = new SFVec3f ( x, -y, z);
978
978
 
979
- scaleHandles [4] .translation = new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, -bboxSize1_2 .z);
980
- scaleHandles [5] .translation = new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, -bboxSize1_2 .z);
981
- scaleHandles [6] .translation = new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, -bboxSize1_2 .z);
982
- scaleHandles [7] .translation = new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, -bboxSize1_2 .z);
979
+ scaleHandles [4] .translation = new SFVec3f ( x, y, -z);
980
+ scaleHandles [5] .translation = new SFVec3f (-x, y, -z);
981
+ scaleHandles [6] .translation = new SFVec3f (-x, -y, -z);
982
+ scaleHandles [7] .translation = new SFVec3f ( x, -y, -z);
983
983
 
984
984
  for (let i = 0; i < 8; ++ i)
985
985
  scaleSensors [i] .axisRotation = new SFRotation (xAxis, scaleHandles [i] .translation);