11 #ifndef hifi_LaserPointer_h
12 #define hifi_LaserPointer_h
14 #include "PathPointer.h"
16 #include<EntityItemProperties.h>
18 class LaserPointer :
public PathPointer {
19 using Parent = PathPointer;
21 class RenderState :
public StartEndRenderState {
24 RenderState(
const QUuid& startID,
const QUuid& pathID,
const QUuid& endID);
26 const QUuid& getPathID()
const {
return _pathID; }
27 const bool& doesPathIgnorePicks()
const {
return _pathIgnorePicks; }
29 void setLineWidth(
float width) { _lineWidth = width; }
30 float getLineWidth()
const {
return _lineWidth; }
32 void cleanup()
override;
33 void disable()
override;
34 void update(
const glm::vec3& origin,
const glm::vec3& end,
const glm::vec3& surfaceNormal,
float parentScale,
bool distanceScaleEnd,
bool centerEndY,
35 bool faceAvatar,
bool followNormal,
float followNormalStrength,
float distance,
const PickResultPointer& pickResult)
override;
40 bool _pathIgnorePicks;
44 LaserPointer(
const QVariant& rayProps,
const RenderStateMap& renderStates,
const DefaultRenderStateMap& defaultRenderStates,
bool hover,
const PointerTriggers& triggers,
45 bool faceAvatar,
bool followNormal,
float followNormalStrength,
bool centerEndY,
bool lockEnd,
bool distanceScaleEnd,
bool scaleWithParent,
bool enabled);
47 PickQuery::PickType getType()
const override;
49 QVariantMap toVariantMap()
const override;
51 static std::shared_ptr<StartEndRenderState> buildRenderState(
const QVariantMap& propMap,
const QList<EntityItemProperties> &entityProperties);
54 PickResultPointer getPickResultCopy(
const PickResultPointer& pickResult)
const override;
56 void editRenderStatePath(
const std::string& state,
const QVariant& pathProps)
override;
58 glm::vec3 getPickOrigin(
const PickResultPointer& pickResult)
const override;
59 glm::vec3 getPickEnd(
const PickResultPointer& pickResult,
float distance)
const override;
60 glm::vec3 getPickedObjectNormal(
const PickResultPointer& pickResult)
const override;
61 IntersectionType getPickedObjectType(
const PickResultPointer& pickResult)
const override;
62 QUuid getPickedObjectID(
const PickResultPointer& pickResult)
const override;
63 void setVisualPickResultInternal(PickResultPointer pickResult, IntersectionType type,
const QUuid&
id,
64 const glm::vec3& intersection,
float distance,
const glm::vec3& surfaceNormal)
override;
66 PointerEvent buildPointerEvent(
const PickedObject& target,
const PickResultPointer& pickResult,
const std::string& button =
"",
bool hover =
true)
override;
69 static glm::vec3 findIntersection(
const PickedObject& pickedObject,
const glm::vec3& origin,
const glm::vec3& direction);
Represents a 2D or 3D pointer to the scripting engine. Exposed as PointerEvent
Definition: PointerEvent.h:30