forked from block-forest/threejs-dart-facade
-
Notifications
You must be signed in to change notification settings - Fork 1
/
three.dart
5438 lines (4736 loc) · 166 KB
/
three.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@JS('THREE')
library threejs_facade;
// import "package:func/func.dart";
// import "package:function_types/function_types.dart";
import 'package:js/js.dart';
import 'dart:html';
import 'dart:web_audio' show AudioContext;
// import 'dart:typed_data';
// import 'package:meta/meta.dart';
typedef R Func0<R>();
typedef R Func1<T1, R>(T1 t1);
typedef R Func2<T1, T2, R>(T1 t1, T2 t2);
typedef void VoidFunc0();
typedef void VoidFunc1<T1>(T1 t1);
typedef void VoidFunc2<T1, T2>(T1 t1, T2 t2);
typedef void VoidFunc3<T1, T2, T3>(T1 t1, T2 t2, T3 t3);
external int get REVISION;
enum MOUSE { LEFT, MIDDLE, RIGHT }
// enum int /*CullFace*/ { dummy }
external int get CullFaceNone;
external int get CullFaceBack;
external int get CullFaceFront;
external int get CullFaceFrontBack;
// enum int /*FrontFaceDirection*/ { dummy }
external int get FrontFaceDirectionCW;
external int get FrontFaceDirectionCCW;
// enum int /*ShadowMapType*/ { dummy }
external int get BasicShadowMap;
external int get PCFShadowMap;
external int get PCFSoftShadowMap;
// enum int /*Side*/ { dummy }
external int get FrontSide;
external int get BackSide;
external int get DoubleSide;
// enum int /*Shading*/ { dummy }
external int get NoShading;
external int get FlatShading;
external int get SmoothShading;
// enum int /*Colors*/ { dummy }
external int get NoColors;
external int get FaceColors;
external int get VertexColors;
// enum int /*Blending*/ { dummy }
external int get NoBlending;
external int get NormalBlending;
external int get AdditiveBlending;
external int get SubtractiveBlending;
external int get MultiplyBlending;
external int get CustomBlending;
// enum int /*BlendingEquation*/ { dummy }
external int get AddEquation;
external int get SubtractEquation;
external int get ReverseSubtractEquation;
external int get MinEquation;
external int get MaxEquation;
// enum int /*BlendingDstFactor*/ { dummy }
external int get ZeroFactor;
external int get OneFactor;
external int get SrcColorFactor;
external int get OneMinusSrcColorFactor;
external int get SrcAlphaFactor;
external int get OneMinusSrcAlphaFactor;
external int get DstAlphaFactor;
external int get OneMinusDstAlphaFactor;
// enum int /*BlendingSrcFactor*/ { dummy }
external int get DstColorFactor;
external int get OneMinusDstColorFactor;
external int get SrcAlphaSaturateFactor;
// enum int /*DepthModes*/ { dummy }
external int get NeverDepth;
external int get AlwaysDepth;
external int get LessDepth;
external int get LessEqualDepth;
external int get EqualDepth;
external int get GreaterEqualDepth;
external int get GreaterDepth;
external int get NotEqualDepth;
// enum int /*Combine*/ { dummy }
external int get MultiplyOperation;
external int get MixOperation;
external int get AddOperation;
// enum int /*Mapping*/ { dummy }
external int get UVMapping;
external int get CubeReflectionMapping;
external int get CubeRefractionMapping;
external int get EquirectangularReflectionMapping;
external int get EquirectangularRefractionMapping;
external int get SphericalReflectionMapping;
// enum int /*Wrapping*/ { dummy }
external int get RepeatWrapping;
external int get ClampToEdgeWrapping;
external int get MirroredRepeatWrapping;
// enum int /*TextureFilter*/ { dummy }
external int get NearestFilter;
external int get NearestMipMapNearestFilter;
external int get NearestMipMapLinearFilter;
external int get LinearFilter;
external int get LinearMipMapNearestFilter;
external int get LinearMipMapLinearFilter;
// enum int /*TextureDataType*/ { dummy }
external int get UnsignedByteType;
external int get ByteType;
external int get ShortType;
external int get UnsignedShortType;
external int get IntType;
external int get UnsignedIntType;
external int get FloatType;
external int get HalfFloatType;
// enum int /*PixelType*/ { dummy }
external int get UnsignedShort4444Type;
external int get UnsignedShort5551Type;
external int get UnsignedShort565Type;
// enum int /*PixelFormat*/ { dummy }
external int get AlphaFormat;
external int get RGBFormat;
external int get RGBAFormat;
external int get LuminanceFormat;
external int get LuminanceAlphaFormat;
external int get RGBEFormat;
// enum CompressedPixelFormat { dummy }
external int get RGB_S3TC_DXT1_Format;
external int get RGBA_S3TC_DXT1_Format;
external int get RGBA_S3TC_DXT3_Format;
external int get RGBA_S3TC_DXT5_Format;
external int get RGB_PVRTC_4BPPV1_Format;
external int get RGB_PVRTC_2BPPV1_Format;
external int get RGBA_PVRTC_4BPPV1_Format;
external int get RGBA_PVRTC_2BPPV1_Format;
// enum AnimationActionLoopStyles { dummy }
external int get LoopOnce;
external int get LoopRepeat;
external int get LoopPingPong;
//void export function warn(dynamic message , ...List<dynamic> optionalParams );
//void export function error(dynamic message , ...List<dynamic> optionalParams );
//void export function log(dynamic message , ...List<dynamic> optionalParams );
@JS()
class AnimationAction {
external factory AnimationAction(
[AnimationClip clip,
num startTime,
num timeScale,
num weight,
bool loop]);
external AnimationClip get clip;
external set clip(AnimationClip v);
external Mesh get localRoot;
external set localRoot(Mesh v);
external num get startTime;
external set startTime(num v);
external num get timeScale;
external set timeScale(num v);
external num get weight;
external set weight(num v);
// external AnimationActionLoopStyles get loop;
// external set loop(AnimationActionLoopStyles v);
external num get loopCount;
external set loopCount(num v);
external bool get enabled;
external set enabled(bool v);
external num get actionTime;
external set actionTime(num v);
external num get clipTime;
external set clipTime(num v);
external List<PropertyBinding> get propertyBindings;
external set propertyBindings(List<PropertyBinding> v);
external AnimationAction setLocalRoot(Mesh localRoot);
external num updateTime(num clipDeltaTime);
external AnimationAction syncWith(AnimationAction action);
external AnimationAction warpToDuration(num duration);
external AnimationAction init(num time);
external List<dynamic> update(num clipDeltaTime);
external num getTimeScaleAt(num time);
external num getWeightAt(num time);
}
@JS()
class AnimationClip {
external factory AnimationClip(
[String name, num duration, List<KeyframeTrack> tracks]);
external String get name;
external set name(String v);
external List<KeyframeTrack> get tracks;
external set tracks(List<KeyframeTrack> v);
external num get duration;
external set duration(num v);
external List<dynamic> get results;
external set results(List<dynamic> v);
external List<dynamic> getAt(num clipTime);
external AnimationClip trim();
external AnimationClip optimize();
external static AnimationClip CreateFromMorphTargetSequence(
String name, List<MorphTarget> morphTargetSequence, num fps);
external AnimationClip findByName(AnimationClip clipArray, String name);
external static List<AnimationClip> CreateClipsFromMorphTargetSequences(
List<MorphTarget> morphTargets, num fps);
external AnimationClip parse(dynamic json);
external AnimationClip parseAnimation(
dynamic animation, List<Bone> bones, String nodeName);
}
@JS()
class AnimationMixer {
external factory AnimationMixer([dynamic root]);
external dynamic get root;
external set root(dynamic v);
external num get time;
external set time(num v);
external num get timeScale;
external set timeScale(num v);
external AnimationAction get actions;
external set actions(AnimationAction v);
external dynamic get propertyBindingMap;
external set propertyBindingMap(dynamic v);
external void addAction(AnimationAction action);
external AnimationMixer removeAllActions();
external AnimationMixer removeAction(AnimationAction action);
external AnimationAction findActionByName(String name);
external AnimationMixer play(
AnimationAction action, num optionalFadeInDuration);
external AnimationMixer fadeOut(AnimationAction action, num duration);
external AnimationMixer fadeIn(AnimationAction action, num duration);
external AnimationMixer warp(
AnimationAction action,
NumberKeyframeTrack startTimeScale,
NumberKeyframeTrack endTimeScale,
num duration);
external AnimationMixer crossFade(AnimationAction fadeOutAction,
AnimationAction fadeInAction, num duration, bool warp);
external AnimationMixer update(num deltaTime);
}
@JS()
class AnimationUtils {
external factory AnimationUtils();
external bool getEqualsFunc(dynamic exemplarValue);
external dynamic clone(Object3D exemplarValue);
external dynamic lerp(dynamic a, dynamic b, num alpha, bool interTrack);
external dynamic lerp_object(dynamic a, dynamic b, num alpha);
external dynamic slerp_object(dynamic a, dynamic b, num alpha);
external dynamic lerp_num(dynamic a, dynamic b, num alpha);
external dynamic lerp_bool(dynamic a, dynamic b, num alpha);
external dynamic lerp_bool_immediate(dynamic a, dynamic b, num alpha);
external dynamic lerp_String(dynamic a, dynamic b, num alpha);
external dynamic lerp_String_immediate(dynamic a, dynamic b, num alpha);
external Function getLerpFunc(dynamic exemplarValue, bool interTrack);
}
@JS()
class KeyframeTrack {
external factory KeyframeTrack([String name, List<dynamic> keys]);
external String get name;
external set name(String v);
external List<dynamic> get keys;
external set keys(List<dynamic> v);
external num get lastIndex;
external set lastIndex(num v);
external dynamic getAt(num time);
external KeyframeTrack shift(num timeOffset);
external KeyframeTrack scale(num timeScale);
external KeyframeTrack trim(num startTime, num endTime);
external KeyframeTrack validate();
external KeyframeTrack optimize();
external num keyComparator(KeyframeTrack key0, KeyframeTrack key1);
external KeyframeTrack parse(dynamic json);
external dynamic GetTrackTypeForTypeName(String typeName);
}
@JS()
class PropertyBinding {
external factory PropertyBinding([dynamic rootNode, String trackName]);
external dynamic get rootNode;
external set rootNode(dynamic v);
external String get trackName;
external set trackName(String v);
external num get referenceCount;
external set referenceCount(num v);
external dynamic get originalValue;
external set originalValue(dynamic v);
external String get directoryName;
external set directoryName(String v);
external String get nodeName;
external set nodeName(String v);
external String get objectName;
external set objectName(String v);
external num get objectIndex;
external set objectIndex(num v);
external String get propertyName;
external set propertyName(String v);
external num get propertyIndex;
external set propertyIndex(num v);
external dynamic get node;
external set node(dynamic v);
external num get cumulativeValue;
external set cumulativeValue(num v);
external num get cumulativeWeight;
external set cumulativeWeight(num v);
external void reset();
external void accumulate(dynamic value, num weight);
external void unbind();
external void bind();
external void apply();
external dynamic parseTrackName(String trackName);
external dynamic findNode(dynamic root, String nodeName);
}
@JS()
class BooleanKeyframeTrack extends KeyframeTrack {
external factory BooleanKeyframeTrack([String name, List<dynamic> keys]);
external dynamic get result;
external set result(dynamic v);
external void setResult(dynamic value);
external dynamic lerpValues(dynamic value0, dynamic value1, num alpha);
external bool compareValues(dynamic value0, dynamic value1);
external BooleanKeyframeTrack clone();
external BooleanKeyframeTrack parse(dynamic json);
}
@JS()
class NumberKeyframeTrack {
external factory NumberKeyframeTrack();
external dynamic get result;
external set result(dynamic v);
external void setResult(dynamic value);
external dynamic lerpValues(dynamic value0, dynamic value1, num alpha);
external bool compareValues(dynamic value0, dynamic value1);
external NumberKeyframeTrack clone();
external NumberKeyframeTrack parse(dynamic json);
}
@JS()
class QuaternionKeyframeTrack {
external factory QuaternionKeyframeTrack();
external dynamic get result;
external set result(dynamic v);
external void setResult(dynamic value);
external dynamic lerpValues(dynamic value0, dynamic value1, num alpha);
external bool compareValues(dynamic value0, dynamic value1);
external QuaternionKeyframeTrack clone();
external QuaternionKeyframeTrack parse(dynamic json);
}
@JS()
class StringKeyframeTrack {
external factory StringKeyframeTrack();
external dynamic get result;
external set result(dynamic v);
external void setResult(dynamic value);
external dynamic lerpValues(dynamic value0, dynamic value1, num alpha);
external bool compareValues(dynamic value0, dynamic value1);
external StringKeyframeTrack clone();
external StringKeyframeTrack parse(dynamic json);
}
@JS()
class VectorKeyframeTrack {
external factory VectorKeyframeTrack();
external dynamic get result;
external set result(dynamic v);
external void setResult(dynamic value);
external dynamic lerpValues(dynamic value0, dynamic value1, num alpha);
external bool compareValues(dynamic value0, dynamic value1);
external VectorKeyframeTrack clone();
external VectorKeyframeTrack parse(dynamic json);
}
@JS()
class Camera extends Object3D {
external factory Camera();
external Matrix4 get matrixWorldInverse;
external set matrixWorldInverse(Matrix4 v);
external Matrix4 get projectionMatrix;
external set projectionMatrix(Matrix4 v);
external Vector3 getWorldDirection(Vector3 optionalTarget);
external void lookAt(Vector3 vector);
external Camera clone(bool recursive);
external Camera copy(Camera camera, bool recursive);
}
@JS()
class CubeCamera extends Object3D {
external factory CubeCamera([num near, num far, num cubeResolution]);
external WebGLRenderTargetCube get renderTarget;
external set renderTarget(WebGLRenderTargetCube v);
external void updateCubeMap(Renderer renderer, Scene scene);
}
@JS()
class OrthographicCamera extends Camera {
external factory OrthographicCamera(
[num left, num right, num top, num bottom, num near, num far]);
external num get zoom;
external set zoom(num v);
external num get left;
external set left(num v);
external num get right;
external set right(num v);
external num get top;
external set top(num v);
external num get bottom;
external set bottom(num v);
external num get near;
external set near(num v);
external num get far;
external set far(num v);
external void updateProjectionMatrix();
external OrthographicCamera clone(bool recurvise);
external OrthographicCamera copy(OrthographicCamera source, bool recursive);
external dynamic toJSON(dynamic meta);
}
@JS()
class PerspectiveCamera extends Camera {
external factory PerspectiveCamera([num fov, num aspect, num near, num far]);
external num get zoom;
external set zoom(num v);
external num get fov;
external set fov(num v);
external num get aspect;
external set aspect(num v);
external num get near;
external set near(num v);
external num get far;
external set far(num v);
external void setLens(num focalLength, num frameHeight);
external void setViewOffset(
num fullWidth, num fullHeight, num x, num y, num width, num height);
external void updateProjectionMatrix();
external PerspectiveCamera clone(bool recursive);
external PerspectiveCamera copy(PerspectiveCamera source, bool recursive);
external dynamic toJSON(dynamic meta);
}
@JS()
class BufferAttribute {
external factory BufferAttribute([List<num> array, num itemSize]);
external String get uuid;
external set uuid(String v);
external List<num> get array;
external set array(List<num> v);
external num get itemSize;
external set itemSize(num v);
external bool get dynamic;
external set dynamic(bool v);
/* updateRange #num offset , count:num# ; */
external num get version;
external set version(num v);
external bool get needsUpdate;
external set needsUpdate(bool v);
/** Deprecated, use count instead */
external num get length;
external set length(num v);
external num get count;
external set count(num v);
external BufferAttribute setDynamic(bool dynamic);
external BufferAttribute copy(covariant BufferAttribute source);
external BufferAttribute copyAt(
num index1, BufferAttribute attribute, num index2);
external BufferAttribute copyArray(List<num> array);
/* copyColorsArray(colors #num r , num g , b:num# []): external BufferAttribut get e;
external set e(BufferAttribut v); */
/* copyIndicesArray(indices #num a , num b , c:num# []): external BufferAttribut get e;
external set e(BufferAttribut v); */
/* copyVector2sArray(vectors #num x , y:num# []): external BufferAttribut get e;
external set e(BufferAttribut v); */
/* copyVector3sArray(vectors #num x , num y , z:num# []): external BufferAttribut get e;
external set e(BufferAttribut v); */
/* copyVector4sArray(vectors #num x , num y , num z , w:num# []): external BufferAttribut get e;
external set e(BufferAttribut v); */
external BufferAttribute set(List<num> value, num offset);
external num getX(num index);
external BufferAttribute setX(num index, num x);
external num getY(num index);
external BufferAttribute setY(num index, num y);
external num getZ(num index);
external BufferAttribute setZ(num index, num z);
external num getW(num index);
external BufferAttribute setW(num index, num z);
external BufferAttribute setXY(num index, num x, num y);
external BufferAttribute setXYZ(num index, num x, num y, num z);
external BufferAttribute setXYZW(num index, num x, num y, num z, num w);
external onUpload(VoidFunc0 callback);
}
@JS()
class Int8Attribute extends BufferAttribute {
external factory Int8Attribute([dynamic array, num itemSize]);
}
@JS()
class Uint8Attribute extends BufferAttribute {
external factory Uint8Attribute([dynamic array, num itemSize]);
}
@JS()
class Uint8ClampedAttribute extends BufferAttribute {
external factory Uint8ClampedAttribute([dynamic array, num itemSize]);
}
@JS()
class Int16Attribute extends BufferAttribute {
external factory Int16Attribute([dynamic array, num itemSize]);
}
@JS()
class Uint16Attribute extends BufferAttribute {
external factory Uint16Attribute([dynamic array, num itemSize]);
}
@JS()
class Int32Attribute extends BufferAttribute {
external factory Int32Attribute([dynamic array, num itemSize]);
}
@JS()
class Uint32Attribute extends BufferAttribute {
external factory Uint32Attribute([dynamic array, num itemSize]);
}
@JS()
class Float32Attribute extends BufferAttribute {
external factory Float32Attribute([dynamic array, num itemSize]);
}
@JS()
class Float64Attribute extends BufferAttribute {
external factory Float64Attribute([dynamic array, num itemSize]);
}
@JS()
class BufferGeometry extends Geometry {
external factory BufferGeometry();
external static num get MaxIndex;
external num get id;
external set id(num v);
external String get uuid;
external set uuid(String v);
external String get name;
external set name(String v);
external String get type;
external set type(String v);
external BufferAttribute get index;
external set index(BufferAttribute v);
external dynamic get attributes;
external set attributes(dynamic v);
external dynamic get morphAttributes;
external set morphAttributes(dynamic v);
/* groups #num start , num count , materialIndex: num# []; */
external Box3 get boundingBox;
external set boundingBox(Box3 v);
external BoundingSphere get boundingSphere;
external set boundingSphere(BoundingSphere v);
/* drawRange # num start , count: num # ; */
/** Deprecated. */ external void addIndex(BufferAttribute index);
external BufferAttribute getIndex();
external void setIndex(BufferAttribute index);
/** Deprecated. This overloaded method is deprecated. */ external void
addAttribute(String name, dynamic attribute);
external dynamic getAttribute(String name);
external void removeAttribute(String name);
/** Deprecated. */
external Func0<dynamic> get drawcalls;
external set drawcalls(Func0<dynamic> v);
/** Deprecated. */
external Func0<dynamic> get offsets;
external set offsets(Func0<dynamic> v);
/** Deprecated. Use addGroup */ external void addDrawCall(
num start, num count, num index);
/** Deprecated. */ external void clearDrawCalls();
external void addGroup(num start, num count, [num materialIndex]);
external void clearGroups();
external void setDrawRange(num start, num count);
external void applyMatrix(Matrix4 matrix);
external BufferGeometry rotateX(num angle);
external BufferGeometry rotateY(num angle);
external BufferGeometry rotateZ(num angle);
external BufferGeometry translate(num x, num y, num z);
external BufferGeometry scale(num x, num y, num z);
external void lookAt(Vector3 v);
external Vector3 center();
external void setFromObject(Object3D object);
external void updateFromObject(Object3D object);
external BufferGeometry fromGeometry(Geometry geometry, dynamic settings);
external BufferGeometry fromDirectGeometry(DirectGeometry geometry);
external void computeBoundingBox();
external void computeBoundingSphere();
external void computeFaceNormals();
external void computeVertexNormals([bool areaWeighted]);
external void computeOffsets(num size);
external BufferGeometry merge(BufferGeometry geometry, num offset);
external void normalizeNormals();
//external Func0<dynamic> get toJSON;
external set toJSON(Func0<dynamic> v);
external BufferGeometry clone();
external BufferGeometry copy(covariant BufferGeometry source);
external void dispose();
external void addEventListener(String type, VoidFunc1<dynamic> listener);
external void hasEventListener(String type, VoidFunc1<dynamic> listener);
external void removeEventListener(String type, VoidFunc1<dynamic> listener);
/* dispatchEvent(event # type: external Strin get g;
external set g(Strin v); target: external dynami get c;
external set c(dynami v); # ): external voi get d;
external set d(voi v); */
}
@JS()
class Channels {
external factory Channels();
external num get mask;
external set mask(num v);
external void set(num channel);
external void enable(num channel);
external void toggle(num channel);
external void disable(num channel);
}
@JS()
class Clock {
external factory Clock([bool autoStart]);
external bool get autoStart;
external set autoStart(bool v);
external num get startTime;
external set startTime(num v);
external num get oldTime;
external set oldTime(num v);
external num get elapsedTime;
external set elapsedTime(num v);
external bool get running;
external set running(bool v);
external void start();
external void stop();
external num getElapsedTime();
external num getDelta();
}
@JS()
class DirectGeometry {
external factory DirectGeometry();
external num get id;
external set id(num v);
external String get uuid;
external set uuid(String v);
external String get name;
external set name(String v);
external String get type;
external set type(String v);
external List<num> get indices;
external set indices(List<num> v);
external List<Vector3> get vertices;
external set vertices(List<Vector3> v);
external List<Vector3> get normals;
external set normals(List<Vector3> v);
external List<Color> get colors;
external set colors(List<Color> v);
external List<Vector2> get uvs;
external set uvs(List<Vector2> v);
external List<Vector2> get uvs2;
external set uvs2(List<Vector2> v);
/* groups #num start , materialIndex: num# []; */
external List<MorphTarget> get morphTargets;
external set morphTargets(List<MorphTarget> v);
external List<num> get skinWeights;
external set skinWeights(List<num> v);
external List<num> get skinIndices;
external set skinIndices(List<num> v);
external Box3 get boundingBox;
external set boundingBox(Box3 v);
external BoundingSphere get boundingSphere;
external set boundingSphere(BoundingSphere v);
external bool get verticesNeedUpdate;
external set verticesNeedUpdate(bool v);
external bool get normalsNeedUpdate;
external set normalsNeedUpdate(bool v);
external bool get colorsNeedUpdate;
external set colorsNeedUpdate(bool v);
external bool get uvsNeedUpdate;
external set uvsNeedUpdate(bool v);
external bool get groupsNeedUpdate;
external set groupsNeedUpdate(bool v);
external void computeBoundingBox();
external void computeBoundingSphere();
external void computeGroups(Geometry geometry);
external DirectGeometry fromGeometry(Geometry geometry);
external void dispose();
external void addEventListener(String type, VoidFunc1<dynamic> listener);
external void hasEventListener(String type, VoidFunc1<dynamic> listener);
external void removeEventListener(String type, VoidFunc1<dynamic> listener);
/* dispatchEvent(event # type: external Strin get g;
external set g(Strin v); target: external dynami get c;
external set c(dynami v); # ): external voi get d;
external set d(voi v); */
}
@JS()
class EventDispatcher {
external factory EventDispatcher();
external void addEventListener(String type, VoidFunc1<dynamic> listener);
external void hasEventListener(String type, VoidFunc1<dynamic> listener);
external void removeEventListener(String type, VoidFunc1<dynamic> listener);
/* dispatchEvent(event # type: external Strin get g;
external set g(Strin v); target: external dynami get c;
external set c(dynami v); # ): external voi get d;
external set d(voi v); */
}
@JS()
class Face3 {
external factory Face3(
[num a,
num b,
num c,
List<Vector3> vertexNormals,
List<Color> vertexColors,
num materialIndex]);
external num get a;
external set a(num v);
external num get b;
external set b(num v);
external num get c;
external set c(num v);
external Vector3 get normal;
external set normal(Vector3 v);
external List<Vector3> get vertexNormals;
external set vertexNormals(List<Vector3> v);
external Color get color;
external set color(Color v);
external List<Color> get vertexColors;
external set vertexColors(List<Color> v);
external List<num> get vertexTangents;
external set vertexTangents(List<num> v);
external num get materialIndex;
external set materialIndex(num v);
external Face3 clone();
}
@JS()
class MorphTarget {
external factory MorphTarget();
external String get name;
external set name(String v);
external List<Vector3> get vertices;
external set vertices(List<Vector3> v);
}
@JS()
class MorphColor {
external factory MorphColor();
external String get name;
external set name(String v);
external List<Color> get colors;
external set colors(List<Color> v);
}
@JS()
class MorphNormals {
external factory MorphNormals();
external String get name;
external set name(String v);
external List<Vector3> get normals;
external set normals(List<Vector3> v);
}
@JS()
class BoundingSphere {
external factory BoundingSphere();
external num get radius;
external set radius(num v);
}
@JS()
class Geometry {
external factory Geometry();
external num get id;
external set id(num v);
external String get uuid;
external set uuid(String v);
external String get name;
external set name(String v);
external String get type;
external set type(String v);
external List<Vector3> get vertices;
external set vertices(List<Vector3> v);
external List<Color> get colors;
external set colors(List<Color> v);
external List<Face3> get faces;
external set faces(List<Face3> v);
external List<List<List<Vector2>>> get faceVertexUvs;
external set faceVertexUvs(List<List<List<Vector2>>> v);
external List<MorphTarget> get morphTargets;
external set morphTargets(List<MorphTarget> v);
external List<MorphNormals> get morphNormals;
external set morphNormals(List<MorphNormals> v);
external List<num> get skinWeights;
external set skinWeights(List<num> v);
external List<num> get skinIndices;
external set skinIndices(List<num> v);
external List<num> get lineDistances;
external set lineDistances(List<num> v);
external Box3 get boundingBox;
external set boundingBox(Box3 v);
external BoundingSphere get boundingSphere;
external set boundingSphere(BoundingSphere v);
external bool get verticesNeedUpdate;
external set verticesNeedUpdate(bool v);
external bool get elementsNeedUpdate;
external set elementsNeedUpdate(bool v);
external bool get uvsNeedUpdate;
external set uvsNeedUpdate(bool v);
external bool get normalsNeedUpdate;
external set normalsNeedUpdate(bool v);
external bool get colorsNeedUpdate;
external set colorsNeedUpdate(bool v);
external bool get lineDistancesNeedUpdate;
external set lineDistancesNeedUpdate(bool v);
external bool get groupsNeedUpdate;
external set groupsNeedUpdate(bool v);
external void applyMatrix(Matrix4 matrix);
external Geometry rotateX(num angle);
external Geometry rotateY(num angle);
external Geometry rotateZ(num angle);
external Geometry translate(num x, num y, num z);
external Geometry scale(num x, num y, num z);
external void lookAt(Vector3 vector);
external Geometry fromBufferGeometry(BufferGeometry geometry);
external Vector3 center();
external Geometry normalize();
external void computeFaceNormals();
external void computeVertexNormals(bool areaWeighted);
external void computeMorphNormals();
external void computeLineDistances();
external void computeBoundingBox();
external void computeBoundingSphere();
// external void merge(
// covariant Geometry geometry, Matrix matrix, num materialIndexOffset);
external void mergeMesh(Mesh mesh);
external num mergeVertices();
external void sortFacesByMaterialIndex();
//external Func0<dynamic> get toJSON;
external set toJSON(Func0<dynamic> v);
external Geometry clone();
external Geometry copy(Geometry source);
external void dispose();
external List<Bone> get bones;
external set bones(List<Bone> v);
external AnimationClip get animation;
external set animation(AnimationClip v);
external List<AnimationClip> get animations;
external set animations(List<AnimationClip> v);
external void addEventListener(String type, VoidFunc1<dynamic> listener);
external void hasEventListener(String type, VoidFunc1<dynamic> listener);
external void removeEventListener(String type, VoidFunc1<dynamic> listener);
/* dispatchEvent(event # type: external Strin get g;
external set g(Strin v); target: external dynami get c;
external set c(dynami v); # ): external voi get d;
external set d(voi v); */
}
@JS()
class InstancedBufferAttribute extends BufferAttribute {
external factory InstancedBufferAttribute(
[List<num> data, num itemSize, num meshPerAttribute]);
external num get meshPerAttribute;
external set meshPerAttribute(num v);
external InstancedBufferAttribute clone();
external InstancedBufferAttribute copy(InstancedBufferAttribute source);
}
@JS()
class InstancedBufferGeometry extends BufferGeometry {
external factory InstancedBufferGeometry();
/* groups #num start , num count , instances:num# []; */ external void
addGroup(num start, num count, [num instances]);
external InstancedBufferGeometry clone();
external InstancedBufferGeometry copy(InstancedBufferGeometry source);
}
@JS()
class InstancedInterleavedBuffer extends InterleavedBuffer {
external factory InstancedInterleavedBuffer(
[List<num> array, num stride, num meshPerAttribute]);
external num get meshPerAttribute;
external set meshPerAttribute(num v);