mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:07:58 +02:00
Quat.ZERO --> Quat.IDENTITY
This commit is contained in:
parent
8d4e979dc8
commit
f31e014e8b
5 changed files with 10 additions and 9 deletions
|
@ -33,7 +33,7 @@
|
||||||
/// Scriptable interface a Quaternion helper class object. Used exclusively in the JavaScript API
|
/// Scriptable interface a Quaternion helper class object. Used exclusively in the JavaScript API
|
||||||
class Quat : public QObject, protected QScriptable {
|
class Quat : public QObject, protected QScriptable {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(glm::quat ZERO READ ZERO CONSTANT)
|
Q_PROPERTY(glm::quat IDENTITY READ IDENTITY CONSTANT)
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
glm::quat multiply(const glm::quat& q1, const glm::quat& q2);
|
glm::quat multiply(const glm::quat& q1, const glm::quat& q2);
|
||||||
|
@ -66,7 +66,7 @@ public slots:
|
||||||
glm::quat cancelOutRoll(const glm::quat& q);
|
glm::quat cancelOutRoll(const glm::quat& q);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const glm::quat& ZERO() { return Quaternions::IDENTITY; }
|
const glm::quat& IDENTITY() const { return Quaternions::IDENTITY; }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ CameraManager = function() {
|
||||||
|
|
||||||
easing = false;
|
easing = false;
|
||||||
easingTime = 0;
|
easingTime = 0;
|
||||||
startOrientation = Quat.ZERO;
|
startOrientation = Quat.IDENTITY;
|
||||||
|
|
||||||
that.previousCameraMode = null;
|
that.previousCameraMode = null;
|
||||||
|
|
||||||
|
|
|
@ -71,12 +71,12 @@ SelectionManager = (function() {
|
||||||
that.selections = [];
|
that.selections = [];
|
||||||
var listeners = [];
|
var listeners = [];
|
||||||
|
|
||||||
that.localRotation = Quat.ZERO;
|
that.localRotation = Quat.IDENTITY;
|
||||||
that.localPosition = Vec3.ZERO;
|
that.localPosition = Vec3.ZERO;
|
||||||
that.localDimensions = Vec3.ZERO;
|
that.localDimensions = Vec3.ZERO;
|
||||||
that.localRegistrationPoint = Vec3.HALF;
|
that.localRegistrationPoint = Vec3.HALF;
|
||||||
|
|
||||||
that.worldRotation = Quat.ZERO;
|
that.worldRotation = Quat.IDENTITY;
|
||||||
that.worldPosition = Vec3.ZERO;
|
that.worldPosition = Vec3.ZERO;
|
||||||
that.worldDimensions = Vec3.ZERO;
|
that.worldDimensions = Vec3.ZERO;
|
||||||
that.worldRegistrationPoint = Vec3.HALF;
|
that.worldRegistrationPoint = Vec3.HALF;
|
||||||
|
@ -1508,7 +1508,7 @@ SelectionDisplay = (function() {
|
||||||
position = SelectionManager.localPosition;
|
position = SelectionManager.localPosition;
|
||||||
registrationPoint = SelectionManager.localRegistrationPoint;
|
registrationPoint = SelectionManager.localRegistrationPoint;
|
||||||
} else {
|
} else {
|
||||||
rotation = Quat.ZERO;
|
rotation = Quat.IDENTITY;
|
||||||
dimensions = SelectionManager.worldDimensions;
|
dimensions = SelectionManager.worldDimensions;
|
||||||
position = SelectionManager.worldPosition;
|
position = SelectionManager.worldPosition;
|
||||||
registrationPoint = SelectionManager.worldRegistrationPoint;
|
registrationPoint = SelectionManager.worldRegistrationPoint;
|
||||||
|
@ -2564,7 +2564,7 @@ SelectionDisplay = (function() {
|
||||||
var onBegin = function(event, pickRay, pickResult) {
|
var onBegin = function(event, pickRay, pickResult) {
|
||||||
var properties = Entities.getEntityProperties(SelectionManager.selections[0]);
|
var properties = Entities.getEntityProperties(SelectionManager.selections[0]);
|
||||||
initialProperties = properties;
|
initialProperties = properties;
|
||||||
rotation = (spaceMode === SPACE_LOCAL) ? properties.rotation : Quat.ZERO;
|
rotation = (spaceMode === SPACE_LOCAL) ? properties.rotation : Quat.IDENTITY;
|
||||||
|
|
||||||
if (spaceMode === SPACE_LOCAL) {
|
if (spaceMode === SPACE_LOCAL) {
|
||||||
rotation = SelectionManager.localRotation;
|
rotation = SelectionManager.localRotation;
|
||||||
|
|
|
@ -18,7 +18,7 @@ OverlayGroup = function(opts) {
|
||||||
var overlays = {};
|
var overlays = {};
|
||||||
|
|
||||||
var rootPosition = opts.position || { x: 0, y: 0, z: 0 };
|
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;
|
var visible = opts.visible == true;
|
||||||
|
|
||||||
function updateOverlays() {
|
function updateOverlays() {
|
||||||
|
@ -36,7 +36,7 @@ OverlayGroup = function(opts) {
|
||||||
|
|
||||||
that.createOverlay = function(type, properties) {
|
that.createOverlay = function(type, properties) {
|
||||||
properties.position = properties.position || { x: 0, y: 0, z: 0 };
|
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);
|
var overlay = Overlays.addOverlay(type, properties);
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ if (typeof Vec3.abs !== "function") {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof Quat.ZERO !== "object") {
|
if (typeof Quat.ZERO !== "object") {
|
||||||
|
// TODO: Change to Quat.IDENTITY.
|
||||||
Quat.ZERO = Quat.fromVec3Radians(Vec3.ZERO);
|
Quat.ZERO = Quat.fromVec3Radians(Vec3.ZERO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue