void Particle::UpdateDiagnostics(Diagnostic& renderer) { if(renderer.AllowDiagnostics(Diagnostic::TEXT)) { renderer.UpdateText(Diagnostic::TEXT, "Particle Delta", Diagnostic::WHITE, StringCast(m_positionDelta.y));; renderer.UpdateText(Diagnostic::TEXT, "Particle Collision", Diagnostic::WHITE, std::string( (m_collision->IsCollidingWith(Geometry::NONE) ? "NONE " : "")) + (m_collision->IsCollidingWith(Geometry::SPHERE) ? "SPHERE " : "") + (m_collision->IsCollidingWith(Geometry::BOX) ? "BOX " : "") + (m_collision->IsCollidingWith(Geometry::CYLINDER) ? "CYLINDER " : "")); } }
void Geometry::UpdateDiagnostics(Diagnostic& renderer, const D3DXMATRIX& world) { if(renderer.AllowDiagnostics(Diagnostic::MESH)) { std::string id = StringCast(this); const auto& faces = GetFaces(); const float normalsize = 0.6f; for(unsigned int i = 0; i < faces.size(); ++i) { D3DXVECTOR3 center, normal; D3DXVec3TransformCoord(¢er, &faces[i].center, &world); D3DXVec3TransformNormal(&normal, &faces[i].normal, &world); D3DXVec3Normalize(&normal, &normal); renderer.UpdateLine(Diagnostic::MESH, "FaceNormal" + StringCast(i) + id, Diagnostic::CYAN, center, center + (normal * normalsize)); } } }