@xeokit/xeokit-sdk 2.6.0-beta-13 → 2.6.0-beta-14
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/dist/web-ifc.wasm +0 -0
- package/dist/xeokit-sdk.cjs.js +72 -37
- package/dist/xeokit-sdk.es.js +72 -37
- package/dist/xeokit-sdk.es5.js +15 -15
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/dist/xeokit-sdk.min.es5.js +1 -1
- package/package.json +1 -1
- package/src/plugins/SectionPlanesPlugin/Control.js +70 -35
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -12766,7 +12766,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
12766
12766
|
* start, corner or end point will cause the point to snap to the nearest vertex or edge. A quick
|
|
12767
12767
|
* touch-release will immediately set the point at the tapped position on the object surface.
|
|
12768
12768
|
*
|
|
12769
|
-
* [[Run example](/examples/measurement/#angle_createWithTouch_snapping)]
|
|
12769
|
+
* [[Run example](https://xeokit.github.io/xeokit-sdk/examples/measurement/#angle_createWithTouch_snapping)]
|
|
12770
12770
|
*
|
|
12771
12771
|
* ````javascript
|
|
12772
12772
|
* import {Viewer, XKTLoaderPlugin, AngleMeasurementsPlugin, AngleMeasurementsTouchControl} from "xeokit-sdk.es.js";
|
|
@@ -87525,7 +87525,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
87525
87525
|
* start or end point will cause the point to snap to the nearest vertex or edge. A quick
|
|
87526
87526
|
* touch-release will immediately set the point at the tapped position on the object surface.
|
|
87527
87527
|
*
|
|
87528
|
-
* [[Run example](/examples/measurement/#distance_createWithTouch_snapping)]
|
|
87528
|
+
* [[Run example](https://xeokit.github.io/xeokit-sdk/examples/measurement/#distance_createWithTouch_snapping)]
|
|
87529
87529
|
*
|
|
87530
87530
|
* ````javascript
|
|
87531
87531
|
* import {Viewer, XKTLoaderPlugin, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl} from "xeokit-sdk.es.js";
|
|
@@ -118532,7 +118532,8 @@ class Control {
|
|
|
118532
118532
|
|
|
118533
118533
|
this._rootNode = new Node$2(scene, {
|
|
118534
118534
|
position: [0, 0, 0],
|
|
118535
|
-
scale: [5, 5, 5]
|
|
118535
|
+
scale: [5, 5, 5],
|
|
118536
|
+
isObject: false
|
|
118536
118537
|
});
|
|
118537
118538
|
|
|
118538
118539
|
const rootNode = this._rootNode;
|
|
@@ -118723,7 +118724,8 @@ class Control {
|
|
|
118723
118724
|
collidable: true,
|
|
118724
118725
|
clippable: false,
|
|
118725
118726
|
visible: false,
|
|
118726
|
-
scale: [2.4, 2.4, 1]
|
|
118727
|
+
scale: [2.4, 2.4, 1],
|
|
118728
|
+
isObject: false
|
|
118727
118729
|
}), NO_STATE_INHERIT),
|
|
118728
118730
|
|
|
118729
118731
|
planeFrame: rootNode.addChild(new Mesh(rootNode, { // Visible frame
|
|
@@ -118754,7 +118756,8 @@ class Control {
|
|
|
118754
118756
|
clippable: false,
|
|
118755
118757
|
visible: false,
|
|
118756
118758
|
scale: [1, 1, .1],
|
|
118757
|
-
rotation: [0, 0, 45]
|
|
118759
|
+
rotation: [0, 0, 45],
|
|
118760
|
+
isObject: false
|
|
118758
118761
|
}), NO_STATE_INHERIT),
|
|
118759
118762
|
|
|
118760
118763
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118773,7 +118776,8 @@ class Control {
|
|
|
118773
118776
|
collidable: true,
|
|
118774
118777
|
clippable: false,
|
|
118775
118778
|
backfaces: true,
|
|
118776
|
-
visible: false
|
|
118779
|
+
visible: false,
|
|
118780
|
+
isObject: false
|
|
118777
118781
|
}), NO_STATE_INHERIT),
|
|
118778
118782
|
|
|
118779
118783
|
xCurveHandle: rootNode.addChild(new Mesh(rootNode, { // Red hoop about Y-axis
|
|
@@ -118788,7 +118792,8 @@ class Control {
|
|
|
118788
118792
|
collidable: true,
|
|
118789
118793
|
clippable: false,
|
|
118790
118794
|
backfaces: true,
|
|
118791
|
-
visible: false
|
|
118795
|
+
visible: false,
|
|
118796
|
+
isObject: false
|
|
118792
118797
|
}), NO_STATE_INHERIT),
|
|
118793
118798
|
|
|
118794
118799
|
xCurveArrow1: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118803,7 +118808,8 @@ class Control {
|
|
|
118803
118808
|
pickable: true,
|
|
118804
118809
|
collidable: true,
|
|
118805
118810
|
clippable: false,
|
|
118806
|
-
visible: false
|
|
118811
|
+
visible: false,
|
|
118812
|
+
isObject: false
|
|
118807
118813
|
}), NO_STATE_INHERIT),
|
|
118808
118814
|
|
|
118809
118815
|
xCurveArrow2: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118818,7 +118824,8 @@ class Control {
|
|
|
118818
118824
|
pickable: true,
|
|
118819
118825
|
collidable: true,
|
|
118820
118826
|
clippable: false,
|
|
118821
|
-
visible: false
|
|
118827
|
+
visible: false,
|
|
118828
|
+
isObject: false
|
|
118822
118829
|
}), NO_STATE_INHERIT),
|
|
118823
118830
|
|
|
118824
118831
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118833,7 +118840,8 @@ class Control {
|
|
|
118833
118840
|
collidable: true,
|
|
118834
118841
|
clippable: false,
|
|
118835
118842
|
backfaces: true,
|
|
118836
|
-
visible: false
|
|
118843
|
+
visible: false,
|
|
118844
|
+
isObject: false
|
|
118837
118845
|
}), NO_STATE_INHERIT),
|
|
118838
118846
|
|
|
118839
118847
|
yCurveHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118844,7 +118852,8 @@ class Control {
|
|
|
118844
118852
|
collidable: true,
|
|
118845
118853
|
clippable: false,
|
|
118846
118854
|
backfaces: true,
|
|
118847
|
-
visible: false
|
|
118855
|
+
visible: false,
|
|
118856
|
+
isObject: false
|
|
118848
118857
|
}), NO_STATE_INHERIT),
|
|
118849
118858
|
|
|
118850
118859
|
yCurveArrow1: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118859,7 +118868,8 @@ class Control {
|
|
|
118859
118868
|
pickable: true,
|
|
118860
118869
|
collidable: true,
|
|
118861
118870
|
clippable: false,
|
|
118862
|
-
visible: false
|
|
118871
|
+
visible: false,
|
|
118872
|
+
isObject: false
|
|
118863
118873
|
}), NO_STATE_INHERIT),
|
|
118864
118874
|
|
|
118865
118875
|
yCurveArrow2: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118874,7 +118884,8 @@ class Control {
|
|
|
118874
118884
|
pickable: true,
|
|
118875
118885
|
collidable: true,
|
|
118876
118886
|
clippable: false,
|
|
118877
|
-
visible: false
|
|
118887
|
+
visible: false,
|
|
118888
|
+
isObject: false
|
|
118878
118889
|
}), NO_STATE_INHERIT),
|
|
118879
118890
|
|
|
118880
118891
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118888,7 +118899,8 @@ class Control {
|
|
|
118888
118899
|
pickable: false,
|
|
118889
118900
|
collidable: true,
|
|
118890
118901
|
clippable: false,
|
|
118891
|
-
visible: false
|
|
118902
|
+
visible: false,
|
|
118903
|
+
isObject: false
|
|
118892
118904
|
}), NO_STATE_INHERIT),
|
|
118893
118905
|
|
|
118894
118906
|
zCurveHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118898,7 +118910,8 @@ class Control {
|
|
|
118898
118910
|
pickable: true,
|
|
118899
118911
|
collidable: true,
|
|
118900
118912
|
clippable: false,
|
|
118901
|
-
visible: false
|
|
118913
|
+
visible: false,
|
|
118914
|
+
isObject: false
|
|
118902
118915
|
}), NO_STATE_INHERIT),
|
|
118903
118916
|
|
|
118904
118917
|
zCurveCurveArrow1: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118912,7 +118925,8 @@ class Control {
|
|
|
118912
118925
|
pickable: true,
|
|
118913
118926
|
collidable: true,
|
|
118914
118927
|
clippable: false,
|
|
118915
|
-
visible: false
|
|
118928
|
+
visible: false,
|
|
118929
|
+
isObject: false
|
|
118916
118930
|
}), NO_STATE_INHERIT),
|
|
118917
118931
|
|
|
118918
118932
|
zCurveArrow2: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118927,7 +118941,8 @@ class Control {
|
|
|
118927
118941
|
pickable: true,
|
|
118928
118942
|
collidable: true,
|
|
118929
118943
|
clippable: false,
|
|
118930
|
-
visible: false
|
|
118944
|
+
visible: false,
|
|
118945
|
+
isObject: false
|
|
118931
118946
|
}), NO_STATE_INHERIT),
|
|
118932
118947
|
|
|
118933
118948
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118942,7 +118957,8 @@ class Control {
|
|
|
118942
118957
|
pickable: false,
|
|
118943
118958
|
collidable: true,
|
|
118944
118959
|
clippable: false,
|
|
118945
|
-
visible: false
|
|
118960
|
+
visible: false,
|
|
118961
|
+
isObject: false
|
|
118946
118962
|
}), NO_STATE_INHERIT),
|
|
118947
118963
|
|
|
118948
118964
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118960,7 +118976,8 @@ class Control {
|
|
|
118960
118976
|
pickable: false,
|
|
118961
118977
|
collidable: true,
|
|
118962
118978
|
clippable: false,
|
|
118963
|
-
visible: false
|
|
118979
|
+
visible: false,
|
|
118980
|
+
isObject: false
|
|
118964
118981
|
}), NO_STATE_INHERIT),
|
|
118965
118982
|
|
|
118966
118983
|
xAxisArrowHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118974,7 +118991,8 @@ class Control {
|
|
|
118974
118991
|
pickable: true,
|
|
118975
118992
|
collidable: true,
|
|
118976
118993
|
clippable: false,
|
|
118977
|
-
visible: false
|
|
118994
|
+
visible: false,
|
|
118995
|
+
isObject: false
|
|
118978
118996
|
}), NO_STATE_INHERIT),
|
|
118979
118997
|
|
|
118980
118998
|
xAxis: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118988,7 +119006,8 @@ class Control {
|
|
|
118988
119006
|
pickable: false,
|
|
118989
119007
|
collidable: true,
|
|
118990
119008
|
clippable: false,
|
|
118991
|
-
visible: false
|
|
119009
|
+
visible: false,
|
|
119010
|
+
isObject: false
|
|
118992
119011
|
}), NO_STATE_INHERIT),
|
|
118993
119012
|
|
|
118994
119013
|
xAxisHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119002,7 +119021,8 @@ class Control {
|
|
|
119002
119021
|
pickable: true,
|
|
119003
119022
|
collidable: true,
|
|
119004
119023
|
clippable: false,
|
|
119005
|
-
visible: false
|
|
119024
|
+
visible: false,
|
|
119025
|
+
isObject: false
|
|
119006
119026
|
}), NO_STATE_INHERIT),
|
|
119007
119027
|
|
|
119008
119028
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -119020,7 +119040,8 @@ class Control {
|
|
|
119020
119040
|
pickable: false,
|
|
119021
119041
|
collidable: true,
|
|
119022
119042
|
clippable: false,
|
|
119023
|
-
visible: false
|
|
119043
|
+
visible: false,
|
|
119044
|
+
isObject: false
|
|
119024
119045
|
}), NO_STATE_INHERIT),
|
|
119025
119046
|
|
|
119026
119047
|
yAxisArrowHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119035,7 +119056,8 @@ class Control {
|
|
|
119035
119056
|
collidable: true,
|
|
119036
119057
|
clippable: false,
|
|
119037
119058
|
visible: false,
|
|
119038
|
-
opacity: 0.2
|
|
119059
|
+
opacity: 0.2,
|
|
119060
|
+
isObject: false
|
|
119039
119061
|
}), NO_STATE_INHERIT),
|
|
119040
119062
|
|
|
119041
119063
|
yShaft: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119045,7 +119067,8 @@ class Control {
|
|
|
119045
119067
|
pickable: false,
|
|
119046
119068
|
collidable: true,
|
|
119047
119069
|
clippable: false,
|
|
119048
|
-
visible: false
|
|
119070
|
+
visible: false,
|
|
119071
|
+
isObject: false
|
|
119049
119072
|
}), NO_STATE_INHERIT),
|
|
119050
119073
|
|
|
119051
119074
|
yShaftHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119055,7 +119078,8 @@ class Control {
|
|
|
119055
119078
|
pickable: true,
|
|
119056
119079
|
collidable: true,
|
|
119057
119080
|
clippable: false,
|
|
119058
|
-
visible: false
|
|
119081
|
+
visible: false,
|
|
119082
|
+
isObject: false
|
|
119059
119083
|
}), NO_STATE_INHERIT),
|
|
119060
119084
|
|
|
119061
119085
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -119073,7 +119097,8 @@ class Control {
|
|
|
119073
119097
|
pickable: false,
|
|
119074
119098
|
collidable: true,
|
|
119075
119099
|
clippable: false,
|
|
119076
|
-
visible: false
|
|
119100
|
+
visible: false,
|
|
119101
|
+
isObject: false
|
|
119077
119102
|
}), NO_STATE_INHERIT),
|
|
119078
119103
|
|
|
119079
119104
|
zAxisArrowHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119087,7 +119112,8 @@ class Control {
|
|
|
119087
119112
|
pickable: true,
|
|
119088
119113
|
collidable: true,
|
|
119089
119114
|
clippable: false,
|
|
119090
|
-
visible: false
|
|
119115
|
+
visible: false,
|
|
119116
|
+
isObject: false
|
|
119091
119117
|
}), NO_STATE_INHERIT),
|
|
119092
119118
|
|
|
119093
119119
|
|
|
@@ -119102,7 +119128,8 @@ class Control {
|
|
|
119102
119128
|
clippable: false,
|
|
119103
119129
|
pickable: false,
|
|
119104
119130
|
collidable: true,
|
|
119105
|
-
visible: false
|
|
119131
|
+
visible: false,
|
|
119132
|
+
isObject: false
|
|
119106
119133
|
}), NO_STATE_INHERIT),
|
|
119107
119134
|
|
|
119108
119135
|
zAxisHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119116,7 +119143,8 @@ class Control {
|
|
|
119116
119143
|
clippable: false,
|
|
119117
119144
|
pickable: true,
|
|
119118
119145
|
collidable: true,
|
|
119119
|
-
visible: false
|
|
119146
|
+
visible: false,
|
|
119147
|
+
isObject: false
|
|
119120
119148
|
}), NO_STATE_INHERIT)
|
|
119121
119149
|
};
|
|
119122
119150
|
|
|
@@ -119148,7 +119176,8 @@ class Control {
|
|
|
119148
119176
|
clippable: false,
|
|
119149
119177
|
visible: false,
|
|
119150
119178
|
scale: [1, 1, 1],
|
|
119151
|
-
rotation: [0, 0, 45]
|
|
119179
|
+
rotation: [0, 0, 45],
|
|
119180
|
+
isObject: false
|
|
119152
119181
|
}), NO_STATE_INHERIT),
|
|
119153
119182
|
|
|
119154
119183
|
xHoop: rootNode.addChild(new Mesh(rootNode, { // Full
|
|
@@ -119164,7 +119193,8 @@ class Control {
|
|
|
119164
119193
|
pickable: false,
|
|
119165
119194
|
collidable: true,
|
|
119166
119195
|
clippable: false,
|
|
119167
|
-
visible: false
|
|
119196
|
+
visible: false,
|
|
119197
|
+
isObject: false
|
|
119168
119198
|
}), NO_STATE_INHERIT),
|
|
119169
119199
|
|
|
119170
119200
|
yHoop: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119176,7 +119206,8 @@ class Control {
|
|
|
119176
119206
|
pickable: false,
|
|
119177
119207
|
collidable: true,
|
|
119178
119208
|
clippable: false,
|
|
119179
|
-
visible: false
|
|
119209
|
+
visible: false,
|
|
119210
|
+
isObject: false
|
|
119180
119211
|
}), NO_STATE_INHERIT),
|
|
119181
119212
|
|
|
119182
119213
|
zHoop: rootNode.addChild(new Mesh(rootNode, { // Blue hoop about Z-axis
|
|
@@ -119189,7 +119220,8 @@ class Control {
|
|
|
119189
119220
|
collidable: true,
|
|
119190
119221
|
clippable: false,
|
|
119191
119222
|
backfaces: true,
|
|
119192
|
-
visible: false
|
|
119223
|
+
visible: false,
|
|
119224
|
+
isObject: false
|
|
119193
119225
|
}), NO_STATE_INHERIT),
|
|
119194
119226
|
|
|
119195
119227
|
xAxisArrow: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119203,7 +119235,8 @@ class Control {
|
|
|
119203
119235
|
pickable: false,
|
|
119204
119236
|
collidable: true,
|
|
119205
119237
|
clippable: false,
|
|
119206
|
-
visible: false
|
|
119238
|
+
visible: false,
|
|
119239
|
+
isObject: false
|
|
119207
119240
|
}), NO_STATE_INHERIT),
|
|
119208
119241
|
|
|
119209
119242
|
yAxisArrow: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119217,7 +119250,8 @@ class Control {
|
|
|
119217
119250
|
pickable: false,
|
|
119218
119251
|
collidable: true,
|
|
119219
119252
|
clippable: false,
|
|
119220
|
-
visible: false
|
|
119253
|
+
visible: false,
|
|
119254
|
+
isObject: false
|
|
119221
119255
|
}), NO_STATE_INHERIT),
|
|
119222
119256
|
|
|
119223
119257
|
zAxisArrow: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119231,7 +119265,8 @@ class Control {
|
|
|
119231
119265
|
pickable: false,
|
|
119232
119266
|
collidable: true,
|
|
119233
119267
|
clippable: false,
|
|
119234
|
-
visible: false
|
|
119268
|
+
visible: false,
|
|
119269
|
+
isObject: false
|
|
119235
119270
|
}), NO_STATE_INHERIT)
|
|
119236
119271
|
};
|
|
119237
119272
|
}
|
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -3236,7 +3236,7 @@ _this19._initMarkerDiv();_this19._onMouseHoverSurface=null;_this19._onHoverNothi
|
|
|
3236
3236
|
* start, corner or end point will cause the point to snap to the nearest vertex or edge. A quick
|
|
3237
3237
|
* touch-release will immediately set the point at the tapped position on the object surface.
|
|
3238
3238
|
*
|
|
3239
|
-
* [[Run example](/examples/measurement/#angle_createWithTouch_snapping)]
|
|
3239
|
+
* [[Run example](https://xeokit.github.io/xeokit-sdk/examples/measurement/#angle_createWithTouch_snapping)]
|
|
3240
3240
|
*
|
|
3241
3241
|
* ````javascript
|
|
3242
3242
|
* import {Viewer, XKTLoaderPlugin, AngleMeasurementsPlugin, AngleMeasurementsTouchControl} from "xeokit-sdk.es.js";
|
|
@@ -19645,7 +19645,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
19645
19645
|
* start or end point will cause the point to snap to the nearest vertex or edge. A quick
|
|
19646
19646
|
* touch-release will immediately set the point at the tapped position on the object surface.
|
|
19647
19647
|
*
|
|
19648
|
-
* [[Run example](/examples/measurement/#distance_createWithTouch_snapping)]
|
|
19648
|
+
* [[Run example](https://xeokit.github.io/xeokit-sdk/examples/measurement/#distance_createWithTouch_snapping)]
|
|
19649
19649
|
*
|
|
19650
19650
|
* ````javascript
|
|
19651
19651
|
* import {Viewer, XKTLoaderPlugin, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl} from "xeokit-sdk.es.js";
|
|
@@ -25169,7 +25169,7 @@ this._ignoreNextSectionPlaneDirUpdate=false;this._createNodes();this._bindEvents
|
|
|
25169
25169
|
*/},{key:"setCulled",value:function setCulled(culled){var id;for(id in this._displayMeshes){if(this._displayMeshes.hasOwnProperty(id)){this._displayMeshes[id].culled=culled;}}if(!culled){for(id in this._affordanceMeshes){if(this._affordanceMeshes.hasOwnProperty(id)){this._affordanceMeshes[id].culled=culled;}}}}/**
|
|
25170
25170
|
* Builds the Entities that represent this Control.
|
|
25171
25171
|
* @private
|
|
25172
|
-
*/},{key:"_createNodes",value:function _createNodes(){var NO_STATE_INHERIT=false;var scene=this._viewer.scene;var radius=1.0;var handleTubeRadius=0.06;var hoopRadius=radius-0.2;var tubeRadius=0.01;var arrowRadius=0.07;this._rootNode=new Node$2(scene,{position:[0,0,0],scale:[5,5,5]});var rootNode=this._rootNode;var shapes={// Reusable geometries
|
|
25172
|
+
*/},{key:"_createNodes",value:function _createNodes(){var NO_STATE_INHERIT=false;var scene=this._viewer.scene;var radius=1.0;var handleTubeRadius=0.06;var hoopRadius=radius-0.2;var tubeRadius=0.01;var arrowRadius=0.07;this._rootNode=new Node$2(scene,{position:[0,0,0],scale:[5,5,5],isObject:false});var rootNode=this._rootNode;var shapes={// Reusable geometries
|
|
25173
25173
|
arrowHead:new ReadableGeometry(rootNode,buildCylinderGeometry({radiusTop:0.001,radiusBottom:arrowRadius,radialSegments:32,heightSegments:1,height:0.2,openEnded:false})),arrowHeadBig:new ReadableGeometry(rootNode,buildCylinderGeometry({radiusTop:0.001,radiusBottom:0.09,radialSegments:32,heightSegments:1,height:0.25,openEnded:false})),arrowHeadHandle:new ReadableGeometry(rootNode,buildCylinderGeometry({radiusTop:0.09,radiusBottom:0.09,radialSegments:8,heightSegments:1,height:0.37,openEnded:false})),curve:new ReadableGeometry(rootNode,buildTorusGeometry({radius:hoopRadius,tube:tubeRadius,radialSegments:64,tubeSegments:14,arc:Math.PI*2.0/4.0})),curveHandle:new ReadableGeometry(rootNode,buildTorusGeometry({radius:hoopRadius,tube:handleTubeRadius,radialSegments:64,tubeSegments:14,arc:Math.PI*2.0/4.0})),hoop:new ReadableGeometry(rootNode,buildTorusGeometry({radius:hoopRadius,tube:tubeRadius,radialSegments:64,tubeSegments:8,arc:Math.PI*2.0})),axis:new ReadableGeometry(rootNode,buildCylinderGeometry({radiusTop:tubeRadius,radiusBottom:tubeRadius,radialSegments:20,heightSegments:1,height:radius,openEnded:false})),axisHandle:new ReadableGeometry(rootNode,buildCylinderGeometry({radiusTop:0.08,radiusBottom:0.08,radialSegments:20,heightSegments:1,height:radius,openEnded:false}))};var materials={// Reusable materials
|
|
25174
25174
|
pickable:new PhongMaterial(rootNode,{// Invisible material for pickable handles, which define a pickable 3D area
|
|
25175
25175
|
diffuse:[1,1,0],alpha:0,// Invisible
|
|
@@ -25180,35 +25180,35 @@ edges:false,fill:true,fillColor:[0,0,1],fillAlpha:0.2}),center:new PhongMaterial
|
|
|
25180
25180
|
-0.5,-0.5,0.0,-0.5,0.5,0.0,// 1
|
|
25181
25181
|
0.5,0.5,-0.0,0.5,-0.5,-0.0,// 2
|
|
25182
25182
|
-0.5,-0.5,-0.0,-0.5,0.5,-0.0// 3
|
|
25183
|
-
],indices:[0,1,2,2,3,0]}),material:new PhongMaterial(rootNode,{emissive:[0,0.0,0],diffuse:[0,0,0],backfaces:true}),opacity:0.6,ghosted:true,ghostMaterial:new EmphasisMaterial(rootNode,{edges:false,filled:true,fillColor:[1,1,0],edgeColor:[0,0,0],fillAlpha:0.1,backfaces:true}),pickable:false,collidable:true,clippable:false,visible:false,scale:[2.4,2.4,1]}),NO_STATE_INHERIT),planeFrame:rootNode.addChild(new Mesh(rootNode,{// Visible frame
|
|
25183
|
+
],indices:[0,1,2,2,3,0]}),material:new PhongMaterial(rootNode,{emissive:[0,0.0,0],diffuse:[0,0,0],backfaces:true}),opacity:0.6,ghosted:true,ghostMaterial:new EmphasisMaterial(rootNode,{edges:false,filled:true,fillColor:[1,1,0],edgeColor:[0,0,0],fillAlpha:0.1,backfaces:true}),pickable:false,collidable:true,clippable:false,visible:false,scale:[2.4,2.4,1],isObject:false}),NO_STATE_INHERIT),planeFrame:rootNode.addChild(new Mesh(rootNode,{// Visible frame
|
|
25184
25184
|
geometry:new ReadableGeometry(rootNode,buildTorusGeometry({center:[0,0,0],radius:1.7,tube:tubeRadius*2,radialSegments:4,tubeSegments:4,arc:Math.PI*2.0})),material:new PhongMaterial(rootNode,{emissive:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],shininess:0}),//highlighted: true,
|
|
25185
|
-
highlightMaterial:new EmphasisMaterial(rootNode,{edges:false,edgeColor:[0.0,0.0,0.0],filled:true,fillColor:[0.8,0.8,0.8],fillAlpha:1.0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,.1],rotation:[0,0,45]}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25185
|
+
highlightMaterial:new EmphasisMaterial(rootNode,{edges:false,edgeColor:[0.0,0.0,0.0],filled:true,fillColor:[0.8,0.8,0.8],fillAlpha:1.0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,.1],rotation:[0,0,45],isObject:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25186
25186
|
//
|
|
25187
25187
|
//----------------------------------------------------------------------------------------------------------
|
|
25188
25188
|
xCurve:rootNode.addChild(new Mesh(rootNode,{// Red hoop about Y-axis
|
|
25189
|
-
geometry:shapes.curve,material:materials.red,matrix:function(){var rotate2=math.rotationMat4v(90*math.DEGTORAD,[0,1,0],math.identityMat4());var rotate1=math.rotationMat4v(270*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate1,rotate2,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,backfaces:true,visible:false}),NO_STATE_INHERIT),xCurveHandle:rootNode.addChild(new Mesh(rootNode,{// Red hoop about Y-axis
|
|
25190
|
-
geometry:shapes.curveHandle,material:materials.pickable,matrix:function(){var rotate2=math.rotationMat4v(90*math.DEGTORAD,[0,1,0],math.identityMat4());var rotate1=math.rotationMat4v(270*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate1,rotate2,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,backfaces:true,visible:false}),NO_STATE_INHERIT),xCurveArrow1:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.red,matrix:function(){var translate=math.translateMat4c(0.,-0.07,-0.8,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(0*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),xCurveArrow2:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.red,matrix:function(){var translate=math.translateMat4c(0.0,-0.8,-0.07,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25189
|
+
geometry:shapes.curve,material:materials.red,matrix:function(){var rotate2=math.rotationMat4v(90*math.DEGTORAD,[0,1,0],math.identityMat4());var rotate1=math.rotationMat4v(270*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate1,rotate2,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,backfaces:true,visible:false,isObject:false}),NO_STATE_INHERIT),xCurveHandle:rootNode.addChild(new Mesh(rootNode,{// Red hoop about Y-axis
|
|
25190
|
+
geometry:shapes.curveHandle,material:materials.pickable,matrix:function(){var rotate2=math.rotationMat4v(90*math.DEGTORAD,[0,1,0],math.identityMat4());var rotate1=math.rotationMat4v(270*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate1,rotate2,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,backfaces:true,visible:false,isObject:false}),NO_STATE_INHERIT),xCurveArrow1:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.red,matrix:function(){var translate=math.translateMat4c(0.,-0.07,-0.8,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(0*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),xCurveArrow2:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.red,matrix:function(){var translate=math.translateMat4c(0.0,-0.8,-0.07,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25191
25191
|
//
|
|
25192
25192
|
//----------------------------------------------------------------------------------------------------------
|
|
25193
|
-
yCurve:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.curve,material:materials.green,rotation:[-90,0,0],pickable:false,collidable:true,clippable:false,backfaces:true,visible:false}),NO_STATE_INHERIT),yCurveHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.curveHandle,material:materials.pickable,rotation:[-90,0,0],pickable:true,collidable:true,clippable:false,backfaces:true,visible:false}),NO_STATE_INHERIT),yCurveArrow1:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.green,matrix:function(){var translate=math.translateMat4c(0.07,0,-0.8,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),yCurveArrow2:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.green,matrix:function(){var translate=math.translateMat4c(0.8,0.0,-0.07,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25193
|
+
yCurve:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.curve,material:materials.green,rotation:[-90,0,0],pickable:false,collidable:true,clippable:false,backfaces:true,visible:false,isObject:false}),NO_STATE_INHERIT),yCurveHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.curveHandle,material:materials.pickable,rotation:[-90,0,0],pickable:true,collidable:true,clippable:false,backfaces:true,visible:false,isObject:false}),NO_STATE_INHERIT),yCurveArrow1:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.green,matrix:function(){var translate=math.translateMat4c(0.07,0,-0.8,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),yCurveArrow2:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.green,matrix:function(){var translate=math.translateMat4c(0.8,0.0,-0.07,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25194
25194
|
//
|
|
25195
25195
|
//----------------------------------------------------------------------------------------------------------
|
|
25196
25196
|
zCurve:rootNode.addChild(new Mesh(rootNode,{// Blue hoop about Z-axis
|
|
25197
|
-
geometry:shapes.curve,material:materials.blue,matrix:math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4()),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zCurveHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.curveHandle,material:materials.pickable,matrix:math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4()),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zCurveCurveArrow1:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.blue,matrix:function(){var translate=math.translateMat4c(.8,-0.07,0,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());return math.mulMat4(translate,scale,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zCurveArrow2:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.blue,matrix:function(){var translate=math.translateMat4c(.05,-0.8,0,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25197
|
+
geometry:shapes.curve,material:materials.blue,matrix:math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4()),pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),zCurveHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.curveHandle,material:materials.pickable,matrix:math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4()),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),zCurveCurveArrow1:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.blue,matrix:function(){var translate=math.translateMat4c(.8,-0.07,0,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());return math.mulMat4(translate,scale,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),zCurveArrow2:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.blue,matrix:function(){var translate=math.translateMat4c(.05,-0.8,0,math.identityMat4());var scale=math.scaleMat4v([0.6,0.6,0.6],math.identityMat4());var rotate=math.rotationMat4v(90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(math.mulMat4(translate,scale,math.identityMat4()),rotate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25198
25198
|
//
|
|
25199
25199
|
//----------------------------------------------------------------------------------------------------------
|
|
25200
|
-
center:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildSphereGeometry({radius:0.05})),material:materials.center,pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25200
|
+
center:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildSphereGeometry({radius:0.05})),material:materials.center,pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25201
25201
|
//
|
|
25202
25202
|
//----------------------------------------------------------------------------------------------------------
|
|
25203
|
-
xAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.red,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),xAxisArrowHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),xAxis:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axis,material:materials.red,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),xAxisHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axisHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25203
|
+
xAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.red,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),xAxisArrowHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),xAxis:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axis,material:materials.red,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),xAxisHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axisHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25204
25204
|
//
|
|
25205
25205
|
//----------------------------------------------------------------------------------------------------------
|
|
25206
|
-
yAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.green,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),yAxisArrowHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,opacity:0.2}),NO_STATE_INHERIT),yShaft:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axis,material:materials.green,position:[0,-radius/2,0],pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),yShaftHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axisHandle,material:materials.pickable,position:[0,-radius/2,0],pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25206
|
+
yAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.green,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),yAxisArrowHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,opacity:0.2,isObject:false}),NO_STATE_INHERIT),yShaft:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axis,material:materials.green,position:[0,-radius/2,0],pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),yShaftHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axisHandle,material:materials.pickable,position:[0,-radius/2,0],pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),//----------------------------------------------------------------------------------------------------------
|
|
25207
25207
|
//
|
|
25208
25208
|
//----------------------------------------------------------------------------------------------------------
|
|
25209
|
-
zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zAxisArrowHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zShaft:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axis,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),clippable:false,pickable:false,collidable:true,visible:false}),NO_STATE_INHERIT),zAxisHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axisHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),clippable:false,pickable:true,collidable:true,visible:false}),NO_STATE_INHERIT)};this._affordanceMeshes={planeFrame:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildTorusGeometry({center:[0,0,0],radius:2,tube:tubeRadius,radialSegments:4,tubeSegments:4,arc:Math.PI*2.0})),material:new PhongMaterial(rootNode,{ambient:[1,1,1],diffuse:[0,0,0],emissive:[1,1,0]}),highlighted:true,highlightMaterial:new EmphasisMaterial(rootNode,{edges:false,filled:true,fillColor:[1,1,0],fillAlpha:1.0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,1],rotation:[0,0,45]}),NO_STATE_INHERIT),xHoop:rootNode.addChild(new Mesh(rootNode,{// Full
|
|
25210
|
-
geometry:shapes.hoop,material:materials.red,highlighted:true,highlightMaterial:materials.highlightRed,matrix:function(){var rotate2=math.rotationMat4v(90*math.DEGTORAD,[0,1,0],math.identityMat4());var rotate1=math.rotationMat4v(270*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate1,rotate2,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),yHoop:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.hoop,material:materials.green,highlighted:true,highlightMaterial:materials.highlightGreen,rotation:[-90,0,0],pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zHoop:rootNode.addChild(new Mesh(rootNode,{// Blue hoop about Z-axis
|
|
25211
|
-
geometry:shapes.hoop,material:materials.blue,highlighted:true,highlightMaterial:materials.highlightBlue,matrix:math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4()),pickable:false,collidable:true,clippable:false,backfaces:true,visible:false}),NO_STATE_INHERIT),xAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadBig,material:materials.red,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),yAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadBig,material:materials.green,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadBig,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT)};}},{key:"_bindEvents",value:function _bindEvents(){var _this133=this;var self=this;var grabbed=false;var DRAG_ACTIONS={none:-1,xTranslate:0,yTranslate:1,zTranslate:2,xRotate:3,yRotate:4,zRotate:5};var rootNode=this._rootNode;var nextDragAction=null;// As we hover grabbed an arrow or hoop, self is the action we would do if we then dragged it.
|
|
25209
|
+
zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),zAxisArrowHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:true,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),zShaft:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axis,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),clippable:false,pickable:false,collidable:true,visible:false,isObject:false}),NO_STATE_INHERIT),zAxisHandle:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axisHandle,material:materials.pickable,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),clippable:false,pickable:true,collidable:true,visible:false,isObject:false}),NO_STATE_INHERIT)};this._affordanceMeshes={planeFrame:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildTorusGeometry({center:[0,0,0],radius:2,tube:tubeRadius,radialSegments:4,tubeSegments:4,arc:Math.PI*2.0})),material:new PhongMaterial(rootNode,{ambient:[1,1,1],diffuse:[0,0,0],emissive:[1,1,0]}),highlighted:true,highlightMaterial:new EmphasisMaterial(rootNode,{edges:false,filled:true,fillColor:[1,1,0],fillAlpha:1.0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,1],rotation:[0,0,45],isObject:false}),NO_STATE_INHERIT),xHoop:rootNode.addChild(new Mesh(rootNode,{// Full
|
|
25210
|
+
geometry:shapes.hoop,material:materials.red,highlighted:true,highlightMaterial:materials.highlightRed,matrix:function(){var rotate2=math.rotationMat4v(90*math.DEGTORAD,[0,1,0],math.identityMat4());var rotate1=math.rotationMat4v(270*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate1,rotate2,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),yHoop:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.hoop,material:materials.green,highlighted:true,highlightMaterial:materials.highlightGreen,rotation:[-90,0,0],pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),zHoop:rootNode.addChild(new Mesh(rootNode,{// Blue hoop about Z-axis
|
|
25211
|
+
geometry:shapes.hoop,material:materials.blue,highlighted:true,highlightMaterial:materials.highlightBlue,matrix:math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4()),pickable:false,collidable:true,clippable:false,backfaces:true,visible:false,isObject:false}),NO_STATE_INHERIT),xAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadBig,material:materials.red,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0,0,1],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),yAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadBig,material:materials.green,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(180*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT),zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadBig,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false,isObject:false}),NO_STATE_INHERIT)};}},{key:"_bindEvents",value:function _bindEvents(){var _this133=this;var self=this;var grabbed=false;var DRAG_ACTIONS={none:-1,xTranslate:0,yTranslate:1,zTranslate:2,xRotate:3,yRotate:4,zRotate:5};var rootNode=this._rootNode;var nextDragAction=null;// As we hover grabbed an arrow or hoop, self is the action we would do if we then dragged it.
|
|
25212
25212
|
var dragAction=null;// Action we're doing while we drag an arrow or hoop.
|
|
25213
25213
|
var lastCanvasPos=math.vec2();var xBaseAxis=math.vec3([1,0,0]);var yBaseAxis=math.vec3([0,1,0]);var zBaseAxis=math.vec3([0,0,1]);var canvas=this._viewer.scene.canvas.canvas;var camera=this._viewer.camera;var scene=this._viewer.scene;{// Keep gizmo screen size constant
|
|
25214
25214
|
var _tempVec3a=math.vec3([0,0,0]);var lastDist=-1;this._onCameraViewMatrix=scene.camera.on("viewMatrix",function(){});this._onCameraProjMatrix=scene.camera.on("projMatrix",function(){});this._onSceneTick=scene.on("tick",function(){var dist=Math.abs(math.lenVec3(math.subVec3(scene.camera.eye,_this133._pos,_tempVec3a)));if(dist!==lastDist){if(camera.projection==="perspective"){var worldSize=Math.tan(camera.perspective.fov*math.DEGTORAD)*dist;var size=0.07*worldSize;rootNode.scale=[size,size,size];lastDist=dist;}}if(camera.projection==="ortho"){var _worldSize=camera.ortho.scale/10;var _size=_worldSize;rootNode.scale=[_size,_size,_size];lastDist=dist;}});}var getClickCoordsWithinElement=function(){var canvasPos=new Float64Array(2);return function(event){if(!event){event=window.event;canvasPos[0]=event.x;canvasPos[1]=event.y;}else{var element=event.target;var totalOffsetLeft=0;var totalOffsetTop=0;while(element.offsetParent){totalOffsetLeft+=element.offsetLeft;totalOffsetTop+=element.offsetTop;element=element.offsetParent;}canvasPos[0]=event.pageX-totalOffsetLeft;canvasPos[1]=event.pageY-totalOffsetTop;}return canvasPos;};}();var localToWorldVec=function(){var mat=math.mat4();return function(localVec,worldVec){math.quaternionToMat4(self._rootNode.quaternion,mat);math.transformVec3(mat,localVec,worldVec);math.normalizeVec3(worldVec);return worldVec;};}();var getTranslationPlane=function(){var planeNormal=math.vec3();return function(worldAxis){var absX=Math.abs(worldAxis[0]);if(absX>Math.abs(worldAxis[1])&&absX>Math.abs(worldAxis[2])){math.cross3Vec3(worldAxis,[0,1,0],planeNormal);}else{math.cross3Vec3(worldAxis,[1,0,0],planeNormal);}math.cross3Vec3(planeNormal,worldAxis,planeNormal);math.normalizeVec3(planeNormal);return planeNormal;};}();var dragTranslateSectionPlane=function(){var p1=math.vec3();var p2=math.vec3();var worldAxis=math.vec4();return function(baseAxis,fromMouse,toMouse){localToWorldVec(baseAxis,worldAxis);var planeNormal=getTranslationPlane(worldAxis,fromMouse,toMouse);getPointerPlaneIntersect(fromMouse,planeNormal,p1);getPointerPlaneIntersect(toMouse,planeNormal,p2);math.subVec3(p2,p1);var dot=math.dotVec3(p2,worldAxis);self._pos[0]+=worldAxis[0]*dot;self._pos[1]+=worldAxis[1]*dot;self._pos[2]+=worldAxis[2]*dot;self._rootNode.position=self._pos;if(self._sectionPlane){self._sectionPlane.pos=self._pos;}};}();var dragRotateSectionPlane=function(){var p1=math.vec4();var p2=math.vec4();var c=math.vec4();var worldAxis=math.vec4();return function(baseAxis,fromMouse,toMouse){localToWorldVec(baseAxis,worldAxis);var hasData=getPointerPlaneIntersect(fromMouse,worldAxis,p1)&&getPointerPlaneIntersect(toMouse,worldAxis,p2);if(!hasData){// Find intersections with view plane and project down to origin
|