mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
54 lines
1.9 KiB
C++
54 lines
1.9 KiB
C++
//
|
|
// BoxEntityItem.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_BoxEntityItem_h
|
|
#define hifi_BoxEntityItem_h
|
|
|
|
#include "EntityItem.h"
|
|
|
|
class BoxEntityItem : public EntityItem {
|
|
public:
|
|
static EntityItem* factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
|
|
|
BoxEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties);
|
|
|
|
virtual void somePureVirtualFunction() { }; // allow this class to be constructed
|
|
|
|
// methods for getting/setting all properties of an entity
|
|
virtual EntityItemProperties getProperties() const;
|
|
virtual void setProperties(const EntityItemProperties& properties, bool forceCopy = false);
|
|
|
|
virtual OctreeElement::AppendState appendEntityData(OctreePacketData* packetData, EncodeBitstreamParams& params,
|
|
EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData) const;
|
|
|
|
|
|
virtual int readEntityDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args);
|
|
|
|
|
|
// TODO: Move these to subclasses, or other appropriate abstraction
|
|
// getters/setters applicable to models and particles
|
|
|
|
const rgbColor& getColor() const { return _color; }
|
|
xColor getXColor() const { xColor color = { _color[RED_INDEX], _color[GREEN_INDEX], _color[BLUE_INDEX] }; return color; }
|
|
|
|
void setColor(const rgbColor& value) { memcpy(_color, value, sizeof(_color)); }
|
|
void setColor(const xColor& value) {
|
|
_color[RED_INDEX] = value.red;
|
|
_color[GREEN_INDEX] = value.green;
|
|
_color[BLUE_INDEX] = value.blue;
|
|
}
|
|
|
|
protected:
|
|
|
|
rgbColor _color;
|
|
};
|
|
|
|
#endif // hifi_BoxEntityItem_h
|