Added basic shape stuff

This commit is contained in:
andreja6
2018-10-24 20:49:26 -07:00
parent d2e0b29051
commit c50d2a8166
4 changed files with 21 additions and 1 deletions

View File

@@ -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);