mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
code review
This commit is contained in:
parent
4042e2bceb
commit
80e6edda0c
4 changed files with 16 additions and 9 deletions
|
@ -1611,13 +1611,14 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra
|
|||
if (oldID.isNull()) {
|
||||
return EntityItemID();
|
||||
}
|
||||
if (args->map->contains(oldID)) {
|
||||
return EntityItemID(args->map->value(oldID));
|
||||
} else {
|
||||
|
||||
QHash<EntityItemID, EntityItemID>::iterator iter = args->map->find(oldID);
|
||||
if (iter == args->map->end()) {
|
||||
EntityItemID newID = QUuid::createUuid();
|
||||
args->map->insert(oldID, newID);
|
||||
return newID;
|
||||
}
|
||||
return iter.value();
|
||||
};
|
||||
|
||||
entityTreeElement->forEachEntity([&args, &getMapped, &element](EntityItemPointer item) {
|
||||
|
|
|
@ -27,6 +27,8 @@ ObjectActionMotor::ObjectActionMotor(const QUuid& id, EntityItemPointer ownerEnt
|
|||
#if WANT_DEBUG
|
||||
qCDebug(physics) << "ObjectActionMotor::ObjectActionMotor";
|
||||
#endif
|
||||
|
||||
qCWarning(physics) << "action type \"motor\" doesn't yet work.";
|
||||
}
|
||||
|
||||
ObjectActionMotor::~ObjectActionMotor() {
|
||||
|
|
|
@ -108,8 +108,8 @@ btTypedConstraint* ObjectConstraintSlider::getConstraint() {
|
|||
axisInB = glm::normalize(axisInB);
|
||||
}
|
||||
|
||||
glm::quat rotA = glm::rotation(glm::vec3(1.0f, 0.0f, 0.0f), axisInA);
|
||||
glm::quat rotB = glm::rotation(glm::vec3(1.0f, 0.0f, 0.0f), axisInB);
|
||||
glm::quat rotA = glm::rotation(DEFAULT_SLIDER_AXIS, axisInA);
|
||||
glm::quat rotB = glm::rotation(DEFAULT_SLIDER_AXIS, axisInB);
|
||||
|
||||
btTransform frameInA(glmToBullet(rotA), glmToBullet(pointInA));
|
||||
btTransform frameInB(glmToBullet(rotB), glmToBullet(pointInB));
|
||||
|
@ -123,7 +123,7 @@ btTypedConstraint* ObjectConstraintSlider::getConstraint() {
|
|||
} else {
|
||||
// This slider is between an entity and the world-frame.
|
||||
|
||||
glm::quat rot = glm::rotation(glm::vec3(1.0f, 0.0f, 0.0f), axisInA);
|
||||
glm::quat rot = glm::rotation(DEFAULT_SLIDER_AXIS, axisInA);
|
||||
|
||||
btTransform frameInA(glmToBullet(rot), glmToBullet(pointInA));
|
||||
|
||||
|
|
|
@ -32,10 +32,14 @@ void ObjectDynamic::remapIDs(QHash<EntityItemID, EntityItemID>& map) {
|
|||
}
|
||||
|
||||
if (!_otherID.isNull()) {
|
||||
if (!map.contains(_otherID)) {
|
||||
map.insert(_otherID, QUuid::createUuid());
|
||||
QHash<EntityItemID, EntityItemID>::iterator iter = map.find(_otherID);
|
||||
if (iter == map.end()) {
|
||||
// not found, add it
|
||||
_otherID = QUuid::createUuid();
|
||||
map.insert(_otherID, _otherID);
|
||||
} else {
|
||||
_otherID = iter.value();
|
||||
}
|
||||
_otherID = map.value(_otherID);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue