mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 12:12:32 +02:00
Working on shapes for metavoxel edits.
This commit is contained in:
parent
14267e3902
commit
4dbd2367f4
2 changed files with 62 additions and 0 deletions
|
@ -1135,3 +1135,23 @@ void VoxelMaterialSphereEdit::apply(MetavoxelData& data, const WeakSharedObjectH
|
||||||
VoxelMaterialSphereEditVisitor visitor(center, radius, bounds, granularity, material, averageColor);
|
VoxelMaterialSphereEditVisitor visitor(center, radius, bounds, granularity, material, averageColor);
|
||||||
data.guide(visitor);
|
data.guide(visitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MetavoxelShape::MetavoxelShape(const glm::vec3& translation, const glm::quat& rotation, float scale) :
|
||||||
|
translation(translation),
|
||||||
|
rotation(rotation),
|
||||||
|
scale(scale) {
|
||||||
|
}
|
||||||
|
|
||||||
|
MetavoxelShape::~MetavoxelShape() {
|
||||||
|
}
|
||||||
|
|
||||||
|
MetavoxelSphere::MetavoxelSphere(const glm::vec3& translation, const glm::quat& rotation, float scale) :
|
||||||
|
MetavoxelShape(translation, rotation, scale) {
|
||||||
|
}
|
||||||
|
|
||||||
|
MetavoxelBox::MetavoxelBox(const glm::vec3& translation, const glm::quat& rotation, float scale,
|
||||||
|
float aspectXY, float aspectXZ) :
|
||||||
|
MetavoxelShape(translation, rotation, scale),
|
||||||
|
aspectXY(aspectXY),
|
||||||
|
aspectXZ(aspectXZ) {
|
||||||
|
}
|
||||||
|
|
|
@ -282,4 +282,46 @@ public:
|
||||||
|
|
||||||
DECLARE_STREAMABLE_METATYPE(VoxelMaterialSphereEdit)
|
DECLARE_STREAMABLE_METATYPE(VoxelMaterialSphereEdit)
|
||||||
|
|
||||||
|
/// Abstract base class for shapes.
|
||||||
|
class MetavoxelShape {
|
||||||
|
STREAMABLE
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
STREAM glm::vec3 translation;
|
||||||
|
STREAM glm::quat rotation;
|
||||||
|
STREAM float scale;
|
||||||
|
|
||||||
|
MetavoxelShape(const glm::vec3& translation = glm::vec3(), const glm::quat& rotation = glm::quat(), float scale = 1.0f);
|
||||||
|
virtual ~MetavoxelShape();
|
||||||
|
};
|
||||||
|
|
||||||
|
DECLARE_STREAMABLE_METATYPE(MetavoxelShape)
|
||||||
|
|
||||||
|
// A sphere shape.
|
||||||
|
class MetavoxelSphere : public MetavoxelShape {
|
||||||
|
STREAMABLE
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
MetavoxelSphere(const glm::vec3& translation = glm::vec3(), const glm::quat& rotation = glm::quat(), float scale = 1.0f);
|
||||||
|
};
|
||||||
|
|
||||||
|
DECLARE_STREAMABLE_METATYPE(MetavoxelSphere)
|
||||||
|
|
||||||
|
// A box shape.
|
||||||
|
class MetavoxelBox : public MetavoxelShape {
|
||||||
|
STREAMABLE
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
STREAM float aspectXY;
|
||||||
|
STREAM float aspectXZ;
|
||||||
|
|
||||||
|
MetavoxelBox(const glm::vec3& translation = glm::vec3(), const glm::quat& rotation = glm::quat(), float scale = 1.0f,
|
||||||
|
float aspectXY = 1.0f, float aspectXZ = 1.0f);
|
||||||
|
};
|
||||||
|
|
||||||
|
DECLARE_STREAMABLE_METATYPE(MetavoxelBox)
|
||||||
|
|
||||||
#endif // hifi_MetavoxelMessages_h
|
#endif // hifi_MetavoxelMessages_h
|
||||||
|
|
Loading…
Reference in a new issue