diff --git a/CMakeLists.txt b/CMakeLists.txt index af707acf57..3242d981ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,4 +181,4 @@ endif () if (ANDROID OR DESKTOP_GVR) add_subdirectory(gvr-interface) -endif () \ No newline at end of file +endif () diff --git a/examples/controllers/hydra/toyball.js b/examples/controllers/hydra/toyball.js index 5306769e95..89085fad19 100644 --- a/examples/controllers/hydra/toyball.js +++ b/examples/controllers/hydra/toyball.js @@ -92,7 +92,6 @@ function checkControllerSide(whichSide) { Vec3.multiply(1.0 - AVERAGE_FACTOR, averageLinearVelocity[0])); linearVelocity = averageLinearVelocity[0]; angularVelocity = Vec3.multiplyQbyV(MyAvatar.orientation, Controller.getSpatialControlRawAngularVelocity(LEFT_TIP)); - angularVelocity = Vec3.multiply(180.0 / Math.PI, angularVelocity); } else { BUTTON_FWD = RIGHT_BUTTON_FWD; BUTTON_3 = RIGHT_BUTTON_3; @@ -104,7 +103,6 @@ function checkControllerSide(whichSide) { Vec3.multiply(1.0 - AVERAGE_FACTOR, averageLinearVelocity[1])); linearVelocity = averageLinearVelocity[1]; angularVelocity = Vec3.multiplyQbyV(MyAvatar.orientation, Controller.getSpatialControlRawAngularVelocity(RIGHT_TIP)); - angularVelocity = Vec3.multiply(180.0 / Math.PI, angularVelocity); handMessage = "RIGHT"; } diff --git a/examples/dice.js b/examples/dice.js index 1205f38ee1..b0021ecebb 100644 --- a/examples/dice.js +++ b/examples/dice.js @@ -53,7 +53,9 @@ function shootDice(position, velocity) { position: position, velocity: velocity, rotation: Quat.fromPitchYawRollDegrees(Math.random() * 360, Math.random() * 360, Math.random() * 360), - angularVelocity: { x: Math.random() * 100, y: Math.random() * 100, z: Math.random() * 100 }, + // NOTE: angularVelocity is in radians/sec + var maxAngularSpeed = Math.PI; + angularVelocity: { x: Math.random() * maxAngularSpeed, y: Math.random() * maxAngularSpeed, z: Math.random() * maxAngularSpeed }, lifetime: LIFETIME, gravity: { x: 0, y: GRAVITY, z: 0 }, shapeType: "box", @@ -108,4 +110,4 @@ function scriptEnding() { Entities.entityCollisionWithEntity.connect(entityCollisionWithEntity); Controller.mousePressEvent.connect(mousePressEvent); -Script.scriptEnding.connect(scriptEnding); \ No newline at end of file +Script.scriptEnding.connect(scriptEnding); diff --git a/examples/example/entities/spotlightExample.js b/examples/example/entities/spotlightExample.js index 5eb5432f3f..80c89926a3 100644 --- a/examples/example/entities/spotlightExample.js +++ b/examples/example/entities/spotlightExample.js @@ -11,11 +11,13 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +var DEGREES_TO_RADIANS = Math.PI / 180.0; + var lightProperties = { type: "Light", position: { x: 0, y: 0, z: 0 }, dimensions: { x: 1000, y: 1000, z: 1000 }, - angularVelocity: { x: 0, y: 10, z: 0 }, + angularVelocity: { x: 0, y: 10 * DEGREES_TO_RADIANS, z: 0 }, angularDamping: 0, isSpotlight: true, diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index f2c7d80cfd..596bf5c9d5 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -2,6 +2,10 @@