diff --git a/Enum.h b/Enum.h index 4e70d15..5de2af4 100644 --- a/Enum.h +++ b/Enum.h @@ -6,4 +6,10 @@ namespace Enum Smooth, Bumps, Welds, Glue }; } + namespace Shape + { + enum Value { + Block, Sphere, Cylinder + }; + } } \ No newline at end of file diff --git a/PartInstance.cpp b/PartInstance.cpp index 7c1f2e1..8a1c627 100644 --- a/PartInstance.cpp +++ b/PartInstance.cpp @@ -20,6 +20,7 @@ PartInstance::PartInstance(void) back = Enum::SurfaceType::Smooth; left = Enum::SurfaceType::Smooth; bottom = Enum::SurfaceType::Smooth; + shape = Enum::Shape::Block; } PartInstance::PartInstance(const PartInstance &oinst) @@ -42,6 +43,7 @@ PartInstance::PartInstance(const PartInstance &oinst) back = oinst.back; left = oinst.left; bottom = oinst.bottom; + shape = oinst.shape; } void PartInstance::setSize(Vector3 newSize) @@ -67,6 +69,16 @@ void PartInstance::setSize(Vector3 newSize) if(sizez > 512) sizez = 512; + if(shape != Enum::Shape::Block) + { + int max = sizex; + if(sizey > max) + max = sizey; + if(sizez > max) + max = sizez; + sizex = sizey = sizez = max; + } + size = Vector3(sizex, sizey, sizez); diff --git a/PartInstance.h b/PartInstance.h index ccdbd45..84c4fe2 100644 --- a/PartInstance.h +++ b/PartInstance.h @@ -17,6 +17,7 @@ public: Enum::SurfaceType::Value back; Enum::SurfaceType::Value left; Enum::SurfaceType::Value bottom; + Enum::Shape::Value shape; CoordinateFrame cFrame; Color3 color; Vector3 getPosition(); diff --git a/main.cpp b/main.cpp index 18389da..90b1ef6 100644 --- a/main.cpp +++ b/main.cpp @@ -1266,6 +1266,7 @@ void Demo::onGraphics(RenderDevice* rd) { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); std::vector instances = dataModel->getWorkspace()->getAllChildren(); + currentcursorid = cursorid; for(size_t i = 0; i < instances.size(); i++) { if(PartInstance* test = dynamic_cast(instances.at(i))) @@ -1277,7 +1278,7 @@ void Demo::onGraphics(RenderDevice* rd) { currentcursorid = cursorOvrid; break; } - else currentcursorid = cursorid; + } }