@@ -113,7 +113,7 @@ import { basisInitialize } from './resources/basis.js';
113
113
114
114
// CORE
115
115
116
- export var log = {
116
+ export const log = {
117
117
write : function ( text ) {
118
118
// #if _DEBUG
119
119
console . warn ( "DEPRECATED: pc.log.write is deprecated. Use console.log instead." ) ;
@@ -188,7 +188,7 @@ string.startsWith = function (s, subs) {
188
188
return s . startsWith ( subs ) ;
189
189
} ;
190
190
191
- export var time = {
191
+ export const time = {
192
192
now : now ,
193
193
Timer : Timer
194
194
} ;
@@ -225,8 +225,8 @@ Object.defineProperty(Color.prototype, "data3", {
225
225
} ) ;
226
226
227
227
export function inherits ( Self , Super ) {
228
- var Temp = function ( ) { } ;
229
- var Func = function ( arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 ) {
228
+ const Temp = function ( ) { } ;
229
+ const Func = function ( arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 ) {
230
230
Super . call ( this , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 ) ;
231
231
Self . call ( this , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7 , arg8 ) ;
232
232
// this.constructor = Self;
@@ -305,7 +305,7 @@ Vec4.prototype.scale = Vec4.prototype.mulScalar;
305
305
306
306
// SHAPE
307
307
308
- export var shape = {
308
+ export const shape = {
309
309
Aabb : BoundingBox ,
310
310
Sphere : BoundingSphere ,
311
311
Plane : Plane
@@ -318,7 +318,7 @@ Frustum.prototype.update = function (projectionMatrix, viewMatrix) {
318
318
console . warn ( 'DEPRECATED: pc.Frustum#update is deprecated. Use pc.Frustum#setFromMat4 instead.' ) ;
319
319
// #endif
320
320
321
- var viewProj = new Mat4 ( ) ;
321
+ const viewProj = new Mat4 ( ) ;
322
322
323
323
viewProj . mul2 ( projectionMatrix , viewMatrix ) ;
324
324
@@ -327,13 +327,13 @@ Frustum.prototype.update = function (projectionMatrix, viewMatrix) {
327
327
328
328
// GRAPHICS
329
329
330
- export var ELEMENTTYPE_INT8 = TYPE_INT8 ;
331
- export var ELEMENTTYPE_UINT8 = TYPE_UINT8 ;
332
- export var ELEMENTTYPE_INT16 = TYPE_INT16 ;
333
- export var ELEMENTTYPE_UINT16 = TYPE_UINT16 ;
334
- export var ELEMENTTYPE_INT32 = TYPE_INT32 ;
335
- export var ELEMENTTYPE_UINT32 = TYPE_UINT32 ;
336
- export var ELEMENTTYPE_FLOAT32 = TYPE_FLOAT32 ;
330
+ export const ELEMENTTYPE_INT8 = TYPE_INT8 ;
331
+ export const ELEMENTTYPE_UINT8 = TYPE_UINT8 ;
332
+ export const ELEMENTTYPE_INT16 = TYPE_INT16 ;
333
+ export const ELEMENTTYPE_UINT16 = TYPE_UINT16 ;
334
+ export const ELEMENTTYPE_INT32 = TYPE_INT32 ;
335
+ export const ELEMENTTYPE_UINT32 = TYPE_UINT32 ;
336
+ export const ELEMENTTYPE_FLOAT32 = TYPE_FLOAT32 ;
337
337
338
338
export function UnsupportedBrowserError ( message ) {
339
339
this . name = "UnsupportedBrowserError" ;
@@ -347,7 +347,7 @@ export function ContextCreationError(message) {
347
347
}
348
348
ContextCreationError . prototype = Error . prototype ;
349
349
350
- export var gfx = {
350
+ export const gfx = {
351
351
ADDRESS_CLAMP_TO_EDGE : ADDRESS_CLAMP_TO_EDGE ,
352
352
ADDRESS_MIRRORED_REPEAT : ADDRESS_MIRRORED_REPEAT ,
353
353
ADDRESS_REPEAT : ADDRESS_REPEAT ,
@@ -425,7 +425,7 @@ export var gfx = {
425
425
VertexIterator : VertexIterator
426
426
} ;
427
427
428
- export var posteffect = {
428
+ export const posteffect = {
429
429
createFullscreenQuad : createFullscreenQuad ,
430
430
drawFullscreenQuad : drawFullscreenQuad ,
431
431
PostEffect : PostEffect ,
@@ -472,9 +472,9 @@ Object.defineProperties(Texture.prototype, {
472
472
473
473
// SCENE
474
474
475
- export var PhongMaterial = StandardMaterial ;
475
+ export const PhongMaterial = StandardMaterial ;
476
476
477
- export var scene = {
477
+ export const scene = {
478
478
partitionSkin : partitionSkin ,
479
479
procedural : {
480
480
calculateTangents : calculateTangents ,
@@ -567,19 +567,16 @@ GraphNode.prototype.removeLabel = function (label) {
567
567
delete this . _labels [ label ] ;
568
568
} ;
569
569
570
- GraphNode . prototype . findByLabel = function ( label , results ) {
570
+ GraphNode . prototype . findByLabel = function ( label , results = [ ] ) {
571
571
// #if _DEBUG
572
572
console . warn ( 'DEPRECATED: pc.GraphNode#findByLabel is deprecated. Use pc.GraphNode#tags instead.' ) ;
573
573
// #endif
574
574
575
- var i , length = this . _children . length ;
576
- results = results || [ ] ;
577
-
578
575
if ( this . hasLabel ( label ) ) {
579
576
results . push ( this ) ;
580
577
}
581
578
582
- for ( i = 0 ; i < length ; ++ i ) {
579
+ for ( let i = 0 ; i < this . _children . length ; ++ i ) {
583
580
results = this . _children [ i ] . findByLabel ( label , results ) ;
584
581
}
585
582
@@ -664,7 +661,7 @@ Material.prototype.setShader = function (shader) {
664
661
665
662
// ANIMATION
666
663
667
- export var anim = {
664
+ export const anim = {
668
665
Animation : Animation ,
669
666
Key : Key ,
670
667
Node : Node ,
@@ -757,7 +754,7 @@ Skeleton.prototype.setLooping = function (looping) {
757
754
758
755
// SOUND
759
756
760
- export var audio = {
757
+ export const audio = {
761
758
AudioManager : SoundManager ,
762
759
Channel : Channel ,
763
760
Channel3d : Channel3d ,
@@ -788,7 +785,7 @@ SoundManager.prototype.setVolume = function (volume) {
788
785
789
786
// ASSET
790
787
791
- export var asset = {
788
+ export const asset = {
792
789
ASSET_ANIMATION : 'animation' ,
793
790
ASSET_AUDIO : 'audio' ,
794
791
ASSET_IMAGE : 'image' ,
@@ -839,7 +836,7 @@ Object.defineProperty(XrInputSource.prototype, 'rotation', {
839
836
840
837
// INPUT
841
838
842
- export var input = {
839
+ export const input = {
843
840
getTouchTargetCoords : getTouchTargetCoords ,
844
841
Controller : Controller ,
845
842
GamePads : GamePads ,
@@ -866,19 +863,19 @@ Object.defineProperty(MouseEvent.prototype, 'wheel', {
866
863
867
864
// FRAMEWORK
868
865
869
- export var RIGIDBODY_TYPE_STATIC = BODYTYPE_STATIC ;
870
- export var RIGIDBODY_TYPE_DYNAMIC = BODYTYPE_DYNAMIC ;
871
- export var RIGIDBODY_TYPE_KINEMATIC = BODYTYPE_KINEMATIC ;
872
- export var RIGIDBODY_CF_STATIC_OBJECT = BODYFLAG_STATIC_OBJECT ;
873
- export var RIGIDBODY_CF_KINEMATIC_OBJECT = BODYFLAG_KINEMATIC_OBJECT ;
874
- export var RIGIDBODY_CF_NORESPONSE_OBJECT = BODYFLAG_NORESPONSE_OBJECT ;
875
- export var RIGIDBODY_ACTIVE_TAG = BODYSTATE_ACTIVE_TAG ;
876
- export var RIGIDBODY_ISLAND_SLEEPING = BODYSTATE_ISLAND_SLEEPING ;
877
- export var RIGIDBODY_WANTS_DEACTIVATION = BODYSTATE_WANTS_DEACTIVATION ;
878
- export var RIGIDBODY_DISABLE_DEACTIVATION = BODYSTATE_DISABLE_DEACTIVATION ;
879
- export var RIGIDBODY_DISABLE_SIMULATION = BODYSTATE_DISABLE_SIMULATION ;
880
-
881
- export var fw = {
866
+ export const RIGIDBODY_TYPE_STATIC = BODYTYPE_STATIC ;
867
+ export const RIGIDBODY_TYPE_DYNAMIC = BODYTYPE_DYNAMIC ;
868
+ export const RIGIDBODY_TYPE_KINEMATIC = BODYTYPE_KINEMATIC ;
869
+ export const RIGIDBODY_CF_STATIC_OBJECT = BODYFLAG_STATIC_OBJECT ;
870
+ export const RIGIDBODY_CF_KINEMATIC_OBJECT = BODYFLAG_KINEMATIC_OBJECT ;
871
+ export const RIGIDBODY_CF_NORESPONSE_OBJECT = BODYFLAG_NORESPONSE_OBJECT ;
872
+ export const RIGIDBODY_ACTIVE_TAG = BODYSTATE_ACTIVE_TAG ;
873
+ export const RIGIDBODY_ISLAND_SLEEPING = BODYSTATE_ISLAND_SLEEPING ;
874
+ export const RIGIDBODY_WANTS_DEACTIVATION = BODYSTATE_WANTS_DEACTIVATION ;
875
+ export const RIGIDBODY_DISABLE_DEACTIVATION = BODYSTATE_DISABLE_DEACTIVATION ;
876
+ export const RIGIDBODY_DISABLE_SIMULATION = BODYSTATE_DISABLE_SIMULATION ;
877
+
878
+ export const fw = {
882
879
Application : Application ,
883
880
Component : Component ,
884
881
ComponentSystem : ComponentSystem ,
@@ -910,13 +907,13 @@ Application.prototype.enableFullscreen = function (element, success, error) {
910
907
element = element || this . graphicsDevice . canvas ;
911
908
912
909
// success callback
913
- var s = function ( ) {
910
+ const s = function ( ) {
914
911
success ( ) ;
915
912
document . removeEventListener ( 'fullscreenchange' , s ) ;
916
913
} ;
917
914
918
915
// error callback
919
- var e = function ( ) {
916
+ const e = function ( ) {
920
917
error ( ) ;
921
918
document . removeEventListener ( 'fullscreenerror' , e ) ;
922
919
} ;
@@ -942,7 +939,7 @@ Application.prototype.disableFullscreen = function (success) {
942
939
// #endif
943
940
944
941
// success callback
945
- var s = function ( ) {
942
+ const s = function ( ) {
946
943
success ( ) ;
947
944
document . removeEventListener ( 'fullscreenchange' , s ) ;
948
945
} ;
@@ -958,7 +955,7 @@ Application.prototype.getSceneUrl = function (name) {
958
955
// #if _DEBUG
959
956
console . warn ( "DEPRECATED: pc.Application#getSceneUrl is deprecated. Use pc.Application#scenes and pc.SceneRegistry#find instead." ) ;
960
957
// #endif
961
- var entry = this . scenes . find ( name ) ;
958
+ const entry = this . scenes . find ( name ) ;
962
959
if ( entry ) {
963
960
return entry . url ;
964
961
}
0 commit comments