Quat.ZERO --> Quat.IDENTITY

This commit is contained in:
David Rowe 2017-10-18 20:34:55 +13:00
parent 8d4e979dc8
commit f31e014e8b
5 changed files with 10 additions and 9 deletions

View file

@ -33,7 +33,7 @@
/// Scriptable interface a Quaternion helper class object. Used exclusively in the JavaScript API
class Quat : public QObject, protected QScriptable {
Q_OBJECT
Q_PROPERTY(glm::quat ZERO READ ZERO CONSTANT)
Q_PROPERTY(glm::quat IDENTITY READ IDENTITY CONSTANT)
public slots:
glm::quat multiply(const glm::quat& q1, const glm::quat& q2);
@ -66,7 +66,7 @@ public slots:
glm::quat cancelOutRoll(const glm::quat& q);
private:
const glm::quat& ZERO() { return Quaternions::IDENTITY; }
const glm::quat& IDENTITY() const { return Quaternions::IDENTITY; }
};

View file

@ -123,7 +123,7 @@ CameraManager = function() {
easing = false;
easingTime = 0;
startOrientation = Quat.ZERO;
startOrientation = Quat.IDENTITY;
that.previousCameraMode = null;

View file

@ -71,12 +71,12 @@ SelectionManager = (function() {
that.selections = [];
var listeners = [];
that.localRotation = Quat.ZERO;
that.localRotation = Quat.IDENTITY;
that.localPosition = Vec3.ZERO;
that.localDimensions = Vec3.ZERO;
that.localRegistrationPoint = Vec3.HALF;
that.worldRotation = Quat.ZERO;
that.worldRotation = Quat.IDENTITY;
that.worldPosition = Vec3.ZERO;
that.worldDimensions = Vec3.ZERO;
that.worldRegistrationPoint = Vec3.HALF;
@ -1508,7 +1508,7 @@ SelectionDisplay = (function() {
position = SelectionManager.localPosition;
registrationPoint = SelectionManager.localRegistrationPoint;
} else {
rotation = Quat.ZERO;
rotation = Quat.IDENTITY;
dimensions = SelectionManager.worldDimensions;
position = SelectionManager.worldPosition;
registrationPoint = SelectionManager.worldRegistrationPoint;
@ -2564,7 +2564,7 @@ SelectionDisplay = (function() {
var onBegin = function(event, pickRay, pickResult) {
var properties = Entities.getEntityProperties(SelectionManager.selections[0]);
initialProperties = properties;
rotation = (spaceMode === SPACE_LOCAL) ? properties.rotation : Quat.ZERO;
rotation = (spaceMode === SPACE_LOCAL) ? properties.rotation : Quat.IDENTITY;
if (spaceMode === SPACE_LOCAL) {
rotation = SelectionManager.localRotation;

View file

@ -18,7 +18,7 @@ OverlayGroup = function(opts) {
var overlays = {};
var rootPosition = opts.position || { x: 0, y: 0, z: 0 };
var rootRotation = opts.rotation || Quat.ZERO;
var rootRotation = opts.rotation || Quat.IDENTITY;
var visible = opts.visible == true;
function updateOverlays() {
@ -36,7 +36,7 @@ OverlayGroup = function(opts) {
that.createOverlay = function(type, properties) {
properties.position = properties.position || { x: 0, y: 0, z: 0 };
properties.rotation = properties.rotation || Quat.ZERO;
properties.rotation = properties.rotation || Quat.IDENTITY;
var overlay = Overlays.addOverlay(type, properties);

View file

@ -27,6 +27,7 @@ if (typeof Vec3.abs !== "function") {
}
if (typeof Quat.ZERO !== "object") {
// TODO: Change to Quat.IDENTITY.
Quat.ZERO = Quat.fromVec3Radians(Vec3.ZERO);
}