Merge branch 'master' of git://github.com/highfidelity/hifi into 20304

This commit is contained in:
Virendra Singh 2015-03-06 11:06:49 +05:30
commit 9c1b9b05cf
8 changed files with 30 additions and 19 deletions

View file

@ -556,6 +556,7 @@ void DomainServer::populateDefaultStaticAssignmentsExcludingTypes(const QSet<Ass
if (!excludedTypes.contains(defaultedType) if (!excludedTypes.contains(defaultedType)
&& defaultedType != Assignment::UNUSED_0 && defaultedType != Assignment::UNUSED_0
&& defaultedType != Assignment::UNUSED_1 && defaultedType != Assignment::UNUSED_1
&& defaultedType != Assignment::UNUSED_2
&& defaultedType != Assignment::AgentType) { && defaultedType != Assignment::AgentType) {
// type has not been set from a command line or config file config, use the default // type has not been set from a command line or config file config, use the default
// by clearing whatever exists and writing a single default assignment with no payload // by clearing whatever exists and writing a single default assignment with no payload

View file

@ -253,6 +253,8 @@ inline void EntityItemProperties::setPosition(const glm::vec3& value)
inline QDebug operator<<(QDebug debug, const EntityItemProperties& properties) { inline QDebug operator<<(QDebug debug, const EntityItemProperties& properties) {
debug << "EntityItemProperties[" << "\n"; debug << "EntityItemProperties[" << "\n";
debug << " _type:" << properties.getType() << "\n";
// TODO: figure out why position and animationSettings don't seem to like the macro approach // TODO: figure out why position and animationSettings don't seem to like the macro approach
if (properties.containsPositionChange()) { if (properties.containsPositionChange()) {

View file

@ -332,10 +332,12 @@
T _##n; \ T _##n; \
bool _##n##Changed; bool _##n##Changed;
#define DEBUG_PROPERTY(D, P, N, n, x) \
D << " " << #n << ":" << P.get##N() << x << "[changed:" << P.n##Changed() << "]\n";
#define DEBUG_PROPERTY_IF_CHANGED(D, P, N, n, x) \ #define DEBUG_PROPERTY_IF_CHANGED(D, P, N, n, x) \
if (P.n##Changed()) { \ if (P.n##Changed()) { \
D << " " << #n << ":" << P.get##N() << x << "\n"; \ D << " " << #n << ":" << P.get##N() << x << "\n"; \
} }
#endif // hifi_EntityItemPropertiesMacros_h #endif // hifi_EntityItemPropertiesMacros_h

View file

@ -201,7 +201,7 @@ EntityItem* EntityTree::addEntity(const EntityItemID& entityID, const EntityItem
// construct the instance of the entity // construct the instance of the entity
EntityTypes::EntityType type = properties.getType(); EntityTypes::EntityType type = properties.getType();
result = EntityTypes::constructEntityItem(type, entityID, properties); result = EntityTypes::constructEntityItem(type, entityID, properties);
if (result) { if (result) {
if (recordCreationTime) { if (recordCreationTime) {
result->recordCreationTime(); result->recordCreationTime();

View file

@ -77,7 +77,9 @@ EntityItem* EntityTypes::constructEntityItem(EntityType entityType, const Entity
factory = _factories[entityType]; factory = _factories[entityType];
} }
if (factory) { if (factory) {
newEntityItem = factory(entityID, properties); EntityItemProperties mutableProperties = properties;
mutableProperties.markAllChanged();
newEntityItem = factory(entityID, mutableProperties);
} }
return newEntityItem; return newEntityItem;
} }

View file

@ -31,7 +31,8 @@ vec4 transformModelToClipPos(TransformCamera camera, TransformObject object, vec
return camera._projectionViewUntranslated * epos; return camera._projectionViewUntranslated * epos;
// Equivalent to the following but hoppefully a bit more accurate // Equivalent to the following but hoppefully a bit more accurate
// return camera._projection * camera._view * object._model * pos; // return camera._projection * camera._view * object._model * pos;
<@else@>
return gl_ModelViewProjectionMatrix * pos;
<@endif@> <@endif@>
} }
@ -50,6 +51,8 @@ vec3 transformModelToEyeDir(TransformCamera camera, TransformObject object, vec3
vec3 result = vec3(dot(mvc0, dir), dot(mvc1, dir), dot(mvc2, dir)); vec3 result = vec3(dot(mvc0, dir), dot(mvc1, dir), dot(mvc2, dir));
return result; return result;
<@else@>
return gl_NormalMatrix * dir;
<@endif@> <@endif@>
} }

View file

@ -153,15 +153,8 @@ void AddressManager::handleLookupString(const QString& lookupString) {
if (!lookupString.startsWith('/')) { if (!lookupString.startsWith('/')) {
const QRegExp HIFI_SCHEME_REGEX = QRegExp(HIFI_URL_SCHEME + ":\\/{1,2}", Qt::CaseInsensitive); const QRegExp HIFI_SCHEME_REGEX = QRegExp(HIFI_URL_SCHEME + ":\\/{1,2}", Qt::CaseInsensitive);
sanitizedString = sanitizedString.remove(HIFI_SCHEME_REGEX); sanitizedString = sanitizedString.remove(HIFI_SCHEME_REGEX);
quint16 localDomainServerPort = DEFAULT_DOMAIN_SERVER_PORT;
if (sanitizedString == "localhost") {
auto nodeList = DependencyManager::get<NodeList>();
nodeList->getLocalServerPortFromSharedMemory
(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, _localDSPortSharedMem, localDomainServerPort);
}
lookupURL = QUrl(HIFI_URL_SCHEME + "://" + sanitizedString + ":" + QString::number(localDomainServerPort)); lookupURL = QUrl(HIFI_URL_SCHEME + "://" + sanitizedString);
} else { } else {
lookupURL = QUrl(lookupString); lookupURL = QUrl(lookupString);
} }
@ -338,7 +331,15 @@ bool AddressManager::handleNetworkAddress(const QString& lookupString) {
if (hostnameRegex.indexIn(lookupString) != -1) { if (hostnameRegex.indexIn(lookupString) != -1) {
QString domainHostname = hostnameRegex.cap(1); QString domainHostname = hostnameRegex.cap(1);
qint16 domainPort = DEFAULT_DOMAIN_SERVER_PORT; quint16 domainPort = DEFAULT_DOMAIN_SERVER_PORT;
if (domainHostname == "localhost") {
auto nodeList = DependencyManager::get<NodeList>();
nodeList->getLocalServerPortFromSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY,
_localDSPortSharedMem,
domainPort);
}
if (!hostnameRegex.cap(2).isEmpty()) { if (!hostnameRegex.cap(2).isEmpty()) {
domainPort = (qint16) hostnameRegex.cap(2).toInt(); domainPort = (qint16) hostnameRegex.cap(2).toInt();
} }

View file

@ -63,8 +63,8 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm
int vertices = slices * (stacks - 1) + 2; int vertices = slices * (stacks - 1) + 2;
int indices = slices * (stacks - 1) * NUM_VERTICES_PER_TRIANGULATED_QUAD; int indices = slices * (stacks - 1) * NUM_VERTICES_PER_TRIANGULATED_QUAD;
if (registered && (!_registeredSphereVertices.contains(id) || _lastRegisteredSphereVertices[id] != radiusKey) if ((registered && (!_registeredSphereVertices.contains(id) || _lastRegisteredSphereVertices[id] != radiusKey))
|| !registered && !_sphereVertices.contains(radiusKey)) { || (!registered && !_sphereVertices.contains(radiusKey))) {
if (registered && _registeredSphereVertices.contains(id)) { if (registered && _registeredSphereVertices.contains(id)) {
_registeredSphereVertices[id].clear(); _registeredSphereVertices[id].clear();
@ -127,8 +127,8 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm
} }
#endif #endif
if (registered && (!_registeredSphereIndices.contains(id) || _lastRegisteredSphereIndices[id] != slicesStacksKey) if ((registered && (!_registeredSphereIndices.contains(id) || _lastRegisteredSphereIndices[id] != slicesStacksKey))
|| !registered && !_sphereIndices.contains(slicesStacksKey)) { || (!registered && !_sphereIndices.contains(slicesStacksKey))) {
if (registered && _registeredSphereIndices.contains(id)) { if (registered && _registeredSphereIndices.contains(id)) {
_registeredSphereIndices[id].clear(); _registeredSphereIndices[id].clear();
@ -213,8 +213,8 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm
} }
#endif #endif
if (registered && (!_registeredSphereColors.contains(id) || _lastRegisteredSphereColors[id] != colorKey) if ((registered && (!_registeredSphereColors.contains(id) || _lastRegisteredSphereColors[id] != colorKey))
|| !registered && !_sphereColors.contains(colorKey)) { || (!registered && !_sphereColors.contains(colorKey))) {
if (registered && _registeredSphereColors.contains(id)) { if (registered && _registeredSphereColors.contains(id)) {
_registeredSphereColors[id].clear(); _registeredSphereColors[id].clear();