respond to code review

This commit is contained in:
Seth Alves 2015-04-15 16:08:15 -07:00
parent e3a90b80a4
commit 6c4d232ad9
4 changed files with 8 additions and 7 deletions

View file

@ -308,7 +308,7 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) {
ShapeType type = getShapeType();
if (type != SHAPE_TYPE_COMPOUND) {
ModelEntityItem::computeShapeInfo(info);
info.setParams(_shapeType, 0.5f * getDimensions());
info.setParams(type, 0.5f * getDimensions());
} else {
const QSharedPointer<NetworkGeometry> collisionNetworkGeometry = _model->getCollisionGeometry();
@ -410,7 +410,7 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) {
}
glm::vec3 collisionModelDimensions = box.getDimensions();
info.setParams(_shapeType, collisionModelDimensions, _collisionModelURL);
info.setParams(type, collisionModelDimensions, _collisionModelURL);
info.setConvexHulls(_points);
}
}

View file

@ -717,6 +717,10 @@ int EntityTreeElement::readElementDataFromBuffer(const unsigned char* data, int
bytesRead += sizeof(numberOfEntities);
if (bytesLeftToRead >= (int)(numberOfEntities * expectedBytesPerEntity)) {
// look up the Id of this Node
auto nodeList = DependencyManager::get<NodeList>();
QString myNodeID = nodeList->getSessionUUID().toString();
for (uint16_t i = 0; i < numberOfEntities; i++) {
int bytesForThisEntity = 0;
EntityItemID entityItemID;
@ -737,8 +741,6 @@ int EntityTreeElement::readElementDataFromBuffer(const unsigned char* data, int
//
// TODO: Do we need to also do this?
// 3) remember the old cube for the entity so we can mark it as dirty
auto nodeList = DependencyManager::get<NodeList>();
QString myNodeID = nodeList->getSessionUUID().toString();
if (entityItem && entityItem->getSimulatorID() == myNodeID) {
// do nothing, this was echoed back to us by the entity server
} else if (entityItem) {

View file

@ -296,8 +296,7 @@ void ModelEntityItem::updateShapeType(ShapeType type) {
ShapeType ModelEntityItem::getShapeType() const {
if (_shapeType == SHAPE_TYPE_COMPOUND) {
return hasCollisionModel() ? SHAPE_TYPE_COMPOUND : SHAPE_TYPE_NONE;
}
else {
} else {
return _shapeType;
}
}

View file

@ -15,7 +15,7 @@
#include "SimpleEntitySimulation.h"
#include "EntitiesLogging.h"
const quint64 AUTO_REMOVE_SIMULATION_OWNER_USEC = 2000000;
const quint64 AUTO_REMOVE_SIMULATION_OWNER_USEC = 2 * USECS_PER_SECOND;
void SimpleEntitySimulation::updateEntitiesInternal(const quint64& now) {
// now is usecTimestampNow()