Skip to content

Commit 8ef9152

Browse files
authored
[FIX] Fix various function declarations (playcanvas#2895)
* [FIX] Fix XrTrackedImage#destroy * More function declaration fixes * More function declaration fixes * Another function fix * Lint fix
1 parent 472b327 commit 8ef9152

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/scene/particle-system/gpu-updater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class ParticleGPUUpdater {
7575
this.constantInBoundsCenter.setValue(this.inBoundsCenterUniform);
7676
}
7777

78-
randomize = function () {
78+
randomize() {
7979
this.frameRandomUniform[0] = Math.random();
8080
this.frameRandomUniform[1] = Math.random();
8181
this.frameRandomUniform[2] = Math.random();

src/scene/particle-system/particle-emitter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const particleVerts = [
5050
[-1, 1]
5151
];
5252

53-
var _createTexture = function (device, width, height, pixelData, format = PIXELFORMAT_RGBA32F, mult8Bit, filter) {
53+
function _createTexture(device, width, height, pixelData, format = PIXELFORMAT_RGBA32F, mult8Bit, filter) {
5454

5555
var mipFilter = FILTER_NEAREST;
5656
if (filter && format === PIXELFORMAT_R8_G8_B8_A8)
@@ -84,7 +84,7 @@ var _createTexture = function (device, width, height, pixelData, format = PIXELF
8484
texture.unlock();
8585

8686
return texture;
87-
};
87+
}
8888

8989
function saturate(x) {
9090
return Math.max(Math.min(x, 1), 0);

src/script/script-registry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class ScriptRegistry extends EventHandler {
221221
* }));
222222
*/
223223
/* eslint-enable jsdoc/no-undefined-types */
224-
list = function () {
224+
list() {
225225
return this._list;
226226
}
227227
}

src/xr/xr-hand.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class XrHand extends EventHandler {
7979
* @description Fired when tracking is lost.
8080
*/
8181

82-
update = function (frame) {
82+
update(frame) {
8383
var xrInputSource = this._inputSource._xrInputSource;
8484

8585
// joints

src/xr/xr-input-source.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class XrInputSource extends EventHandler {
229229
}
230230
}
231231

232-
_updateRayTransforms = function () {
232+
_updateRayTransforms() {
233233
var dirty = this._dirtyRay;
234234
this._dirtyRay = false;
235235

@@ -295,7 +295,7 @@ class XrInputSource extends EventHandler {
295295
* @description Get the local space rotation of input source if it is handheld ({@link XrInputSource#grip} is true). Local space is relative to parent of the XR camera. Otherwise it will return null.
296296
* @returns {Vec3|null} The world space rotation of handheld input source.
297297
*/
298-
getLocalRotation = function () {
298+
getLocalRotation() {
299299
return this._localRotation;
300300
}
301301

@@ -305,7 +305,7 @@ class XrInputSource extends EventHandler {
305305
* @description Get the world space origin of input source ray.
306306
* @returns {Vec3} The world space origin of input source ray.
307307
*/
308-
getOrigin = function () {
308+
getOrigin() {
309309
this._updateRayTransforms();
310310
return this._ray.origin;
311311
}

src/xr/xr-tracked-image.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class XrTrackedImage extends EventHandler {
6464
});
6565
}
6666

67-
destroy = function () {
67+
destroy() {
6868
this._image = null;
6969
this._pose = null;
7070

@@ -97,7 +97,7 @@ class XrTrackedImage extends EventHandler {
9797
* // update entity rotation to match tracked image rotation
9898
* entity.setRotation(trackedImage.getRotation());
9999
*/
100-
getRotation = function () {
100+
getRotation() {
101101
if (this._pose) this._rotation.copy(this._pose.transform.orientation);
102102
return this._rotation;
103103
}

0 commit comments

Comments
 (0)