mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 09:57:26 +02:00
coding-standard / code-review
This commit is contained in:
parent
f4bbbcbec7
commit
6e7973f5b9
3 changed files with 20 additions and 20 deletions
|
@ -52,7 +52,7 @@ script or when receiving information via an EntityTree data-stream (either over
|
||||||
svo file).
|
svo file).
|
||||||
|
|
||||||
In the interface, if an EntityItem has actions, this EntityItem will have pointers to ObjectAction
|
In the interface, if an EntityItem has actions, this EntityItem will have pointers to ObjectAction
|
||||||
subclass (like ObjectActionSpring) instantiations. Code in the entities library affects an action object
|
subclass (like ObjectActionSpring) instantiations. Code in the entities library affects an action-object
|
||||||
via the EntityActionInterface (which knows nothing about bullet). When the ObjectAction subclass
|
via the EntityActionInterface (which knows nothing about bullet). When the ObjectAction subclass
|
||||||
instance is created, it is registered as an action with bullet. Bullet will call into code in this
|
instance is created, it is registered as an action with bullet. Bullet will call into code in this
|
||||||
instance with the btActionInterface every physics-simulation step.
|
instance with the btActionInterface every physics-simulation step.
|
||||||
|
@ -254,8 +254,8 @@ QDataStream& operator<<(QDataStream& stream, const EntityActionType& entityActio
|
||||||
|
|
||||||
QDataStream& operator>>(QDataStream& stream, EntityActionType& entityActionType)
|
QDataStream& operator>>(QDataStream& stream, EntityActionType& entityActionType)
|
||||||
{
|
{
|
||||||
quint16 v;
|
quint16 actionTypeAsInt;
|
||||||
stream >> v;
|
stream >> actionTypeAsInt;
|
||||||
entityActionType = (EntityActionType)v;
|
entityActionType = (EntityActionType)actionTypeAsInt;
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,8 +207,8 @@ QVariantMap ObjectActionSpring::getArguments() {
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray ObjectActionSpring::serialize() {
|
QByteArray ObjectActionSpring::serialize() {
|
||||||
QByteArray ba;
|
QByteArray serializedActionArguments;
|
||||||
QDataStream dataStream(&ba, QIODevice::WriteOnly);
|
QDataStream dataStream(&serializedActionArguments, QIODevice::WriteOnly);
|
||||||
|
|
||||||
dataStream << getType();
|
dataStream << getType();
|
||||||
dataStream << getID();
|
dataStream << getID();
|
||||||
|
@ -222,7 +222,7 @@ QByteArray ObjectActionSpring::serialize() {
|
||||||
dataStream << _angularTimeScale;
|
dataStream << _angularTimeScale;
|
||||||
dataStream << _rotationalTargetSet;
|
dataStream << _rotationalTargetSet;
|
||||||
|
|
||||||
return ba;
|
return serializedActionArguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectActionSpring::deserialize(QByteArray serializedArguments) {
|
void ObjectActionSpring::deserialize(QByteArray serializedArguments) {
|
||||||
|
|
|
@ -24,21 +24,21 @@ QVariantList rgbColorToQList(rgbColor& v) {
|
||||||
return QVariantList() << (int)(v[0]) << (int)(v[1]) << (int)(v[2]);
|
return QVariantList() << (int)(v[0]) << (int)(v[1]) << (int)(v[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap glmToQMap(const glm::vec3& g) {
|
QVariantMap glmToQMap(const glm::vec3& glmVector) {
|
||||||
QVariantMap p;
|
QVariantMap vectorAsVariantMap;
|
||||||
p["x"] = g.x;
|
vectorAsVariantMap["x"] = glmVector.x;
|
||||||
p["y"] = g.y;
|
vectorAsVariantMap["y"] = glmVector.y;
|
||||||
p["z"] = g.z;
|
vectorAsVariantMap["z"] = glmVector.z;
|
||||||
return p;
|
return vectorAsVariantMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap glmToQMap(const glm::quat& g) {
|
QVariantMap glmToQMap(const glm::quat& glmQuat) {
|
||||||
QVariantMap q;
|
QVariantMap quatAsVariantMap;
|
||||||
q["x"] = g.x;
|
quatAsVariantMap["x"] = glmQuat.x;
|
||||||
q["y"] = g.y;
|
quatAsVariantMap["y"] = glmQuat.y;
|
||||||
q["z"] = g.z;
|
quatAsVariantMap["z"] = glmQuat.z;
|
||||||
q["w"] = g.w;
|
quatAsVariantMap["w"] = glmQuat.w;
|
||||||
return q;
|
return quatAsVariantMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue