mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 08:33:05 +02:00
85 lines
3.5 KiB
C++
85 lines
3.5 KiB
C++
//
|
|
// SkyboxPropertyGroup.h
|
|
// libraries/entities/src
|
|
//
|
|
// Created by Brad Hefta-Gaub on 12/4/13.
|
|
// Copyright 2013 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_SkyboxPropertyGroup_h
|
|
#define hifi_SkyboxPropertyGroup_h
|
|
|
|
#include <QtScript/QScriptEngine>
|
|
|
|
#include "PropertyGroup.h"
|
|
#include "EntityItemPropertiesMacros.h"
|
|
|
|
class EntityItemProperties;
|
|
class EncodeBitstreamParams;
|
|
class OctreePacketData;
|
|
class EntityTreeElementExtraEncodeData;
|
|
class ReadBitstreamToTreeParams;
|
|
|
|
#include <stdint.h>
|
|
#include <glm/glm.hpp>
|
|
|
|
|
|
class SkyboxPropertyGroup : public PropertyGroup {
|
|
public:
|
|
SkyboxPropertyGroup();
|
|
virtual ~SkyboxPropertyGroup() {}
|
|
|
|
// EntityItemProperty related helpers
|
|
virtual void copyToScriptValue(QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
|
virtual void debugDump() const;
|
|
|
|
virtual bool appentToEditPacket(OctreePacketData* packetData,
|
|
EntityPropertyFlags& requestedProperties,
|
|
EntityPropertyFlags& propertyFlags,
|
|
EntityPropertyFlags& propertiesDidntFit,
|
|
int& propertyCount,
|
|
OctreeElement::AppendState& appendState) const;
|
|
|
|
virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes);
|
|
virtual void markAllChanged();
|
|
virtual EntityPropertyFlags getChangedProperties() const;
|
|
|
|
// EntityItem related helpers
|
|
// methods for getting/setting all properties of an entity
|
|
virtual void getProperties(EntityItemProperties& propertiesOut) const;
|
|
|
|
/// returns true if something changed
|
|
virtual bool setProperties(const EntityItemProperties& properties);
|
|
|
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
|
|
|
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
|
|
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData,
|
|
EntityPropertyFlags& requestedProperties,
|
|
EntityPropertyFlags& propertyFlags,
|
|
EntityPropertyFlags& propertiesDidntFit,
|
|
int& propertyCount,
|
|
OctreeElement::AppendState& appendState) const;
|
|
|
|
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
|
ReadBitstreamToTreeParams& args,
|
|
EntityPropertyFlags& propertyFlags, bool overwriteLocalData);
|
|
|
|
glm::vec3 getColorVec3() const {
|
|
const quint8 MAX_COLOR = 255;
|
|
glm::vec3 color = { (float)_color.red / (float)MAX_COLOR,
|
|
(float)_color.green / (float)MAX_COLOR,
|
|
(float)_color.blue / (float)MAX_COLOR };
|
|
return color;
|
|
}
|
|
|
|
|
|
DEFINE_PROPERTY_REF(PROP_SKYBOX_COLOR, Color, color, xColor);
|
|
DEFINE_PROPERTY_REF(PROP_SKYBOX_URL, URL, url, QString);
|
|
};
|
|
|
|
#endif // hifi_SkyboxPropertyGroup_h
|