Merge branch 'master' of https://github.com/highfidelity/hifi into reverb

This commit is contained in:
Atlante45 2014-10-20 15:38:31 -07:00
commit 588b106f5e
3 changed files with 10 additions and 10 deletions

View file

@ -2053,11 +2053,11 @@ bool Spanner::hasOwnMaterials() const {
return false; return false;
} }
QRgb Spanner::getColor(const glm::vec3& point) { QRgb Spanner::getColorAt(const glm::vec3& point) {
return 0; return 0;
} }
int Spanner::getMaterial(const glm::vec3& point) { int Spanner::getMaterialAt(const glm::vec3& point) {
return 0; return 0;
} }
@ -2410,7 +2410,7 @@ bool Heightfield::hasOwnMaterials() const {
return true; return true;
} }
QRgb Heightfield::getColor(const glm::vec3& point) { QRgb Heightfield::getColorAt(const glm::vec3& point) {
glm::vec3 relative = (point - getBounds().minimum) / _increment; glm::vec3 relative = (point - getBounds().minimum) / _increment;
glm::vec3 floors = glm::floor(relative); glm::vec3 floors = glm::floor(relative);
glm::vec3 ceils = glm::ceil(relative); glm::vec3 ceils = glm::ceil(relative);
@ -2439,7 +2439,7 @@ QRgb Heightfield::getColor(const glm::vec3& point) {
return qRgb(interpolatedColor.r, interpolatedColor.g, interpolatedColor.b); return qRgb(interpolatedColor.r, interpolatedColor.g, interpolatedColor.b);
} }
int Heightfield::getMaterial(const glm::vec3& point) { int Heightfield::getMaterialAt(const glm::vec3& point) {
glm::vec3 relative = (point - getBounds().minimum) / _increment; glm::vec3 relative = (point - getBounds().minimum) / _increment;
const uchar* src = (const uchar*)_material.constData(); const uchar* src = (const uchar*)_material.constData();
return src[(int)glm::round(relative.z) * _width + (int)glm::round(relative.x)]; return src[(int)glm::round(relative.z) * _width + (int)glm::round(relative.x)];

View file

@ -654,10 +654,10 @@ public:
virtual bool contains(const glm::vec3& point); virtual bool contains(const glm::vec3& point);
/// Retrieves the color at the specified point. /// Retrieves the color at the specified point.
virtual QRgb getColor(const glm::vec3& point); virtual QRgb getColorAt(const glm::vec3& point);
/// Retrieves the material at the specified point. /// Retrieves the material at the specified point.
virtual int getMaterial(const glm::vec3& point); virtual int getMaterialAt(const glm::vec3& point);
/// Retrieves a reference to the list of materials. /// Retrieves a reference to the list of materials.
virtual QVector<SharedObjectPointer>& getMaterials(); virtual QVector<SharedObjectPointer>& getMaterials();
@ -878,8 +878,8 @@ public:
virtual bool hasOwnColors() const; virtual bool hasOwnColors() const;
virtual bool hasOwnMaterials() const; virtual bool hasOwnMaterials() const;
virtual QRgb getColor(const glm::vec3& point); virtual QRgb getColorAt(const glm::vec3& point);
virtual int getMaterial(const glm::vec3& point); virtual int getMaterialAt(const glm::vec3& point);
virtual QVector<SharedObjectPointer>& getMaterials(); virtual QVector<SharedObjectPointer>& getMaterials();
virtual bool contains(const glm::vec3& point); virtual bool contains(const glm::vec3& point);

View file

@ -714,7 +714,7 @@ int VoxelMaterialSpannerEditVisitor::visit(MetavoxelInfo& info) {
position.x = info.minimum.x + minX * step; position.x = info.minimum.x + minX * step;
for (QRgb* destX = destY, *endX = destX + sizeX; destX != endX; destX++, position.x += step) { for (QRgb* destX = destY, *endX = destX + sizeX; destX != endX; destX++, position.x += step) {
if (_spanner->contains(position)) { if (_spanner->contains(position)) {
*destX = _spanner->getColor(position); *destX = _spanner->getColorAt(position);
} }
} }
} }
@ -856,7 +856,7 @@ int VoxelMaterialSpannerEditVisitor::visit(MetavoxelInfo& info) {
position.x = info.minimum.x + minX * step; position.x = info.minimum.x + minX * step;
for (uchar* destX = destY, *endX = destX + sizeX; destX != endX; destX++, position.x += step) { for (uchar* destX = destY, *endX = destX + sizeX; destX != endX; destX++, position.x += step) {
if (_spanner->contains(position)) { if (_spanner->contains(position)) {
int material = _spanner->getMaterial(position); int material = _spanner->getMaterialAt(position);
if (material != 0) { if (material != 0) {
int& mapping = materialMap[material]; int& mapping = materialMap[material];
if (mapping == 0) { if (mapping == 0) {