mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:24:00 +02:00
make some arguments const, cleanup some #includes
This commit is contained in:
parent
77bd7b2821
commit
e9df8cacc7
17 changed files with 25 additions and 30 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "AssignmentAction.h"
|
||||
|
||||
AssignmentAction::AssignmentAction(EntityActionType type, QUuid id, EntityItemPointer ownerEntity) :
|
||||
AssignmentAction::AssignmentAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity) :
|
||||
_id(id),
|
||||
_type(type),
|
||||
_data(QByteArray()),
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class AssignmentAction : public EntityActionInterface {
|
||||
public:
|
||||
AssignmentAction(EntityActionType type, QUuid id, EntityItemPointer ownerEntity);
|
||||
AssignmentAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
|
||||
virtual ~AssignmentAction();
|
||||
|
||||
const QUuid& getID() const { return _id; }
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
#include "AssignmentActionFactory.h"
|
||||
|
||||
|
||||
EntityActionPointer assignmentActionFactory(EntityActionType type, QUuid id, EntityItemPointer ownerEntity) {
|
||||
EntityActionPointer assignmentActionFactory(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity) {
|
||||
return (EntityActionPointer) new AssignmentAction(type, id, ownerEntity);
|
||||
}
|
||||
|
||||
|
||||
EntityActionPointer AssignmentActionFactory::factory(EntitySimulation* simulation,
|
||||
EntityActionType type,
|
||||
QUuid id,
|
||||
const QUuid& id,
|
||||
EntityItemPointer ownerEntity,
|
||||
QVariantMap arguments) {
|
||||
EntityActionPointer action = assignmentActionFactory(type, id, ownerEntity);
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
virtual ~AssignmentActionFactory() { }
|
||||
virtual EntityActionPointer factory(EntitySimulation* simulation,
|
||||
EntityActionType type,
|
||||
QUuid id,
|
||||
const QUuid& id,
|
||||
EntityItemPointer ownerEntity,
|
||||
QVariantMap arguments);
|
||||
virtual EntityActionPointer factoryBA(EntitySimulation* simulation,
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "InterfaceActionFactory.h"
|
||||
|
||||
|
||||
EntityActionPointer interfaceActionFactory(EntityActionType type, QUuid id, EntityItemPointer ownerEntity) {
|
||||
EntityActionPointer interfaceActionFactory(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity) {
|
||||
switch (type) {
|
||||
case ACTION_TYPE_NONE:
|
||||
return nullptr;
|
||||
|
@ -37,7 +37,7 @@ EntityActionPointer interfaceActionFactory(EntityActionType type, QUuid id, Enti
|
|||
|
||||
EntityActionPointer InterfaceActionFactory::factory(EntitySimulation* simulation,
|
||||
EntityActionType type,
|
||||
QUuid id,
|
||||
const QUuid& id,
|
||||
EntityItemPointer ownerEntity,
|
||||
QVariantMap arguments) {
|
||||
EntityActionPointer action = interfaceActionFactory(type, id, ownerEntity);
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
virtual ~InterfaceActionFactory() { }
|
||||
virtual EntityActionPointer factory(EntitySimulation* simulation,
|
||||
EntityActionType type,
|
||||
QUuid id,
|
||||
const QUuid& id,
|
||||
EntityItemPointer ownerEntity,
|
||||
QVariantMap arguments);
|
||||
virtual EntityActionPointer factoryBA(EntitySimulation* simulation,
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
const uint16_t AvatarActionHold::holdVersion = 1;
|
||||
|
||||
AvatarActionHold::AvatarActionHold(EntityActionType type, QUuid id, EntityItemPointer ownerEntity) :
|
||||
AvatarActionHold::AvatarActionHold(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity) :
|
||||
ObjectActionSpring(type, id, ownerEntity),
|
||||
_relativePosition(glm::vec3(0.0f)),
|
||||
_relativeRotation(glm::quat()),
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
class AvatarActionHold : public ObjectActionSpring {
|
||||
public:
|
||||
AvatarActionHold(EntityActionType type, QUuid id, EntityItemPointer ownerEntity);
|
||||
AvatarActionHold(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
|
||||
virtual ~AvatarActionHold();
|
||||
|
||||
virtual EntityActionType getType() const { return ACTION_TYPE_HOLD; }
|
||||
|
|
|
@ -25,7 +25,7 @@ class EntityActionFactoryInterface : public QObject, public Dependency {
|
|||
virtual ~EntityActionFactoryInterface() { }
|
||||
virtual EntityActionPointer factory(EntitySimulation* simulation,
|
||||
EntityActionType type,
|
||||
QUuid id,
|
||||
const QUuid& id,
|
||||
EntityItemPointer ownerEntity,
|
||||
QVariantMap arguments) { assert(false); return nullptr; }
|
||||
virtual EntityActionPointer factoryBA(EntitySimulation* simulation,
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "ObjectAction.h"
|
||||
|
||||
ObjectAction::ObjectAction(EntityActionType type, QUuid id, EntityItemPointer ownerEntity) :
|
||||
ObjectAction::ObjectAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity) :
|
||||
btActionInterface(),
|
||||
_id(id),
|
||||
_active(false),
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
#include <btBulletDynamicsCommon.h>
|
||||
|
||||
#include <EntityItem.h>
|
||||
|
||||
#include "ObjectMotionState.h"
|
||||
#include "BulletUtil.h"
|
||||
#include "EntityActionInterface.h"
|
||||
|
@ -26,7 +24,7 @@
|
|||
|
||||
class ObjectAction : public btActionInterface, public EntityActionInterface {
|
||||
public:
|
||||
ObjectAction(EntityActionType type, QUuid id, EntityItemPointer ownerEntity);
|
||||
ObjectAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
|
||||
virtual ~ObjectAction();
|
||||
|
||||
const QUuid& getID() const { return _id; }
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
const uint16_t ObjectActionOffset::offsetVersion = 1;
|
||||
|
||||
ObjectActionOffset::ObjectActionOffset(EntityActionType type, QUuid id, EntityItemPointer ownerEntity) :
|
||||
ObjectActionOffset::ObjectActionOffset(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity) :
|
||||
ObjectAction(type, id, ownerEntity) {
|
||||
#if WANT_DEBUG
|
||||
qDebug() << "ObjectActionOffset::ObjectActionOffset";
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
class ObjectActionOffset : public ObjectAction {
|
||||
public:
|
||||
ObjectActionOffset(EntityActionType type, QUuid id, EntityItemPointer ownerEntity);
|
||||
ObjectActionOffset(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
|
||||
virtual ~ObjectActionOffset();
|
||||
|
||||
virtual EntityActionType getType() const { return ACTION_TYPE_OFFSET; }
|
||||
|
|
|
@ -17,7 +17,7 @@ const float SPRING_MAX_SPEED = 10.0f;
|
|||
|
||||
const uint16_t ObjectActionSpring::springVersion = 1;
|
||||
|
||||
ObjectActionSpring::ObjectActionSpring(EntityActionType type, QUuid id, EntityItemPointer ownerEntity) :
|
||||
ObjectActionSpring::ObjectActionSpring(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity) :
|
||||
ObjectAction(type, id, ownerEntity),
|
||||
_positionalTarget(glm::vec3(0.0f)),
|
||||
_linearTimeScale(0.2f),
|
||||
|
|
|
@ -12,14 +12,11 @@
|
|||
#ifndef hifi_ObjectActionSpring_h
|
||||
#define hifi_ObjectActionSpring_h
|
||||
|
||||
#include <QUuid>
|
||||
|
||||
#include <EntityItem.h>
|
||||
#include "ObjectAction.h"
|
||||
|
||||
class ObjectActionSpring : public ObjectAction {
|
||||
public:
|
||||
ObjectActionSpring(EntityActionType type, QUuid id, EntityItemPointer ownerEntity);
|
||||
ObjectActionSpring(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
|
||||
virtual ~ObjectActionSpring();
|
||||
|
||||
virtual EntityActionType getType() const { return ACTION_TYPE_SPRING; }
|
||||
|
|
|
@ -20,7 +20,7 @@ QVariantList glmToQList(const glm::quat& g) {
|
|||
return QVariantList() << g.x << g.y << g.z << g.w;
|
||||
}
|
||||
|
||||
QVariantList rgbColorToQList(rgbColor& v) {
|
||||
QVariantList rgbColorToQList(const rgbColor& v) {
|
||||
return QVariantList() << (int)(v[0]) << (int)(v[1]) << (int)(v[2]);
|
||||
}
|
||||
|
||||
|
@ -42,12 +42,12 @@ QVariantMap glmToQMap(const glm::quat& glmQuat) {
|
|||
}
|
||||
|
||||
|
||||
glm::vec3 qListToGlmVec3(const QVariant q) {
|
||||
glm::vec3 qListToGlmVec3(const QVariant& q) {
|
||||
QVariantList qList = q.toList();
|
||||
return glm::vec3(qList[RED_INDEX].toFloat(), qList[GREEN_INDEX].toFloat(), qList[BLUE_INDEX].toFloat());
|
||||
}
|
||||
|
||||
glm::quat qListToGlmQuat(const QVariant q) {
|
||||
glm::quat qListToGlmQuat(const QVariant& q) {
|
||||
QVariantList qList = q.toList();
|
||||
float x = qList[0].toFloat();
|
||||
float y = qList[1].toFloat();
|
||||
|
@ -56,7 +56,7 @@ glm::quat qListToGlmQuat(const QVariant q) {
|
|||
return glm::quat(w, x, y, z);
|
||||
}
|
||||
|
||||
void qListtoRgbColor(const QVariant q, rgbColor returnValue) {
|
||||
void qListtoRgbColor(const QVariant& q, rgbColor& returnValue) {
|
||||
QVariantList qList = q.toList();
|
||||
returnValue[RED_INDEX] = qList[RED_INDEX].toInt();
|
||||
returnValue[GREEN_INDEX] = qList[GREEN_INDEX].toInt();
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
|
||||
QVariantList glmToQList(const glm::vec3& g);
|
||||
QVariantList glmToQList(const glm::quat& g);
|
||||
QVariantList rgbColorToQList(rgbColor& v);
|
||||
QVariantList rgbColorToQList(const rgbColor& v);
|
||||
|
||||
QVariantMap glmToQMap(const glm::vec3& glmVector);
|
||||
QVariantMap glmToQMap(const glm::quat& glmQuat);
|
||||
|
||||
glm::vec3 qListToGlmVec3(const QVariant q);
|
||||
glm::quat qListToGlmQuat(const QVariant q);
|
||||
void qListtoRgbColor(const QVariant q, rgbColor returnValue);
|
||||
glm::vec3 qListToGlmVec3(const QVariant& q);
|
||||
glm::quat qListToGlmQuat(const QVariant& q);
|
||||
void qListtoRgbColor(const QVariant& q, rgbColor& returnValue);
|
||||
|
|
Loading…
Reference in a new issue