Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
replace remaining occurrences of THREE.Math.degToRad by THREE.MathUti…
…ls.degToRad
  • Loading branch information
vincentfretin committed Aug 14, 2022
commit 306e9b9d3ea1f1d4ced9e932ccd59aeb3a0ecd0b
6 changes: 3 additions & 3 deletions docs/components/rotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ needing to create an object to set rotation:
```js
// With three.js
el.object3D.rotation.set(
THREE.Math.degToRad(15),
THREE.Math.degToRad(30),
THREE.Math.degToRad(90)
THREE.MathUtils.degToRad(15),
THREE.MathUtils.degToRad(30),
THREE.MathUtils.degToRad(90)
);
el.object3D.rotation.x += Math.PI;

Expand Down
2 changes: 1 addition & 1 deletion docs/introduction/javascript-events-dom-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ entityEl.object3D.position.x += 5;
entityEl.object3D.position.multiplyScalar(5);

// Examples for rotation.
entityEl.object3D.rotation.y = THREE.Math.degToRad(45);
entityEl.object3D.rotation.y = THREE.MathUtils.degToRad(45);
entityEl.object3D.rotation.divideScalar(2);

// Examples for scale.
Expand Down
2 changes: 1 addition & 1 deletion examples/performance/animation-raw/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
fanEl.setAttribute('mixin', 'spinAnimation');
for (let i = 0; i < numRows; ++i) {
let rowEl = document.createElement('a-entity');
rowEl.object3D.rotation.z = THREE.Math.degToRad(i * (180 / numRows));
rowEl.object3D.rotation.z = THREE.MathUtils.degToRad(i * (180 / numRows));
for (let j = 0; j < numBalls; ++j) {
let offset = ballInitX + 3 * j;
if (offset === 0) { continue; }
Expand Down
2 changes: 1 addition & 1 deletion examples/performance/animation-set-attribute/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
fanEl.setAttribute('mixin', 'spinAnimation');
for (let i = 0; i < numRows; ++i) {
let rowEl = document.createElement('a-entity');
rowEl.object3D.rotation.z = THREE.Math.degToRad(i * (180 / numRows));
rowEl.object3D.rotation.z = THREE.MathUtils.degToRad(i * (180 / numRows));
for (let j = 0; j < numBalls; ++j) {
let offset = ballInitX + 3 * j;
if (offset === 0) { continue; }
Expand Down
2 changes: 1 addition & 1 deletion examples/performance/cubes/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function randomIncRad (multiplier) {
}

function randomIncDeg (multiplier) {
return randomIncRad(multiplier) * THREE.Math.RAD2DEG;
return randomIncRad(multiplier) * THREE.MathUtils.RAD2DEG;
}

// COMPONENTS
Expand Down
8 changes: 4 additions & 4 deletions tests/components/animation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ suite('animation', function () {
component.tick(0, 1);
assert.equal(el.object3D.position.x, 0);
component.tick(0, 500);
assert.equal(THREE.Math.degToRad(component.config.targets.aframeProperty),
assert.equal(THREE.MathUtils.degToRad(component.config.targets.aframeProperty),
el.object3D.rotation.x);
});
});
Expand Down Expand Up @@ -231,9 +231,9 @@ suite('animation', function () {
});
component.tick(0, 1);
component.tick(0, 1000);
assert.equal(el.object3D.rotation.x, THREE.Math.degToRad(30));
assert.equal(el.object3D.rotation.y, THREE.Math.degToRad(60));
assert.equal(el.object3D.rotation.z, THREE.Math.degToRad(90));
assert.equal(el.object3D.rotation.x, THREE.MathUtils.degToRad(30));
assert.equal(el.object3D.rotation.y, THREE.MathUtils.degToRad(60));
assert.equal(el.object3D.rotation.z, THREE.MathUtils.degToRad(90));
});

test('can animate vec3 single-property custom component', function () {
Expand Down
2 changes: 1 addition & 1 deletion tests/components/geometry.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global assert, process, setup, suite, test */
var helpers = require('../helpers');
var degToRad = require('index').THREE.Math.degToRad;
var degToRad = require('index').THREE.MathUtils.degToRad;

/**
* Most geometry tests will disable BufferGeometries in order to assert on geometry types and
Expand Down
2 changes: 1 addition & 1 deletion tests/components/rotation.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global assert, process, setup, suite, test */
var entityFactory = require('../helpers').entityFactory;
var degToRad = require('index').THREE.Math.degToRad;
var degToRad = require('index').THREE.MathUtils.degToRad;

suite('rotation', function () {
setup(function (done) {
Expand Down