Added getMass to part

This commit is contained in:
DirtPiper
2019-10-26 15:54:48 -04:00
parent 3417a34f37
commit 4a82c67fdc
3 changed files with 14 additions and 1 deletions

View File

@@ -149,6 +149,18 @@ CoordinateFrame PartInstance::getCFrameRenderBased()
{
return cFrame;//CoordinateFrame(getCFrame().rotation,Vector3(getCFrame().translation.x, getCFrame().translation.y, getCFrame().translation.z));
}
// Start Physics stuff
float PartInstance::getMass()
{
if(shape == Enum::Shape::Sphere || shape == Enum::Shape::Cylinder){
return (4/3) * 3.1415926535 * pow(size.x/2, 3);
}
return size.x * size.y * size.z;
}
#ifdef NEW_BOX_RENDER
Box PartInstance::getBox()
{