sunrize 1.0.11

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.
Files changed (200) hide show
  1. package/.vscode/launch.json +17 -0
  2. package/.vscode/settings.json +21 -0
  3. package/.vscode/tasks.json +25 -0
  4. package/LICENSE.md +627 -0
  5. package/Makefile +4 -0
  6. package/README.md +15 -0
  7. package/bin/sunrise.js +13 -0
  8. package/package.json +103 -0
  9. package/src/audio/Tink.mp3 +0 -0
  10. package/src/html/application.html +62 -0
  11. package/src/html/application.js +6 -0
  12. package/src/html/document.html +36 -0
  13. package/src/html/document.js +6 -0
  14. package/src/images/OutlineEditor/AccessTypes/AccessTypes.xcf +0 -0
  15. package/src/images/OutlineEditor/AccessTypes/initializeOnly.png +0 -0
  16. package/src/images/OutlineEditor/AccessTypes/inputOnly.0.png +0 -0
  17. package/src/images/OutlineEditor/AccessTypes/inputOnly.1.png +0 -0
  18. package/src/images/OutlineEditor/AccessTypes/inputOnly.2.png +0 -0
  19. package/src/images/OutlineEditor/AccessTypes/inputOnly.active.png +0 -0
  20. package/src/images/OutlineEditor/AccessTypes/inputOnly.png +0 -0
  21. package/src/images/OutlineEditor/AccessTypes/inputOutput.0.0.png +0 -0
  22. package/src/images/OutlineEditor/AccessTypes/inputOutput.0.1.png +0 -0
  23. package/src/images/OutlineEditor/AccessTypes/inputOutput.0.2.png +0 -0
  24. package/src/images/OutlineEditor/AccessTypes/inputOutput.1.0.png +0 -0
  25. package/src/images/OutlineEditor/AccessTypes/inputOutput.1.1.png +0 -0
  26. package/src/images/OutlineEditor/AccessTypes/inputOutput.1.2.png +0 -0
  27. package/src/images/OutlineEditor/AccessTypes/inputOutput.2.0.png +0 -0
  28. package/src/images/OutlineEditor/AccessTypes/inputOutput.2.1.png +0 -0
  29. package/src/images/OutlineEditor/AccessTypes/inputOutput.2.2.png +0 -0
  30. package/src/images/OutlineEditor/AccessTypes/inputOutput.png +0 -0
  31. package/src/images/OutlineEditor/AccessTypes/outputOnly.0.png +0 -0
  32. package/src/images/OutlineEditor/AccessTypes/outputOnly.1.png +0 -0
  33. package/src/images/OutlineEditor/AccessTypes/outputOnly.2.png +0 -0
  34. package/src/images/OutlineEditor/AccessTypes/outputOnly.active.png +0 -0
  35. package/src/images/OutlineEditor/AccessTypes/outputOnly.png +0 -0
  36. package/src/images/OutlineEditor/Fields/MFBool.svg +177 -0
  37. package/src/images/OutlineEditor/Fields/MFColor.svg +150 -0
  38. package/src/images/OutlineEditor/Fields/MFColorRGBA.svg +220 -0
  39. package/src/images/OutlineEditor/Fields/MFDouble.svg +162 -0
  40. package/src/images/OutlineEditor/Fields/MFFloat.svg +173 -0
  41. package/src/images/OutlineEditor/Fields/MFImage.svg +234 -0
  42. package/src/images/OutlineEditor/Fields/MFInt32.svg +168 -0
  43. package/src/images/OutlineEditor/Fields/MFMatrix3d.svg +219 -0
  44. package/src/images/OutlineEditor/Fields/MFMatrix3f.svg +212 -0
  45. package/src/images/OutlineEditor/Fields/MFMatrix4d.svg +212 -0
  46. package/src/images/OutlineEditor/Fields/MFMatrix4f.svg +205 -0
  47. package/src/images/OutlineEditor/Fields/MFNode.svg +180 -0
  48. package/src/images/OutlineEditor/Fields/MFRotation.svg +175 -0
  49. package/src/images/OutlineEditor/Fields/MFString.svg +152 -0
  50. package/src/images/OutlineEditor/Fields/MFTime.svg +164 -0
  51. package/src/images/OutlineEditor/Fields/MFVec2d.svg +172 -0
  52. package/src/images/OutlineEditor/Fields/MFVec2f.svg +165 -0
  53. package/src/images/OutlineEditor/Fields/MFVec3d.svg +179 -0
  54. package/src/images/OutlineEditor/Fields/MFVec3f.svg +173 -0
  55. package/src/images/OutlineEditor/Fields/MFVec4d.svg +166 -0
  56. package/src/images/OutlineEditor/Fields/MFVec4f.svg +159 -0
  57. package/src/images/OutlineEditor/Fields/SFBool.svg +137 -0
  58. package/src/images/OutlineEditor/Fields/SFColor.svg +143 -0
  59. package/src/images/OutlineEditor/Fields/SFColorRGBA.svg +213 -0
  60. package/src/images/OutlineEditor/Fields/SFDouble.svg +155 -0
  61. package/src/images/OutlineEditor/Fields/SFFloat.svg +166 -0
  62. package/src/images/OutlineEditor/Fields/SFImage.svg +234 -0
  63. package/src/images/OutlineEditor/Fields/SFInt32.svg +163 -0
  64. package/src/images/OutlineEditor/Fields/SFMatrix3d.svg +219 -0
  65. package/src/images/OutlineEditor/Fields/SFMatrix3f.svg +206 -0
  66. package/src/images/OutlineEditor/Fields/SFMatrix4d.svg +212 -0
  67. package/src/images/OutlineEditor/Fields/SFMatrix4f.svg +199 -0
  68. package/src/images/OutlineEditor/Fields/SFNode.svg +174 -0
  69. package/src/images/OutlineEditor/Fields/SFRotation.svg +169 -0
  70. package/src/images/OutlineEditor/Fields/SFString.svg +147 -0
  71. package/src/images/OutlineEditor/Fields/SFTime.svg +158 -0
  72. package/src/images/OutlineEditor/Fields/SFVec2d.svg +166 -0
  73. package/src/images/OutlineEditor/Fields/SFVec2f.svg +159 -0
  74. package/src/images/OutlineEditor/Fields/SFVec3d.svg +173 -0
  75. package/src/images/OutlineEditor/Fields/SFVec3f.svg +167 -0
  76. package/src/images/OutlineEditor/Fields/SFVec4d.svg +166 -0
  77. package/src/images/OutlineEditor/Fields/SFVec4f.svg +153 -0
  78. package/src/images/OutlineEditor/Fields/Unkown.svg +137 -0
  79. package/src/images/OutlineEditor/Fields/none.png +0 -0
  80. package/src/images/OutlineEditor/Node/ExportedNode.svg +212 -0
  81. package/src/images/OutlineEditor/Node/ExternProto.svg +237 -0
  82. package/src/images/OutlineEditor/Node/ImportedNode.svg +230 -0
  83. package/src/images/OutlineEditor/Node/NULL.svg +160 -0
  84. package/src/images/OutlineEditor/Node/Prototype.svg +263 -0
  85. package/src/images/OutlineEditor/Node/Route.svg +207 -0
  86. package/src/images/OutlineEditor/Node/SharedNode.svg +245 -0
  87. package/src/images/OutlineEditor/Node/X3DBaseNode.svg +167 -0
  88. package/src/images/OutlineEditor/Node/X3DExecutionContext.svg +207 -0
  89. package/src/images/OutlineEditor/Values/Bell.svg +79 -0
  90. package/src/images/OutlineEditor/Values/FALSE.svg +76 -0
  91. package/src/images/OutlineEditor/Values/TRUE.svg +76 -0
  92. package/src/images/icon.icns +0 -0
  93. package/src/images/icon.ico +0 -0
  94. package/src/images/icon.png +0 -0
  95. package/src/images/icons/arrow.svg +113 -0
  96. package/src/images/icons/hand.svg +129 -0
  97. package/src/main.js +9 -0
  98. package/src/sunrize/Application/ActionKeys.js +80 -0
  99. package/src/sunrize/Application/Application.js +660 -0
  100. package/src/sunrize/Application/DataStorage.js +179 -0
  101. package/src/sunrize/Application/Document.js +453 -0
  102. package/src/sunrize/Application/Footer.js +46 -0
  103. package/src/sunrize/Application/GetText.js +10 -0
  104. package/src/sunrize/Application/Interface.js +148 -0
  105. package/src/sunrize/Application/SecondaryToolbar.js +156 -0
  106. package/src/sunrize/Application/Selection.js +49 -0
  107. package/src/sunrize/Application/Sidebar.js +51 -0
  108. package/src/sunrize/Application/Tabs.js +329 -0
  109. package/src/sunrize/Application/Traverse.js +341 -0
  110. package/src/sunrize/Bits/Algorithm.js +5 -0
  111. package/src/sunrize/Bits/Beep.js +13 -0
  112. package/src/sunrize/Bits/Highlight.js +16 -0
  113. package/src/sunrize/Bits/Validate.js +59 -0
  114. package/src/sunrize/Controls/AddPrototypePopover.js +111 -0
  115. package/src/sunrize/Controls/Dialog.js +74 -0
  116. package/src/sunrize/Controls/EditUserDefinedFieldPopover.js +223 -0
  117. package/src/sunrize/Controls/Popover.js +32 -0
  118. package/src/sunrize/Controls/RenameNodeInput.js +94 -0
  119. package/src/sunrize/Controls/RenameNodePopover.js +40 -0
  120. package/src/sunrize/Controls/Splitter.js +102 -0
  121. package/src/sunrize/Controls/Tabs.js +96 -0
  122. package/src/sunrize/Editors/AnimationEditor.js +18 -0
  123. package/src/sunrize/Editors/BrowserSize.js +101 -0
  124. package/src/sunrize/Editors/Console.js +239 -0
  125. package/src/sunrize/Editors/FileManager.js +18 -0
  126. package/src/sunrize/Editors/Library.js +268 -0
  127. package/src/sunrize/Editors/NodeInspector.js +18 -0
  128. package/src/sunrize/Editors/NodeList.js +122 -0
  129. package/src/sunrize/Editors/OutlineEditor.js +2007 -0
  130. package/src/sunrize/Editors/OutlineRouteGraph.js +557 -0
  131. package/src/sunrize/Editors/OutlineView.js +3017 -0
  132. package/src/sunrize/Editors/Primitives.js +452 -0
  133. package/src/sunrize/Editors/SceneProperties.js +477 -0
  134. package/src/sunrize/Editors/ScriptEditor.js +594 -0
  135. package/src/sunrize/Editors/Units.js +146 -0
  136. package/src/sunrize/Fields/MFStringTextArea.js +32 -0
  137. package/src/sunrize/Fields/SFStringInput.js +32 -0
  138. package/src/sunrize/Fields.js +2 -0
  139. package/src/sunrize/Tools/CADGeometry/CADAssemblyTool.js +20 -0
  140. package/src/sunrize/Tools/CADGeometry/CADFaceTool.js +20 -0
  141. package/src/sunrize/Tools/CADGeometry/CADLayerTool.js +20 -0
  142. package/src/sunrize/Tools/CADGeometry/CADPartTool.js +20 -0
  143. package/src/sunrize/Tools/CADGeometry.js +6 -0
  144. package/src/sunrize/Tools/Core/ToolColors.js +33 -0
  145. package/src/sunrize/Tools/Core/X3DNodeTool.js +132 -0
  146. package/src/sunrize/Tools/Core/X3DPrototypeInstanceTool.js +31 -0
  147. package/src/sunrize/Tools/Core.js +3 -0
  148. package/src/sunrize/Tools/Geospatial/GeoLODTool.js +40 -0
  149. package/src/sunrize/Tools/Geospatial/GeoLocationTool.js +20 -0
  150. package/src/sunrize/Tools/Geospatial/GeoTransformTool.js +20 -0
  151. package/src/sunrize/Tools/Geospatial.js +5 -0
  152. package/src/sunrize/Tools/Grouping/GroupTool.js +20 -0
  153. package/src/sunrize/Tools/Grouping/StaticGroupTool.js +20 -0
  154. package/src/sunrize/Tools/Grouping/SwitchTool.js +20 -0
  155. package/src/sunrize/Tools/Grouping/TransformTool.js +20 -0
  156. package/src/sunrize/Tools/Grouping/TransformTool.x3d +37 -0
  157. package/src/sunrize/Tools/Grouping/Vector.x3d +98 -0
  158. package/src/sunrize/Tools/Grouping/X3DBoundedObjectTool.js +44 -0
  159. package/src/sunrize/Tools/Grouping/X3DBoundedObjectTool.x3d +330 -0
  160. package/src/sunrize/Tools/Grouping/X3DTransformNodeTool.js +44 -0
  161. package/src/sunrize/Tools/Grouping.js +6 -0
  162. package/src/sunrize/Tools/HAnim/HAnimHumanoidTool.js +20 -0
  163. package/src/sunrize/Tools/HAnim/HAnimJointTool.js +20 -0
  164. package/src/sunrize/Tools/HAnim/HAnimSegmentTool.js +20 -0
  165. package/src/sunrize/Tools/HAnim/HAnimSiteTool.js +20 -0
  166. package/src/sunrize/Tools/HAnim.js +6 -0
  167. package/src/sunrize/Tools/Layering/LayerTool.js +16 -0
  168. package/src/sunrize/Tools/Layering/X3DLayerNodeTool.js +22 -0
  169. package/src/sunrize/Tools/Layering.js +3 -0
  170. package/src/sunrize/Tools/Layout/LayoutGroupTool.js +78 -0
  171. package/src/sunrize/Tools/Layout/LayoutLayerTool.js +16 -0
  172. package/src/sunrize/Tools/Layout/ScreenGroupTool.js +20 -0
  173. package/src/sunrize/Tools/Layout.js +5 -0
  174. package/src/sunrize/Tools/Navigation/BillboardTool.js +37 -0
  175. package/src/sunrize/Tools/Navigation/CollisionTool.js +37 -0
  176. package/src/sunrize/Tools/Navigation/LODTool.js +37 -0
  177. package/src/sunrize/Tools/Navigation.js +5 -0
  178. package/src/sunrize/Tools/Networking/AnchorTool.js +20 -0
  179. package/src/sunrize/Tools/Networking/InlineTool.js +20 -0
  180. package/src/sunrize/Tools/Networking.js +4 -0
  181. package/src/sunrize/Tools/ParticleSystems/ParticleSystemTool.js +20 -0
  182. package/src/sunrize/Tools/ParticleSystems.js +3 -0
  183. package/src/sunrize/Tools/Picking/PickableGroupTool.js +20 -0
  184. package/src/sunrize/Tools/Picking.js +3 -0
  185. package/src/sunrize/Tools/RigidBodyPhysics/CollidableOffsetTool.js +37 -0
  186. package/src/sunrize/Tools/RigidBodyPhysics/CollidableShapeTool.js +37 -0
  187. package/src/sunrize/Tools/RigidBodyPhysics.js +4 -0
  188. package/src/sunrize/Tools/Shaders/ToolShader.x3d +86 -0
  189. package/src/sunrize/Tools/Shape/ShapeTool.js +20 -0
  190. package/src/sunrize/Tools/Shape.js +3 -0
  191. package/src/sunrize/Tools/VolumeRendering/IsoSurfaceVolumeDataTool.js +16 -0
  192. package/src/sunrize/Tools/VolumeRendering/SegmentedVolumeDataTool.js +16 -0
  193. package/src/sunrize/Tools/VolumeRendering/VolumeDataTool.js +16 -0
  194. package/src/sunrize/Tools/VolumeRendering/X3DVolumeDataNodeTool.js +12 -0
  195. package/src/sunrize/Tools/VolumeRendering.js +5 -0
  196. package/src/sunrize/Tools.js +15 -0
  197. package/src/sunrize/Undo/Editor.js +2146 -0
  198. package/src/sunrize/Undo/UndoManager.js +204 -0
  199. package/src/sunrize/X3D.js +8 -0
  200. package/src/themes/dark.css +1291 -0
@@ -0,0 +1,37 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "http://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='http://www.web3d.org/specifications/x3d-4.0.xsd'>
4
+ <head>
5
+ <meta name='created' content='Sat, 11 Mar 2023 10:55:09 GMT'/>
6
+ <meta name='comment' content='Rise and Shine'/>
7
+ <meta name='creator' content='Holger Seelig'/>
8
+ <meta name='generator' content='Sunrize X3D Editor V1.0.11, https://create3000.github.io/sunrize/'/>
9
+ <meta name='identifier' content='file:///Users/holger/Desktop/X_ITE/sunrize/src/sunrize/Tools/Grouping/TransformTool.x3d'/>
10
+ <meta name='modified' content='Sat, 11 Mar 2023 15:53:51 GMT'/>
11
+ </head>
12
+ <Scene>
13
+ <ProtoDeclare name='Tool'>
14
+ <ProtoInterface>
15
+ <field accessType='inputOnly' type='SFColor' name='bboxColor' value='1 1 1'/>
16
+ </ProtoInterface>
17
+ <ProtoBody>
18
+ <Transform DEF='IndexedLineSet'>
19
+ <Shape>
20
+ <Appearance>
21
+ <UnlitMaterial>
22
+ <IS>
23
+ <connect nodeField='emissiveColor' protoField='bboxColor'/>
24
+ </IS>
25
+ </UnlitMaterial>
26
+ </Appearance>
27
+ <IndexedLineSet
28
+ coordIndex='0, 1, 2, 3, 0, -1, 4, 5, 6, 7, 4, -1, 0, 4, -1, 1, 5, -1, 2, 6, -1, 3, 7, -1'>
29
+ <Coordinate
30
+ point='0.5 0.5 0.5, -0.5 0.5 0.5, -0.5 -0.5 0.5, 0.5 -0.5 0.5, 0.5 0.5 -0.5, -0.5 0.5 -0.5, -0.5 -0.5 -0.5, 0.5 -0.5 -0.5'/>
31
+ </IndexedLineSet>
32
+ </Shape>
33
+ </Transform>
34
+ </ProtoBody>
35
+ </ProtoDeclare>
36
+ </Scene>
37
+ </X3D>
@@ -0,0 +1,98 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "http://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='http://www.web3d.org/specifications/x3d-4.0.xsd'>
4
+ <head>
5
+ <component name='Geometry2D' level='2'/>
6
+ <component name='Layout' level='2'/>
7
+ <meta name='comment' content='Rise and Shine'/>
8
+ <meta name='created' content='Sun, 03 Aug 2014 14:43:17 GMT'/>
9
+ <meta name='creator' content='Holger Seelig'/>
10
+ <meta name='generator' content='Sunrize X3D Editor V1.0.11, https://create3000.github.io/sunrize/'/>
11
+ <meta name='identifier' content='file:///Users/holger/Desktop/X_ITE/sunrize/src/sunrize/Tools/Grouping/Vector.x3d'/>
12
+ <meta name='modified' content='Thu, 16 Mar 2023 12:05:53 GMT'/>
13
+ </head>
14
+ <Scene>
15
+ <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
16
+ </ExternProtoDeclare>
17
+ <ScreenGroup DEF='Vector'>
18
+ <Transform
19
+ rotation='1 0 0 1.5708'>
20
+ <Transform DEF='Cone'
21
+ translation='0 60 0'
22
+ scale='6 9 6'>
23
+ <Shape>
24
+ <Appearance DEF='_1'>
25
+ <Material
26
+ diffuseColor='0.8 0.8 0.16'/>
27
+ <ProtoInstance name='ToolShader' DEF='_2' containerField='shaders'/>
28
+ </Appearance>
29
+ <Cone/>
30
+ </Shape>
31
+ </Transform>
32
+ <Transform DEF='Cylinder'
33
+ translation='0 30 0'
34
+ scale='2 30 2'>
35
+ <Shape>
36
+ <Appearance USE='_1'/>
37
+ <Cylinder/>
38
+ </Shape>
39
+ </Transform>
40
+ <Transform DEF='Sphere'
41
+ scale='6 6 6'>
42
+ <Shape>
43
+ <Appearance USE='_1'/>
44
+ <Sphere/>
45
+ </Shape>
46
+ </Transform>
47
+ <Switch
48
+ whichChoice='1'>
49
+ <Transform DEF='Grid'
50
+ scale='15 1 15'>
51
+ <Shape>
52
+ <Appearance>
53
+ <ProtoInstance name='ToolShader' containerField='shaders'/>
54
+ </Appearance>
55
+ <IndexedLineSet
56
+ colorPerVertex='false'
57
+ colorIndex='0, 1, 2'
58
+ coordIndex='0, 1, 2, 3, 0, -1, 4, 5, -1, 6, 7, -1, 8, 9, -1, 10, 11, -1, 12, 13, -1, 14, 15, -1'>
59
+ <Color
60
+ color='1 0.2 0.2, 1 0.2 0.2, 1 0.2 0.2, 1 0.2 0.2, 1 0.2 0.2, 1 0.2 0.2, 1 0.2 0.2'/>
61
+ <Coordinate
62
+ point='-2 0 2, 2 0 2, 2 0 -2, -2 0 -2, -1 0 2, -1 0 -2, 0 0 2, 0 0 -2, 1 0 2, 1 0 -2, -2 0 1, 2 0 1, -2 0 0, 2 0 0, -2 0 -1, 2 0 -1'/>
63
+ </IndexedLineSet>
64
+ </Shape>
65
+ </Transform>
66
+ <Transform DEF='Circles'
67
+ rotation='1 0 0 4.71239'>
68
+ <Shape>
69
+ <Appearance DEF='_3'>
70
+ <Material
71
+ emissiveColor='1 0.2 0.2'/>
72
+ <ProtoInstance name='ToolShader' USE='_2' containerField='shaders'/>
73
+ </Appearance>
74
+ <Circle2D
75
+ radius='18'/>
76
+ </Shape>
77
+ <Shape>
78
+ <Appearance USE='_3'/>
79
+ <Circle2D
80
+ radius='12'/>
81
+ </Shape>
82
+ <Shape>
83
+ <IndexedLineSet
84
+ colorPerVertex='false'
85
+ colorIndex='0, 1, 2'
86
+ coordIndex='0, 1, -1, 2, 3'>
87
+ <Color
88
+ color='1 0.2 0.2, 1 0.2 0.2'/>
89
+ <Coordinate
90
+ point='0 -18 0, 0 18 0, -18 0 0, 18 0 0'/>
91
+ </IndexedLineSet>
92
+ </Shape>
93
+ </Transform>
94
+ </Switch>
95
+ </Transform>
96
+ </ScreenGroup>
97
+ </Scene>
98
+ </X3D>
@@ -0,0 +1,44 @@
1
+ "use strict"
2
+
3
+ const
4
+ X3DNodeTool = require ("../Core/X3DNodeTool"),
5
+ X3D = require ("../../X3D"),
6
+ Box3 = X3D .require ("standard/Math/Geometry/Box3")
7
+
8
+ class X3DBoundedObjectTool extends X3DNodeTool
9
+ {
10
+ async initialize ()
11
+ {
12
+ super .initialize ();
13
+
14
+ await this .load (__dirname, "X3DBoundedObjectTool.x3d")
15
+
16
+ this .node .getBrowser () .displayEvents () .addInterest ("reshape", this)
17
+
18
+ this .tool .bboxColor = this .bboxColor
19
+ }
20
+
21
+ static box = new Box3 ()
22
+
23
+ reshape ()
24
+ {
25
+ const
26
+ bbox = this .node .getBBox (X3DBoundedObjectTool .box),
27
+ bboxSize = bbox .size,
28
+ bboxCenter = bbox .center
29
+
30
+ if (!this .tool .bboxSize .getValue () .equals (bboxSize))
31
+ this .tool .bboxSize = bboxSize
32
+
33
+ if (!this .tool .bboxCenter .getValue () .equals (bboxCenter))
34
+ this .tool .bboxCenter = bboxCenter
35
+ }
36
+
37
+ traverse (type, renderObject)
38
+ {
39
+ this .node .traverse (type, renderObject)
40
+ this .innerNode?.traverse (type, renderObject)
41
+ }
42
+ }
43
+
44
+ module .exports = X3DBoundedObjectTool
@@ -0,0 +1,330 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "http://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='http://www.web3d.org/specifications/x3d-4.0.xsd'>
4
+ <head>
5
+ <component name='Layout' level='2'/>
6
+ <component name='Scripting' level='1'/>
7
+ <meta name='comment' content='Rise and Shine'/>
8
+ <meta name='created' content='Fri, 29 Aug 2014 13:13:27 GMT'/>
9
+ <meta name='creator' content='Holger Seelig'/>
10
+ <meta name='generator' content='Sunrize X3D Editor V1.0.11, https://create3000.github.io/sunrize/'/>
11
+ <meta name='identifier' content='file:///Users/holger/Desktop/X_ITE/sunrize/src/sunrize/Tools/Grouping/X3DBoundedObjectTool.x3d'/>
12
+ <meta name='modified' content='Sun, 19 Mar 2023 16:33:08 GMT'/>
13
+ </head>
14
+ <Scene>
15
+ <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
16
+ </ExternProtoDeclare>
17
+ <ProtoDeclare name='Tool'>
18
+ <ProtoInterface>
19
+ <field accessType='inputOutput' type='SFVec3f' name='center'/>
20
+ <field accessType='inputOutput' type='SFBool' name='centerDisplay'/>
21
+ <field accessType='inputOutput' type='SFVec3f' name='axisOfRotation'/>
22
+ <field accessType='inputOutput' type='SFBool' name='rectangleDisplay'/>
23
+ <field accessType='inputOutput' type='SFVec3f' name='rectangleSize' value='1 1 1'/>
24
+ <field accessType='inputOutput' type='SFVec3f' name='rectangleCenter'/>
25
+ <field accessType='inputOutput' type='SFInt32' name='bboxStyle' value='1'/>
26
+ <field accessType='inputOutput' type='SFColor' name='bboxColor' value='0.35 1 0.7'/>
27
+ <field accessType='inputOutput' type='SFVec3f' name='bboxSize' value='1 1 1'/>
28
+ <field accessType='inputOutput' type='SFVec3f' name='bboxCenter'/>
29
+ </ProtoInterface>
30
+ <ProtoBody>
31
+ <Collision
32
+ enabled='false'>
33
+ <Transform DEF='BoundingBox'>
34
+ <IS>
35
+ <connect nodeField='translation' protoField='bboxCenter'/>
36
+ </IS>
37
+ <Shape DEF='Box'>
38
+ <Appearance>
39
+ <LineProperties
40
+ linewidthScaleFactor='2'>
41
+ <IS>
42
+ <connect nodeField='linetype' protoField='bboxStyle'/>
43
+ </IS>
44
+ </LineProperties>
45
+ <UnlitMaterial DEF='BBoxMaterial'>
46
+ <IS>
47
+ <connect nodeField='emissiveColor' protoField='bboxColor'/>
48
+ </IS>
49
+ </UnlitMaterial>
50
+ </Appearance>
51
+ <IndexedLineSet
52
+ coordIndex='0, 1, 2, 3, 0, -1, 4, 5, 6, 7, 4, -1, 0, 4, -1, 3, 7, -1, 1, 5, -1, 2, 6, -1'>
53
+ <Coordinate DEF='BBox'
54
+ point='-0.5 0.5 0.5, -0.5 -0.5 0.5, 0.5 -0.5 0.5, 0.5 0.5 0.5, -0.5 0.5 -0.5, -0.5 -0.5 -0.5, 0.5 -0.5 -0.5, 0.5 0.5 -0.5'/>
55
+ </IndexedLineSet>
56
+ </Shape>
57
+ <Shape DEF='Axes_1'>
58
+ <IndexedLineSet
59
+ colorPerVertex='false'
60
+ coordIndex='0, 1, -1, 0, 2, -1, 0, 3, -1'>
61
+ <Color
62
+ color='1 0 0, 0 1 0, 0 0 1'/>
63
+ <Coordinate DEF='AxesCoord'
64
+ point='0 0 0, 0.5 0 0, 0 0.5 0, 0 0 0.5, 0 0 0'/>
65
+ </IndexedLineSet>
66
+ </Shape>
67
+ </Transform>
68
+ <Transform DEF='AdjustmentHandles'>
69
+ <IS>
70
+ <connect nodeField='translation' protoField='bboxCenter'/>
71
+ </IS>
72
+ <Transform DEF='XHandle'
73
+ translation='0.5 0 0'>
74
+ <ScreenGroup>
75
+ <Transform
76
+ translation='6 0 0'
77
+ rotation='0 0 -1 1.5708'>
78
+ <Shape>
79
+ <Appearance DEF='Red'>
80
+ <Material
81
+ diffuseColor='1 0 0'/>
82
+ <ProtoInstance name='ToolShader' DEF='_1' containerField='shaders'/>
83
+ </Appearance>
84
+ <Cone DEF='Arrow'
85
+ height='12'
86
+ bottomRadius='4'/>
87
+ </Shape>
88
+ </Transform>
89
+ </ScreenGroup>
90
+ </Transform>
91
+ <Transform DEF='YHandle'
92
+ translation='0 0.5 0'>
93
+ <ScreenGroup>
94
+ <Transform
95
+ translation='0 6 0'>
96
+ <Shape>
97
+ <Appearance DEF='Green'>
98
+ <Material
99
+ diffuseColor='0 1 0'/>
100
+ <ProtoInstance name='ToolShader' USE='_1' containerField='shaders'/>
101
+ </Appearance>
102
+ <Cone USE='Arrow'/>
103
+ </Shape>
104
+ </Transform>
105
+ </ScreenGroup>
106
+ </Transform>
107
+ <Transform DEF='ZHandle'
108
+ translation='0 0 0.5'>
109
+ <ScreenGroup>
110
+ <Transform
111
+ translation='0 0 6'
112
+ rotation='1 0 0 1.5708'>
113
+ <Shape>
114
+ <Appearance DEF='Blue'>
115
+ <Material
116
+ diffuseColor='0 0 1'/>
117
+ <ProtoInstance name='ToolShader' USE='_1' containerField='shaders'/>
118
+ </Appearance>
119
+ <Cone USE='Arrow'/>
120
+ </Shape>
121
+ </Transform>
122
+ </ScreenGroup>
123
+ </Transform>
124
+ </Transform>
125
+ <Transform DEF='Center'>
126
+ <IS>
127
+ <connect nodeField='visible' protoField='centerDisplay'/>
128
+ </IS>
129
+ <Shape DEF='CenterLine'>
130
+ <Appearance>
131
+ <LineProperties
132
+ linetype='3'
133
+ linewidthScaleFactor='2'/>
134
+ </Appearance>
135
+ <IndexedLineSet DEF='CenterIndexedLineSet'
136
+ coordIndex='0, 1, -1'>
137
+ <Color
138
+ color='1 1 0, 1 1 0'/>
139
+ <Coordinate DEF='CenterLineCoord'
140
+ point='0 0 0, 0 0 0'/>
141
+ </IndexedLineSet>
142
+ </Shape>
143
+ <Transform DEF='_2'>
144
+ <IS>
145
+ <connect nodeField='translation' protoField='center'/>
146
+ </IS>
147
+ <ScreenGroup DEF='CenterPoint'>
148
+ <Shape>
149
+ <Appearance>
150
+ <Material
151
+ diffuseColor='1 1 0'/>
152
+ <ProtoInstance name='ToolShader' USE='_1' containerField='shaders'/>
153
+ </Appearance>
154
+ <Sphere
155
+ radius='5'/>
156
+ </Shape>
157
+ </ScreenGroup>
158
+ <Inline DEF='Vector'
159
+ global='true'
160
+ load='false'
161
+ url='"Vector.x3d"'
162
+ visible='false'/>
163
+ </Transform>
164
+ </Transform>
165
+ <Transform DEF='Rectangle'>
166
+ <IS>
167
+ <connect nodeField='translation' protoField='rectangleCenter'/>
168
+ <connect nodeField='visible' protoField='rectangleDisplay'/>
169
+ </IS>
170
+ <Shape DEF='Box_1'>
171
+ <Appearance>
172
+ <LineProperties
173
+ linewidthScaleFactor='2'/>
174
+ <Material DEF='BBoxMaterial_1'
175
+ emissiveColor='0 1 0'/>
176
+ <ProtoInstance name='ToolShader' USE='_1' containerField='shaders'/>
177
+ </Appearance>
178
+ <IndexedLineSet
179
+ coordIndex='0, 1, 2, 3, 0, -1'>
180
+ <Coordinate DEF='Rectangle_1'
181
+ point='-0.5 0.5 0, -0.5 -0.5 0, 0.5 -0.5 0, 0.5 0.5 0'/>
182
+ </IndexedLineSet>
183
+ </Shape>
184
+ </Transform>
185
+ </Collision>
186
+ <Script DEF='BBoxScript'
187
+ directOutput='true'>
188
+ <field accessType='inputOutput' type='SFBool' name='rectangleDisplay'/>
189
+ <field accessType='inputOutput' type='SFVec3f' name='rectangleSize'/>
190
+ <field accessType='inputOutput' type='SFVec3f' name='bboxSize'/>
191
+ <field accessType='initializeOnly' type='SFNode' name='rectangle'>
192
+ <Coordinate USE='Rectangle_1'/>
193
+ </field>
194
+ <field accessType='initializeOnly' type='SFNode' name='bbox'>
195
+ <Coordinate USE='BBox'/>
196
+ </field>
197
+ <field accessType='initializeOnly' type='SFNode' name='axes'>
198
+ <Coordinate USE='AxesCoord'/>
199
+ </field>
200
+ <IS>
201
+ <connect nodeField='rectangleDisplay' protoField='rectangleDisplay'/>
202
+ <connect nodeField='rectangleSize' protoField='rectangleSize'/>
203
+ <connect nodeField='bboxSize' protoField='bboxSize'/>
204
+ </IS>
205
+ <![CDATA[ecmascript:
206
+
207
+ function eventsProcessed ()
208
+ {
209
+ var bboxSize1_2 = bboxSize .divide (2);
210
+
211
+ // Axes
212
+
213
+ axes .point = new MFVec3f (new SFVec3f (0, 0, 0),
214
+ new SFVec3f (bboxSize1_2 .x, 0, 0),
215
+ new SFVec3f (0, bboxSize1_2 .y, 0),
216
+ new SFVec3f (0, 0, bboxSize1_2 .z),
217
+ new SFVec3f (0, 0, 0));
218
+
219
+
220
+ // BBox
221
+
222
+ bbox .point = new MFVec3f (new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, bboxSize1_2 .z),
223
+ new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, bboxSize1_2 .z),
224
+ new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, bboxSize1_2 .z),
225
+ new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, bboxSize1_2 .z),
226
+ new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, -bboxSize1_2 .z),
227
+ new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, -bboxSize1_2 .z),
228
+ new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, -bboxSize1_2 .z),
229
+ new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, -bboxSize1_2 .z));
230
+
231
+ if (rectangleDisplay)
232
+ {
233
+ var bboxSize1_2 = rectangleSize .divide (2);
234
+
235
+ // BBox
236
+
237
+ rectangle .point = new MFVec3f (new SFVec3f (-bboxSize1_2 .x, bboxSize1_2 .y, 0),
238
+ new SFVec3f (-bboxSize1_2 .x, -bboxSize1_2 .y, 0),
239
+ new SFVec3f ( bboxSize1_2 .x, -bboxSize1_2 .y, 0),
240
+ new SFVec3f ( bboxSize1_2 .x, bboxSize1_2 .y, 0));
241
+ }
242
+ }
243
+ ]]>
244
+ </Script>
245
+ <Script DEF='ArrowsScript'
246
+ directOutput='true'>
247
+ <field accessType='inputOutput' type='SFVec3f' name='bboxSize'/>
248
+ <field accessType='initializeOnly' type='SFNode' name='x'>
249
+ <Transform USE='XHandle'/>
250
+ </field>
251
+ <field accessType='initializeOnly' type='SFNode' name='y'>
252
+ <Transform USE='YHandle'/>
253
+ </field>
254
+ <field accessType='initializeOnly' type='SFNode' name='z'>
255
+ <Transform USE='ZHandle'/>
256
+ </field>
257
+ <IS>
258
+ <connect nodeField='bboxSize' protoField='bboxSize'/>
259
+ </IS>
260
+ <![CDATA[ecmascript:
261
+
262
+ function eventsProcessed ()
263
+ {
264
+ // Position arrows
265
+
266
+ var bboxSize1_2 = bboxSize .divide (2);
267
+
268
+ x .translation = new SFVec3f (bboxSize1_2 .x, 0, 0);
269
+ y .translation = new SFVec3f (0, bboxSize1_2 .y, 0);
270
+ z .translation = new SFVec3f (0, 0, bboxSize1_2 .z);
271
+ }
272
+ ]]>
273
+ </Script>
274
+ <Script DEF='CenterScript'
275
+ directOutput='true'>
276
+ <field accessType='inputOutput' type='SFVec3f' name='center'/>
277
+ <field accessType='inputOutput' type='SFVec3f' name='bboxSize'/>
278
+ <field accessType='inputOutput' type='SFVec3f' name='bboxCenter'/>
279
+ <field accessType='initializeOnly' type='SFNode' name='coord'>
280
+ <Coordinate USE='CenterLineCoord'/>
281
+ </field>
282
+ <IS>
283
+ <connect nodeField='center' protoField='center'/>
284
+ <connect nodeField='bboxSize' protoField='bboxSize'/>
285
+ <connect nodeField='bboxCenter' protoField='bboxCenter'/>
286
+ </IS>
287
+ <![CDATA[ecmascript:
288
+
289
+ function eventsProcessed ()
290
+ {
291
+ coord .point [0] = center;
292
+ coord .point [1] = bboxCenter;
293
+ }
294
+ ]]>
295
+ </Script>
296
+ <Script DEF='AxisOfRotationScript'
297
+ directOutput='true'>
298
+ <field accessType='inputOutput' type='SFVec3f' name='vector'/>
299
+ <field accessType='initializeOnly' type='SFVec3f' name='zAxis' value='0 0 1'/>
300
+ <field accessType='initializeOnly' type='SFNode' name='transform'>
301
+ <Transform USE='_2'/>
302
+ </field>
303
+ <field accessType='initializeOnly' type='SFNode' name='inline'>
304
+ <Inline USE='Vector'/>
305
+ </field>
306
+ <IS>
307
+ <connect nodeField='vector' protoField='axisOfRotation'/>
308
+ </IS>
309
+ <![CDATA[ecmascript:
310
+
311
+ function eventsProcessed ()
312
+ {
313
+ if (vector .x == 0 && vector .y == 0 && vector .z == 0)
314
+ {
315
+ inline .visible = false;
316
+ }
317
+ else
318
+ {
319
+ inline .load = true;
320
+ inline .visible = true;
321
+
322
+ transform .rotation = new SFRotation (zAxis, vector);
323
+ }
324
+ }
325
+ ]]>
326
+ </Script>
327
+ </ProtoBody>
328
+ </ProtoDeclare>
329
+ </Scene>
330
+ </X3D>
@@ -0,0 +1,44 @@
1
+ "use strict"
2
+
3
+ const
4
+ X3DNodeTool = require ("../Core/X3DNodeTool"),
5
+ X3D = require ("../../X3D"),
6
+ Box3 = X3D .require ("standard/Math/Geometry/Box3")
7
+
8
+ class X3DTransformNodeTool extends X3DNodeTool
9
+ {
10
+ async initialize ()
11
+ {
12
+ super .initialize ();
13
+
14
+ await this .load (__dirname, "X3DBoundedObjectTool.x3d")
15
+
16
+ this .node .getBrowser () .displayEvents () .addInterest ("reshape", this)
17
+
18
+ this .tool .bboxColor = this .bboxColor
19
+ }
20
+
21
+ static box = new Box3 ()
22
+
23
+ reshape ()
24
+ {
25
+ const
26
+ bbox = this .node .getBBox (X3DTransformNodeTool .box),
27
+ bboxSize = bbox .size,
28
+ bboxCenter = bbox .center
29
+
30
+ if (!this .tool .bboxSize .getValue () .equals (bboxSize))
31
+ this .tool .bboxSize = bboxSize
32
+
33
+ if (!this .tool .bboxCenter .getValue () .equals (bboxCenter))
34
+ this .tool .bboxCenter = bboxCenter
35
+ }
36
+
37
+ traverse (type, renderObject)
38
+ {
39
+ this .node .traverse (type, renderObject)
40
+ this .innerNode?.traverse (type, renderObject)
41
+ }
42
+ }
43
+
44
+ module .exports = X3DTransformNodeTool
@@ -0,0 +1,6 @@
1
+ "use strict"
2
+
3
+ require ("./Grouping/GroupTool")
4
+ require ("./Grouping/StaticGroupTool")
5
+ require ("./Grouping/SwitchTool")
6
+ require ("./Grouping/TransformTool")
@@ -0,0 +1,20 @@
1
+ "use strict"
2
+
3
+ const
4
+ X3DTransformNodeTool = require ("../Grouping/X3DTransformNodeTool"),
5
+ ToolColors = require ("../Core/ToolColors"),
6
+ X3D = require ("../../X3D"),
7
+ HAnimHumanoid = X3D .require ("x_ite/Components/HAnim/HAnimHumanoid")
8
+
9
+ class HAnimHumanoidTool extends X3DTransformNodeTool
10
+ {
11
+ bboxColor = ToolColors .GREEN
12
+ }
13
+
14
+ Object .assign (HAnimHumanoid .prototype,
15
+ {
16
+ createTool: function ()
17
+ {
18
+ return new HAnimHumanoidTool (this)
19
+ },
20
+ })
@@ -0,0 +1,20 @@
1
+ "use strict"
2
+
3
+ const
4
+ X3DTransformNodeTool = require ("../Grouping/X3DTransformNodeTool"),
5
+ ToolColors = require ("../Core/ToolColors"),
6
+ X3D = require ("../../X3D"),
7
+ HAnimJoint = X3D .require ("x_ite/Components/HAnim/HAnimJoint")
8
+
9
+ class HAnimJointTool extends X3DTransformNodeTool
10
+ {
11
+ bboxColor = ToolColors .GREEN
12
+ }
13
+
14
+ Object .assign (HAnimJoint .prototype,
15
+ {
16
+ createTool: function ()
17
+ {
18
+ return new HAnimJointTool (this)
19
+ },
20
+ })
@@ -0,0 +1,20 @@
1
+ "use strict"
2
+
3
+ const
4
+ X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"),
5
+ ToolColors = require ("../Core/ToolColors"),
6
+ X3D = require ("../../X3D"),
7
+ HAnimSegment = X3D .require ("x_ite/Components/HAnim/HAnimSegment")
8
+
9
+ class HAnimSegmentTool extends X3DBoundedObjectTool
10
+ {
11
+ bboxColor = ToolColors .DARK_GREEN
12
+ }
13
+
14
+ Object .assign (HAnimSegment .prototype,
15
+ {
16
+ createTool: function ()
17
+ {
18
+ return new HAnimSegmentTool (this)
19
+ },
20
+ })
@@ -0,0 +1,20 @@
1
+ "use strict"
2
+
3
+ const
4
+ X3DTransformNodeTool = require ("../Grouping/X3DTransformNodeTool"),
5
+ ToolColors = require ("../Core/ToolColors"),
6
+ X3D = require ("../../X3D"),
7
+ HAnimSite = X3D .require ("x_ite/Components/HAnim/HAnimSite")
8
+
9
+ class HAnimSiteTool extends X3DTransformNodeTool
10
+ {
11
+ bboxColor = ToolColors .GREEN
12
+ }
13
+
14
+ Object .assign (HAnimSite .prototype,
15
+ {
16
+ createTool: function ()
17
+ {
18
+ return new HAnimSiteTool (this)
19
+ },
20
+ })
@@ -0,0 +1,6 @@
1
+ "use strict"
2
+
3
+ require ("./HAnim/HAnimHumanoidTool")
4
+ require ("./HAnim/HAnimJointTool")
5
+ require ("./HAnim/HAnimSegmentTool")
6
+ require ("./HAnim/HAnimSiteTool")
@@ -0,0 +1,16 @@
1
+ "use strict"
2
+
3
+ const
4
+ X3DLayerNodeTool = require ("./X3DLayerNodeTool"),
5
+ X3D = require ("../../X3D"),
6
+ Layer = X3D .require ("x_ite/Components/Layering/Layer")
7
+
8
+ class LayerTool extends X3DLayerNodeTool { }
9
+
10
+ Object .assign (Layer .prototype,
11
+ {
12
+ createTool: function ()
13
+ {
14
+ return new LayerTool (this)
15
+ },
16
+ })