Added postrender

This commit is contained in:
andreja6
2018-10-25 18:16:39 -07:00
parent b1af53995a
commit 30a05af3b2
5 changed files with 28 additions and 2 deletions

View File

@@ -25,6 +25,24 @@ PartInstance::PartInstance(void) : _bevelSize(0.03f), _parseVert(0), _debugTimer
shape = Enum::Shape::Block;
}
void PartInstance::postRender(RenderDevice *rd)
{
G3D::GFontRef fntdominant = NULL;
if(fntdominant != NULL)
{
Vector3 gamepoint = cFrame.translation;
Vector3 camerapoint = rd->getCameraToWorldMatrix().translation;
float distance = pow(pow((double)gamepoint.x - (double)camerapoint.x, 2) + pow((double)gamepoint.y - (double)camerapoint.y, 2) + pow((double)gamepoint.z - (double)camerapoint.z, 2), 0.5);
if(distance < 50 && distance > -50)
{
if(distance < 0)
distance = distance*-1;
fntdominant->draw3D(rd, "Testing", CoordinateFrame(rd->getCameraToWorldMatrix().rotation, gamepoint), 0.04*distance, Color3::yellow(), Color3::black(), G3D::GFont::XALIGN_CENTER, G3D::GFont::YALIGN_CENTER);
}
}
}
PartInstance::PartInstance(const PartInstance &oinst)
{
PVInstance::PVInstance(oinst);