Added getMass to part
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="G3DTest"
|
||||
ProjectGUID="{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}"
|
||||
ProjectGUID="{277D185B-AEBA-4F75-A7FC-F1EBE787C200}"
|
||||
RootNamespace="G3DTest"
|
||||
>
|
||||
<Platforms>
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
void debugPrintVertexIDs(RenderDevice* rd, GFontRef font, Matrix3 camRot);
|
||||
void makeFace(int vertex1, int vertex2, int vertex3);
|
||||
bool isUniqueVertex(Vector3 pos);
|
||||
float getMass();
|
||||
private:
|
||||
Vector3 position;
|
||||
Vector3 size;
|
||||
|
||||
Reference in New Issue
Block a user