Skip to content

Commit c39a304

Browse files
replace remaining occurrences of THREE.Math.degToRad by THREE.MathUtils.degToRad (aframevr#5089)
1 parent 891678d commit c39a304

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

docs/components/rotation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ needing to create an object to set rotation:
6767
```js
6868
// With three.js
6969
el.object3D.rotation.set(
70-
THREE.Math.degToRad(15),
71-
THREE.Math.degToRad(30),
72-
THREE.Math.degToRad(90)
70+
THREE.MathUtils.degToRad(15),
71+
THREE.MathUtils.degToRad(30),
72+
THREE.MathUtils.degToRad(90)
7373
);
7474
el.object3D.rotation.x += Math.PI;
7575

docs/introduction/javascript-events-dom-apis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ entityEl.object3D.position.x += 5;
400400
entityEl.object3D.position.multiplyScalar(5);
401401

402402
// Examples for rotation.
403-
entityEl.object3D.rotation.y = THREE.Math.degToRad(45);
403+
entityEl.object3D.rotation.y = THREE.MathUtils.degToRad(45);
404404
entityEl.object3D.rotation.divideScalar(2);
405405

406406
// Examples for scale.

examples/performance/animation-raw/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
fanEl.setAttribute('mixin', 'spinAnimation');
3030
for (let i = 0; i < numRows; ++i) {
3131
let rowEl = document.createElement('a-entity');
32-
rowEl.object3D.rotation.z = THREE.Math.degToRad(i * (180 / numRows));
32+
rowEl.object3D.rotation.z = THREE.MathUtils.degToRad(i * (180 / numRows));
3333
for (let j = 0; j < numBalls; ++j) {
3434
let offset = ballInitX + 3 * j;
3535
if (offset === 0) { continue; }

examples/performance/animation-set-attribute/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
fanEl.setAttribute('mixin', 'spinAnimation');
3030
for (let i = 0; i < numRows; ++i) {
3131
let rowEl = document.createElement('a-entity');
32-
rowEl.object3D.rotation.z = THREE.Math.degToRad(i * (180 / numRows));
32+
rowEl.object3D.rotation.z = THREE.MathUtils.degToRad(i * (180 / numRows));
3333
for (let j = 0; j < numBalls; ++j) {
3434
let offset = ballInitX + 3 * j;
3535
if (offset === 0) { continue; }

examples/performance/cubes/components.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function randomIncRad (multiplier) {
44
}
55

66
function randomIncDeg (multiplier) {
7-
return randomIncRad(multiplier) * THREE.Math.RAD2DEG;
7+
return randomIncRad(multiplier) * THREE.MathUtils.RAD2DEG;
88
}
99

1010
// COMPONENTS

tests/components/animation.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ suite('animation', function () {
140140
component.tick(0, 1);
141141
assert.equal(el.object3D.position.x, 0);
142142
component.tick(0, 500);
143-
assert.equal(THREE.Math.degToRad(component.config.targets.aframeProperty),
143+
assert.equal(THREE.MathUtils.degToRad(component.config.targets.aframeProperty),
144144
el.object3D.rotation.x);
145145
});
146146
});
@@ -231,9 +231,9 @@ suite('animation', function () {
231231
});
232232
component.tick(0, 1);
233233
component.tick(0, 1000);
234-
assert.equal(el.object3D.rotation.x, THREE.Math.degToRad(30));
235-
assert.equal(el.object3D.rotation.y, THREE.Math.degToRad(60));
236-
assert.equal(el.object3D.rotation.z, THREE.Math.degToRad(90));
234+
assert.equal(el.object3D.rotation.x, THREE.MathUtils.degToRad(30));
235+
assert.equal(el.object3D.rotation.y, THREE.MathUtils.degToRad(60));
236+
assert.equal(el.object3D.rotation.z, THREE.MathUtils.degToRad(90));
237237
});
238238

239239
test('can animate vec3 single-property custom component', function () {

tests/components/geometry.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* global assert, process, setup, suite, test */
22
var helpers = require('../helpers');
3-
var degToRad = require('index').THREE.Math.degToRad;
3+
var degToRad = require('index').THREE.MathUtils.degToRad;
44

55
/**
66
* Most geometry tests will disable BufferGeometries in order to assert on geometry types and

tests/components/rotation.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* global assert, process, setup, suite, test */
22
var entityFactory = require('../helpers').entityFactory;
3-
var degToRad = require('index').THREE.Math.degToRad;
3+
var degToRad = require('index').THREE.MathUtils.degToRad;
44

55
suite('rotation', function () {
66
setup(function (done) {

0 commit comments

Comments
 (0)