Added postrender
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user