mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +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).
|
||||
|
||||
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
|
||||
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.
|
||||
|
@ -254,8 +254,8 @@ QDataStream& operator<<(QDataStream& stream, const EntityActionType& entityActio
|
|||
|
||||
QDataStream& operator>>(QDataStream& stream, EntityActionType& entityActionType)
|
||||
{
|
||||
quint16 v;
|
||||
stream >> v;
|
||||
entityActionType = (EntityActionType)v;
|
||||
quint16 actionTypeAsInt;
|
||||
stream >> actionTypeAsInt;
|
||||
entityActionType = (EntityActionType)actionTypeAsInt;
|
||||
return stream;
|
||||
}
|
||||
|
|
|
@ -207,8 +207,8 @@ QVariantMap ObjectActionSpring::getArguments() {
|
|||
}
|
||||
|
||||
QByteArray ObjectActionSpring::serialize() {
|
||||
QByteArray ba;
|
||||
QDataStream dataStream(&ba, QIODevice::WriteOnly);
|
||||
QByteArray serializedActionArguments;
|
||||
QDataStream dataStream(&serializedActionArguments, QIODevice::WriteOnly);
|
||||
|
||||
dataStream << getType();
|
||||
dataStream << getID();
|
||||
|
@ -222,7 +222,7 @@ QByteArray ObjectActionSpring::serialize() {
|
|||
dataStream << _angularTimeScale;
|
||||
dataStream << _rotationalTargetSet;
|
||||
|
||||
return ba;
|
||||
return serializedActionArguments;
|
||||
}
|
||||
|
||||
void ObjectActionSpring::deserialize(QByteArray serializedArguments) {
|
||||
|
|
|
@ -24,21 +24,21 @@ QVariantList rgbColorToQList(rgbColor& v) {
|
|||
return QVariantList() << (int)(v[0]) << (int)(v[1]) << (int)(v[2]);
|
||||
}
|
||||
|
||||
QVariantMap glmToQMap(const glm::vec3& g) {
|
||||
QVariantMap p;
|
||||
p["x"] = g.x;
|
||||
p["y"] = g.y;
|
||||
p["z"] = g.z;
|
||||
return p;
|
||||
QVariantMap glmToQMap(const glm::vec3& glmVector) {
|
||||
QVariantMap vectorAsVariantMap;
|
||||
vectorAsVariantMap["x"] = glmVector.x;
|
||||
vectorAsVariantMap["y"] = glmVector.y;
|
||||
vectorAsVariantMap["z"] = glmVector.z;
|
||||
return vectorAsVariantMap;
|
||||
}
|
||||
|
||||
QVariantMap glmToQMap(const glm::quat& g) {
|
||||
QVariantMap q;
|
||||
q["x"] = g.x;
|
||||
q["y"] = g.y;
|
||||
q["z"] = g.z;
|
||||
q["w"] = g.w;
|
||||
return q;
|
||||
QVariantMap glmToQMap(const glm::quat& glmQuat) {
|
||||
QVariantMap quatAsVariantMap;
|
||||
quatAsVariantMap["x"] = glmQuat.x;
|
||||
quatAsVariantMap["y"] = glmQuat.y;
|
||||
quatAsVariantMap["z"] = glmQuat.z;
|
||||
quatAsVariantMap["w"] = glmQuat.w;
|
||||
return quatAsVariantMap;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue