Fix part collisions

This commit is contained in:
2022-10-05 22:53:54 -04:00
parent 8fa056e191
commit 728e67e1a5

View File

@@ -202,8 +202,8 @@ void PartInstance::setSize(Vector3 newSize)
size = Vector3(sizex, sizey, sizez); size = Vector3(sizex, sizey, sizez);
g_dataModel->getEngine()->deleteBody(this);
g_dataModel->getEngine()->createBody(this);
} }
Vector3 PartInstance::getSize() Vector3 PartInstance::getSize()
{ {
@@ -224,6 +224,8 @@ void PartInstance::setShape(Enum::Shape::Value shape)
this->shape = shape; this->shape = shape;
this->setSize(this->getSize()); this->setSize(this->getSize());
} }
g_dataModel->getEngine()->deleteBody(this);
g_dataModel->getEngine()->createBody(this);
changed = true; changed = true;
} }
@@ -237,6 +239,7 @@ void PartInstance::setAnchored(bool anchored)
{ {
this->anchored = anchored; this->anchored = anchored;
g_dataModel->getEngine()->deleteBody(this); g_dataModel->getEngine()->deleteBody(this);
g_dataModel->getEngine()->createBody(this);
} }
bool PartInstance::isAnchored() bool PartInstance::isAnchored()