mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-25 09:57:53 +02:00
73 lines
3.4 KiB
C++
73 lines
3.4 KiB
C++
//
|
|
// LineEntityItem.h
|
|
// libraries/entities/src
|
|
//
|
|
// Created by Seth Alves on 5/11/15.
|
|
// Copyright 2015 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
#ifndef hifi_LineEntityItem_h
|
|
#define hifi_LineEntityItem_h
|
|
|
|
#include "EntityItem.h"
|
|
|
|
class LineEntityItem : public EntityItem {
|
|
public:
|
|
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
|
|
|
LineEntityItem(const EntityItemID& entityItemID);
|
|
|
|
ALLOW_INSTANTIATION // This class can be instantiated
|
|
|
|
// methods for getting/setting all properties of an entity
|
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
|
|
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
|
|
|
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
|
|
EntityTreeElementExtraEncodeDataPointer modelTreeElementExtraEncodeData,
|
|
EntityPropertyFlags& requestedProperties,
|
|
EntityPropertyFlags& propertyFlags,
|
|
EntityPropertyFlags& propertiesDidntFit,
|
|
int& propertyCount,
|
|
OctreeElement::AppendState& appendState) const override;
|
|
|
|
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
|
ReadBitstreamToTreeParams& args,
|
|
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
|
bool& somethingChanged) override;
|
|
|
|
glm::u8vec3 getColor() const;
|
|
void setColor(const glm::u8vec3& value);
|
|
|
|
bool setLinePoints(const QVector<glm::vec3>& points);
|
|
bool appendPoint(const glm::vec3& point);
|
|
|
|
QVector<glm::vec3> getLinePoints() const;
|
|
|
|
// never have a ray intersection pick a LineEntityItem.
|
|
virtual bool supportsDetailedIntersection() const override { return true; }
|
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
|
OctreeElementPointer& element, float& distance,
|
|
BoxFace& face, glm::vec3& surfaceNormal,
|
|
QVariantMap& extraInfo,
|
|
bool precisionPicking) const override { return false; }
|
|
virtual bool findDetailedParabolaIntersection(const glm::vec3& origin, const glm::vec3& velocity,
|
|
const glm::vec3& acceleration, OctreeElementPointer& element, float& parabolicDistance,
|
|
BoxFace& face, glm::vec3& surfaceNormal,
|
|
QVariantMap& extraInfo,
|
|
bool precisionPicking) const override { return false; }
|
|
|
|
virtual void debugDump() const override;
|
|
static const int MAX_POINTS_PER_LINE;
|
|
|
|
private:
|
|
glm::u8vec3 _color;
|
|
QVector<glm::vec3> _points;
|
|
};
|
|
|
|
#endif // hifi_LineEntityItem_h
|