Allow showing 3D quad in track debug better
This commit is contained in:
parent
3187c7e0f9
commit
8a0a9b2617
@ -49,6 +49,8 @@ public:
|
|||||||
virtual void getDistances(const Vec3 &xyz, Vec3 *result) const OVERRIDE;
|
virtual void getDistances(const Vec3 &xyz, Vec3 *result) const OVERRIDE;
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
virtual float getDistance2FromPoint(const Vec3 &xyz) const OVERRIDE;
|
virtual float getDistance2FromPoint(const Vec3 &xyz) const OVERRIDE;
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
virtual bool is3DQuad() const OVERRIDE { return true; }
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,25 +46,17 @@ void Quad::getVertices(video::S3DVertex *v, const video::SColor &color) const
|
|||||||
{
|
{
|
||||||
// Eps is used to raise the track debug quads a little bit higher than
|
// Eps is used to raise the track debug quads a little bit higher than
|
||||||
// the ground, so that they are actually visible.
|
// the ground, so that they are actually visible.
|
||||||
core::vector3df eps(0, 0.1f, 0);
|
core::vector3df normal = getNormal().toIrrVector();
|
||||||
|
core::vector3df eps = normal * 0.1f;
|
||||||
v[0].Pos = m_p[0].toIrrVector()+eps;
|
v[0].Pos = m_p[0].toIrrVector()+eps;
|
||||||
v[1].Pos = m_p[1].toIrrVector()+eps;
|
v[1].Pos = m_p[1].toIrrVector()+eps;
|
||||||
v[2].Pos = m_p[2].toIrrVector()+eps;
|
v[2].Pos = m_p[2].toIrrVector()+eps;
|
||||||
v[3].Pos = m_p[3].toIrrVector()+eps;
|
v[3].Pos = m_p[3].toIrrVector()+eps;
|
||||||
|
|
||||||
core::triangle3df tri(m_p[0].toIrrVector(), m_p[1].toIrrVector(),
|
|
||||||
m_p[2].toIrrVector());
|
|
||||||
core::vector3df normal = tri.getNormal();
|
|
||||||
normal.normalize();
|
|
||||||
v[0].Normal = normal;
|
v[0].Normal = normal;
|
||||||
v[1].Normal = normal;
|
v[1].Normal = normal;
|
||||||
v[2].Normal = normal;
|
v[2].Normal = normal;
|
||||||
|
v[3].Normal = normal;
|
||||||
core::triangle3df tri1(m_p[0].toIrrVector(), m_p[2].toIrrVector(),
|
|
||||||
m_p[3].toIrrVector());
|
|
||||||
core::vector3df normal1 = tri1.getNormal();
|
|
||||||
normal1.normalize();
|
|
||||||
v[3].Normal = normal1;
|
|
||||||
|
|
||||||
v[0].Color = color;
|
v[0].Color = color;
|
||||||
v[1].Color = color;
|
v[1].Color = color;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user