changed quad entity to PolyLine

This commit is contained in:
ericrius1 2015-07-01 17:18:36 -07:00
parent a117a7aa3b
commit ad54b4c0b0
11 changed files with 66 additions and 66 deletions

View file

@ -42,7 +42,7 @@
#include "RenderableZoneEntityItem.h" #include "RenderableZoneEntityItem.h"
#include "RenderableLineEntityItem.h" #include "RenderableLineEntityItem.h"
#include "RenderablePolyVoxEntityItem.h" #include "RenderablePolyVoxEntityItem.h"
#include "RenderableQuadEntityItem.h" #include "RenderablePolyLineEntityItem.h"
#include "EntitiesRendererLogging.h" #include "EntitiesRendererLogging.h"
#include "AddressManager.h" #include "AddressManager.h"
@ -70,7 +70,7 @@ EntityTreeRenderer::EntityTreeRenderer(bool wantScripts, AbstractViewStateInterf
REGISTER_ENTITY_TYPE_WITH_FACTORY(Zone, RenderableZoneEntityItem::factory) REGISTER_ENTITY_TYPE_WITH_FACTORY(Zone, RenderableZoneEntityItem::factory)
REGISTER_ENTITY_TYPE_WITH_FACTORY(Line, RenderableLineEntityItem::factory) REGISTER_ENTITY_TYPE_WITH_FACTORY(Line, RenderableLineEntityItem::factory)
REGISTER_ENTITY_TYPE_WITH_FACTORY(PolyVox, RenderablePolyVoxEntityItem::factory) REGISTER_ENTITY_TYPE_WITH_FACTORY(PolyVox, RenderablePolyVoxEntityItem::factory)
REGISTER_ENTITY_TYPE_WITH_FACTORY(Quad, RenderableQuadEntityItem::factory) REGISTER_ENTITY_TYPE_WITH_FACTORY(PolyLine, RenderablePolyLineEntityItem::factory)
_currentHoverOverEntityID = UNKNOWN_ENTITY_ID; _currentHoverOverEntityID = UNKNOWN_ENTITY_ID;
_currentClickingOnEntityID = UNKNOWN_ENTITY_ID; _currentClickingOnEntityID = UNKNOWN_ENTITY_ID;

View file

@ -1,5 +1,5 @@
// //
// RenderableQuadEntityItem.cpp // RenderablePolyLineEntityItem.cpp
// libraries/entities-renderer/src/ // libraries/entities-renderer/src/
// //
// Created by Eric Levin on 6/22/15 // Created by Eric Levin on 6/22/15
@ -17,7 +17,7 @@
#include <DeferredLightingEffect.h> #include <DeferredLightingEffect.h>
#include <PerfStat.h> #include <PerfStat.h>
#include "RenderableQuadEntityItem.h" #include "RenderablePolyLineEntityItem.h"
@ -25,20 +25,20 @@
EntityItemPointer RenderableQuadEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) { EntityItemPointer RenderablePolyLineEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) {
return EntityItemPointer(new RenderableQuadEntityItem(entityID, properties)); return EntityItemPointer(new RenderablePolyLineEntityItem(entityID, properties));
} }
RenderableQuadEntityItem::RenderableQuadEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) : RenderablePolyLineEntityItem::RenderablePolyLineEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
QuadEntityItem(entityItemID, properties) { PolyLineEntityItem(entityItemID, properties) {
_numVertices = 0; _numVertices = 0;
} }
gpu::PipelinePointer RenderableQuadEntityItem::_pipeline; gpu::PipelinePointer RenderablePolyLineEntityItem::_pipeline;
gpu::Stream::FormatPointer RenderableQuadEntityItem::_format; gpu::Stream::FormatPointer RenderablePolyLineEntityItem::_format;
void RenderableQuadEntityItem::createPipeline() { void RenderablePolyLineEntityItem::createPipeline() {
static const int NORMAL_OFFSET = 12; static const int NORMAL_OFFSET = 12;
static const int COLOR_OFFSET = 24; static const int COLOR_OFFSET = 24;
_format.reset(new gpu::Stream::Format()); _format.reset(new gpu::Stream::Format());
@ -71,7 +71,7 @@ int generateColor() {
((int(255.0f) & 0xFF) << 24); ((int(255.0f) & 0xFF) << 24);
} }
void RenderableQuadEntityItem::updateGeometry() { void RenderablePolyLineEntityItem::updateGeometry() {
QReadLocker lock(&_quadReadWriteLock); QReadLocker lock(&_quadReadWriteLock);
int compactColor = generateColor(); int compactColor = generateColor();
_numVertices = 0; _numVertices = 0;
@ -98,7 +98,7 @@ void RenderableQuadEntityItem::updateGeometry() {
void RenderableQuadEntityItem::render(RenderArgs* args) { void RenderablePolyLineEntityItem::render(RenderArgs* args) {
if (_points.size() < 2 || _vertices.size() != _normals.size() * 2) { if (_points.size() < 2 || _vertices.size() != _normals.size() * 2) {
return; return;
} }
@ -107,8 +107,8 @@ void RenderableQuadEntityItem::render(RenderArgs* args) {
createPipeline(); createPipeline();
} }
PerformanceTimer perfTimer("RenderableQuadEntityItem::render"); PerformanceTimer perfTimer("RenderablePolyLineEntityItem::render");
Q_ASSERT(getType() == EntityTypes::Quad); Q_ASSERT(getType() == EntityTypes::PolyLine);
Q_ASSERT(args->_batch); Q_ASSERT(args->_batch);
if (_pointsChanged) { if (_pointsChanged) {

View file

@ -9,21 +9,21 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
#ifndef hifi_RenderableQuadEntityItem_h #ifndef hifi_RenderablePolyLineEntityItem_h
#define hifi_RenderableQuadEntityItem_h #define hifi_RenderablePolyLineEntityItem_h
#include <gpu/Batch.h> #include <gpu/Batch.h>
#include <QuadEntityItem.h> #include <PolyLineEntityItem.h>
#include "RenderableDebugableEntityItem.h" #include "RenderableDebugableEntityItem.h"
#include "RenderableEntityItem.h" #include "RenderableEntityItem.h"
#include <GeometryCache.h> #include <GeometryCache.h>
#include <QReadWriteLock> #include <QReadWriteLock>
class RenderableQuadEntityItem : public QuadEntityItem { class RenderablePolyLineEntityItem : public PolyLineEntityItem {
public: public:
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties); static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
static void createPipeline(); static void createPipeline();
RenderableQuadEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties); RenderablePolyLineEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties);
virtual void render(RenderArgs* args); virtual void render(RenderArgs* args);
@ -40,4 +40,4 @@ protected:
}; };
#endif // hifi_RenderableQuadEntityItem_h #endif // hifi_RenderablePolyLineEntityItem_h

View file

@ -28,7 +28,7 @@
#include "ZoneEntityItem.h" #include "ZoneEntityItem.h"
#include "PolyVoxEntityItem.h" #include "PolyVoxEntityItem.h"
#include "LineEntityItem.h" #include "LineEntityItem.h"
#include "QuadEntityItem.h" #include "PolyLineEntityItem.h"
AtmospherePropertyGroup EntityItemProperties::_staticAtmosphere; AtmospherePropertyGroup EntityItemProperties::_staticAtmosphere;
SkyboxPropertyGroup EntityItemProperties::_staticSkybox; SkyboxPropertyGroup EntityItemProperties::_staticSkybox;
@ -819,7 +819,7 @@ bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItem
APPEND_ENTITY_PROPERTY(PROP_LINE_POINTS, properties.getLinePoints()); APPEND_ENTITY_PROPERTY(PROP_LINE_POINTS, properties.getLinePoints());
} }
if (properties.getType() == EntityTypes::Quad) { if (properties.getType() == EntityTypes::PolyLine) {
APPEND_ENTITY_PROPERTY(PROP_LINE_WIDTH, properties.getLineWidth()); APPEND_ENTITY_PROPERTY(PROP_LINE_WIDTH, properties.getLineWidth());
APPEND_ENTITY_PROPERTY(PROP_LINE_POINTS, properties.getLinePoints()); APPEND_ENTITY_PROPERTY(PROP_LINE_POINTS, properties.getLinePoints());
APPEND_ENTITY_PROPERTY(PROP_NORMALS, properties.getNormals()); APPEND_ENTITY_PROPERTY(PROP_NORMALS, properties.getNormals());
@ -1076,7 +1076,7 @@ bool EntityItemProperties::decodeEntityEditPacket(const unsigned char* data, int
} }
if (properties.getType() == EntityTypes::Quad) { if (properties.getType() == EntityTypes::PolyLine) {
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_LINE_WIDTH, float, setLineWidth); READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_LINE_WIDTH, float, setLineWidth);
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_LINE_POINTS, QVector<glm::vec3>, setLinePoints); READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_LINE_POINTS, QVector<glm::vec3>, setLinePoints);
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_NORMALS, QVector<glm::vec3>, setNormals); READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_NORMALS, QVector<glm::vec3>, setNormals);

View file

@ -55,7 +55,7 @@ class EntityItemProperties {
friend class WebEntityItem; // TODO: consider removing this friend relationship and use public methods friend class WebEntityItem; // TODO: consider removing this friend relationship and use public methods
friend class LineEntityItem; // TODO: consider removing this friend relationship and use public methods friend class LineEntityItem; // TODO: consider removing this friend relationship and use public methods
friend class PolyVoxEntityItem; // TODO: consider removing this friend relationship and use public methods friend class PolyVoxEntityItem; // TODO: consider removing this friend relationship and use public methods
friend class QuadEntityItem; // TODO: consider removing this friend relationship and use public methods friend class PolyLineEntityItem; // TODO: consider removing this friend relationship and use public methods
public: public:
EntityItemProperties(); EntityItemProperties();
virtual ~EntityItemProperties(); virtual ~EntityItemProperties();

View file

@ -468,16 +468,16 @@ bool EntityScriptingInterface::setPoints(EntityItemPointer entity, std::function
return success; return success;
} }
bool EntityScriptingInterface::setPoints(EntityItemPointer entity, std::function<bool(QuadEntityItem&)> actor) { bool EntityScriptingInterface::setPoints(EntityItemPointer entity, std::function<bool(PolyLineEntityItem&)> actor) {
if (!_entityTree) { if (!_entityTree) {
return false; return false;
} }
auto now = usecTimestampNow(); auto now = usecTimestampNow();
QuadEntityItem* quadEntity = static_cast<QuadEntityItem*>(entity.get()); PolyLineEntityItem* PolyLineEntity = static_cast<PolyLineEntityItem*>(entity.get());
_entityTree->lockForWrite(); _entityTree->lockForWrite();
bool success = actor(*quadEntity); bool success = actor(*PolyLineEntity);
entity->setLastEdited(now); entity->setLastEdited(now);
entity->setLastBroadcast(now); entity->setLastBroadcast(now);
_entityTree->unlock(); _entityTree->unlock();
@ -527,10 +527,10 @@ bool EntityScriptingInterface::setAllPoints(QUuid entityID, const QVector<glm::v
}); });
} }
if (entityType == EntityTypes::Quad) { if (entityType == EntityTypes::PolyLine) {
return setPoints(entity, [points](QuadEntityItem& quadEntity) -> bool return setPoints(entity, [points](PolyLineEntityItem& PolyLineEntity) -> bool
{ {
return quadEntity.setLinePoints(points); return PolyLineEntity.setLinePoints(points);
}); });
} }
@ -552,10 +552,10 @@ bool EntityScriptingInterface::appendPoint(QUuid entityID, const glm::vec3& poin
}); });
} }
if (entityType == EntityTypes::Quad) { if (entityType == EntityTypes::PolyLine) {
return setPoints(entity, [point](QuadEntityItem& quadEntity) -> bool return setPoints(entity, [point](PolyLineEntityItem& PolyLineEntity) -> bool
{ {
return quadEntity.appendPoint(point); return PolyLineEntity.appendPoint(point);
}); });
} }

View file

@ -23,7 +23,7 @@
#include <RegisteredMetaTypes.h> #include <RegisteredMetaTypes.h>
#include "PolyVoxEntityItem.h" #include "PolyVoxEntityItem.h"
#include "LineEntityItem.h" #include "LineEntityItem.h"
#include "QuadEntityItem.h" #include "PolyLineEntityItem.h"
#include "EntityEditPacketSender.h" #include "EntityEditPacketSender.h"
@ -163,7 +163,7 @@ private:
bool actionWorker(const QUuid& entityID, std::function<bool(EntitySimulation*, EntityItemPointer)> actor); bool actionWorker(const QUuid& entityID, std::function<bool(EntitySimulation*, EntityItemPointer)> actor);
bool setVoxels(QUuid entityID, std::function<void(PolyVoxEntityItem&)> actor); bool setVoxels(QUuid entityID, std::function<void(PolyVoxEntityItem&)> actor);
bool setPoints(EntityItemPointer entity, std::function<bool(LineEntityItem&)> actor); bool setPoints(EntityItemPointer entity, std::function<bool(LineEntityItem&)> actor);
bool setPoints(EntityItemPointer entity, std::function<bool(QuadEntityItem&)> actor); bool setPoints(EntityItemPointer entity, std::function<bool(PolyLineEntityItem&)> actor);
void queueEntityMessage(PacketType packetType, EntityItemID entityID, const EntityItemProperties& properties); void queueEntityMessage(PacketType packetType, EntityItemID entityID, const EntityItemProperties& properties);
/// actually does the work of finding the ray intersection, can be called in locking mode or tryLock mode /// actually does the work of finding the ray intersection, can be called in locking mode or tryLock mode

View file

@ -28,7 +28,7 @@
#include "ZoneEntityItem.h" #include "ZoneEntityItem.h"
#include "LineEntityItem.h" #include "LineEntityItem.h"
#include "PolyVoxEntityItem.h" #include "PolyVoxEntityItem.h"
#include "QuadEntityItem.h" #include "PolyLineEntityItem.h"
QMap<EntityTypes::EntityType, QString> EntityTypes::_typeToNameMap; QMap<EntityTypes::EntityType, QString> EntityTypes::_typeToNameMap;
QMap<QString, EntityTypes::EntityType> EntityTypes::_nameToTypeMap; QMap<QString, EntityTypes::EntityType> EntityTypes::_nameToTypeMap;
@ -48,7 +48,7 @@ REGISTER_ENTITY_TYPE(ParticleEffect)
REGISTER_ENTITY_TYPE(Zone) REGISTER_ENTITY_TYPE(Zone)
REGISTER_ENTITY_TYPE(Line) REGISTER_ENTITY_TYPE(Line)
REGISTER_ENTITY_TYPE(PolyVox) REGISTER_ENTITY_TYPE(PolyVox)
REGISTER_ENTITY_TYPE(Quad); REGISTER_ENTITY_TYPE(PolyLine);
const QString& EntityTypes::getEntityTypeName(EntityType entityType) { const QString& EntityTypes::getEntityTypeName(EntityType entityType) {
QMap<EntityType, QString>::iterator matchedTypeName = _typeToNameMap.find(entityType); QMap<EntityType, QString>::iterator matchedTypeName = _typeToNameMap.find(entityType);

View file

@ -46,8 +46,8 @@ public:
Web, Web,
Line, Line,
PolyVox, PolyVox,
Quad, PolyLine,
LAST = Quad LAST = PolyLine
} EntityType; } EntityType;
static const QString& getEntityTypeName(EntityType entityType); static const QString& getEntityTypeName(EntityType entityType);

View file

@ -1,5 +1,5 @@
// //
// QuadEntityItem.cpp // PolyLineEntityItem.cpp
// libraries/entities/src // libraries/entities/src
// //
// Created by Eric Levin on 6/22/15. // Created by Eric Levin on 6/22/15.
@ -14,7 +14,7 @@
#include <ByteCountCoding.h> #include <ByteCountCoding.h>
#include "QuadEntityItem.h" #include "PolyLineEntityItem.h"
#include "EntityTree.h" #include "EntityTree.h"
#include "EntitiesLogging.h" #include "EntitiesLogging.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
@ -22,16 +22,16 @@
const float QuadEntityItem::DEFAULT_LINE_WIDTH = 0.1f; const float PolyLineEntityItem::DEFAULT_LINE_WIDTH = 0.1f;
const int QuadEntityItem::MAX_POINTS_PER_LINE = 70; const int PolyLineEntityItem::MAX_POINTS_PER_LINE = 70;
EntityItemPointer QuadEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) { EntityItemPointer PolyLineEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) {
EntityItemPointer result { new QuadEntityItem(entityID, properties) }; EntityItemPointer result { new PolyLineEntityItem(entityID, properties) };
return result; return result;
} }
QuadEntityItem::QuadEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) : PolyLineEntityItem::PolyLineEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
EntityItem(entityItemID) , EntityItem(entityItemID) ,
_lineWidth(DEFAULT_LINE_WIDTH), _lineWidth(DEFAULT_LINE_WIDTH),
_pointsChanged(true), _pointsChanged(true),
@ -40,12 +40,12 @@ _vertices(QVector<glm::vec3>(0)),
_normals(QVector<glm::vec3>(0)), _normals(QVector<glm::vec3>(0)),
_strokeWidths(QVector<float>(0)) _strokeWidths(QVector<float>(0))
{ {
_type = EntityTypes::Quad; _type = EntityTypes::PolyLine;
_created = properties.getCreated(); _created = properties.getCreated();
setProperties(properties); setProperties(properties);
} }
EntityItemProperties QuadEntityItem::getProperties() const { EntityItemProperties PolyLineEntityItem::getProperties() const {
_quadReadWriteLock.lockForWrite(); _quadReadWriteLock.lockForWrite();
EntityItemProperties properties = EntityItem::getProperties(); // get the properties from our base class EntityItemProperties properties = EntityItem::getProperties(); // get the properties from our base class
@ -66,7 +66,7 @@ EntityItemProperties QuadEntityItem::getProperties() const {
return properties; return properties;
} }
bool QuadEntityItem::setProperties(const EntityItemProperties& properties) { bool PolyLineEntityItem::setProperties(const EntityItemProperties& properties) {
_quadReadWriteLock.lockForWrite(); _quadReadWriteLock.lockForWrite();
bool somethingChanged = false; bool somethingChanged = false;
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
@ -84,7 +84,7 @@ bool QuadEntityItem::setProperties(const EntityItemProperties& properties) {
if (wantDebug) { if (wantDebug) {
uint64_t now = usecTimestampNow(); uint64_t now = usecTimestampNow();
int elapsed = now - getLastEdited(); int elapsed = now - getLastEdited();
qCDebug(entities) << "QuadEntityItem::setProperties() AFTER update... edited AGO=" << elapsed << qCDebug(entities) << "PolyLineEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
"now=" << now << " getLastEdited()=" << getLastEdited(); "now=" << now << " getLastEdited()=" << getLastEdited();
} }
setLastEdited(properties._lastEdited); setLastEdited(properties._lastEdited);
@ -95,7 +95,7 @@ bool QuadEntityItem::setProperties(const EntityItemProperties& properties) {
} }
bool QuadEntityItem::appendPoint(const glm::vec3& point) { bool PolyLineEntityItem::appendPoint(const glm::vec3& point) {
if (_points.size() > MAX_POINTS_PER_LINE - 1) { if (_points.size() > MAX_POINTS_PER_LINE - 1) {
qDebug() << "MAX POINTS REACHED!"; qDebug() << "MAX POINTS REACHED!";
return false; return false;
@ -110,12 +110,12 @@ bool QuadEntityItem::appendPoint(const glm::vec3& point) {
return true; return true;
} }
bool QuadEntityItem::setStrokeWidths(const QVector<float>& strokeWidths ) { bool PolyLineEntityItem::setStrokeWidths(const QVector<float>& strokeWidths ) {
_strokeWidths = strokeWidths; _strokeWidths = strokeWidths;
return true; return true;
} }
bool QuadEntityItem::setNormals(const QVector<glm::vec3>& normals) { bool PolyLineEntityItem::setNormals(const QVector<glm::vec3>& normals) {
if (_points.size () < 2 || _strokeWidths.size() < 2) { if (_points.size () < 2 || _strokeWidths.size() < 2) {
return false; return false;
} }
@ -145,7 +145,7 @@ bool QuadEntityItem::setNormals(const QVector<glm::vec3>& normals) {
return true; return true;
} }
bool QuadEntityItem::setLinePoints(const QVector<glm::vec3>& points) { bool PolyLineEntityItem::setLinePoints(const QVector<glm::vec3>& points) {
if (points.size() > MAX_POINTS_PER_LINE) { if (points.size() > MAX_POINTS_PER_LINE) {
return false; return false;
} }
@ -183,7 +183,7 @@ bool QuadEntityItem::setLinePoints(const QVector<glm::vec3>& points) {
return true; return true;
} }
int QuadEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, int PolyLineEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
ReadBitstreamToTreeParams& args, ReadBitstreamToTreeParams& args,
EntityPropertyFlags& propertyFlags, bool overwriteLocalData) { EntityPropertyFlags& propertyFlags, bool overwriteLocalData) {
_quadReadWriteLock.lockForWrite(); _quadReadWriteLock.lockForWrite();
@ -202,7 +202,7 @@ int QuadEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time // TODO: eventually only include properties changed since the params.lastViewFrustumSent time
EntityPropertyFlags QuadEntityItem::getEntityProperties(EncodeBitstreamParams& params) const { EntityPropertyFlags PolyLineEntityItem::getEntityProperties(EncodeBitstreamParams& params) const {
EntityPropertyFlags requestedProperties = EntityItem::getEntityProperties(params); EntityPropertyFlags requestedProperties = EntityItem::getEntityProperties(params);
requestedProperties += PROP_COLOR; requestedProperties += PROP_COLOR;
requestedProperties += PROP_LINE_WIDTH; requestedProperties += PROP_LINE_WIDTH;
@ -211,7 +211,7 @@ EntityPropertyFlags QuadEntityItem::getEntityProperties(EncodeBitstreamParams& p
return requestedProperties; return requestedProperties;
} }
void QuadEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, void PolyLineEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData, EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData,
EntityPropertyFlags& requestedProperties, EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertyFlags,
@ -228,7 +228,7 @@ void QuadEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBits
APPEND_ENTITY_PROPERTY(PROP_STROKE_WIDTHS, getStrokeWidths()); APPEND_ENTITY_PROPERTY(PROP_STROKE_WIDTHS, getStrokeWidths());
} }
void QuadEntityItem::debugDump() const { void PolyLineEntityItem::debugDump() const {
quint64 now = usecTimestampNow(); quint64 now = usecTimestampNow();
qCDebug(entities) << " QUAD EntityItem id:" << getEntityItemID() << "---------------------------------------------"; qCDebug(entities) << " QUAD EntityItem id:" << getEntityItemID() << "---------------------------------------------";
qCDebug(entities) << " color:" << _color[0] << "," << _color[1] << "," << _color[2]; qCDebug(entities) << " color:" << _color[0] << "," << _color[1] << "," << _color[2];

View file

@ -1,5 +1,5 @@
// //
// QuadEntityItem.h // PolyLineEntityItem.h
// libraries/entities/src // libraries/entities/src
// //
// Created by Seth Alves on 5/11/15. // Created by Seth Alves on 5/11/15.
@ -9,16 +9,16 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
#ifndef hifi_QuadEntityItem_h #ifndef hifi_PolyLineEntityItem_h
#define hifi_QuadEntityItem_h #define hifi_PolyLineEntityItem_h
#include "EntityItem.h" #include "EntityItem.h"
class QuadEntityItem : public EntityItem { class PolyLineEntityItem : public EntityItem {
public: public:
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties); static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
QuadEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties); PolyLineEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties);
ALLOW_INSTANTIATION // This class can be instantiated ALLOW_INSTANTIATION // This class can be instantiated
@ -67,7 +67,7 @@ class QuadEntityItem : public EntityItem {
virtual ShapeType getShapeType() const { return SHAPE_TYPE_LINE; } virtual ShapeType getShapeType() const { return SHAPE_TYPE_LINE; }
// never have a ray intersection pick a QuadEntityItem. // never have a ray intersection pick a PolyLineEntityItem.
virtual bool supportsDetailedRayIntersection() const { return true; } virtual bool supportsDetailedRayIntersection() const { return true; }
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
bool& keepSearching, OctreeElement*& element, float& distance, BoxFace& face, bool& keepSearching, OctreeElement*& element, float& distance, BoxFace& face,
@ -88,4 +88,4 @@ class QuadEntityItem : public EntityItem {
mutable QReadWriteLock _quadReadWriteLock; mutable QReadWriteLock _quadReadWriteLock;
}; };
#endif // hifi_QuadEntityItem_h #endif // hifi_PolyLineEntityItem_h