Added postrender
This commit is contained in:
@@ -8,7 +8,7 @@ int const Globals::patch = 2;
|
||||
int Globals::surfaceId = 2;
|
||||
bool Globals::showMouse = true;
|
||||
bool Globals::useMousePoint = false;
|
||||
|
||||
std::stack<Instance*> postRenderStack = std::stack<Instance*>();
|
||||
const std::string Globals::PlaceholderName = "Dynamica";
|
||||
std::vector<Instance*> g_selectedInstances = std::vector<Instance*>();
|
||||
bool running = false;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "DataModelInstance.h"
|
||||
#include <G3DAll.h>
|
||||
#include <stack>
|
||||
|
||||
class Globals
|
||||
{
|
||||
@@ -20,5 +21,6 @@ public:
|
||||
static const std::string PlaceholderName;
|
||||
};
|
||||
|
||||
extern std::stack<Instance*> postRenderStack;
|
||||
extern std::vector<Instance*> g_selectedInstances;
|
||||
extern bool running;
|
||||
@@ -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);
|
||||
|
||||
@@ -10,6 +10,7 @@ public:
|
||||
PartInstance(void);
|
||||
PartInstance(const PartInstance &oinst);
|
||||
Instance* clone() const { return new PartInstance(*this); }
|
||||
void PartInstance::postRender(RenderDevice* rd);
|
||||
~PartInstance(void);
|
||||
virtual void render(RenderDevice*);
|
||||
Vector3 velocity;
|
||||
|
||||
Reference in New Issue
Block a user