bool TextureMap::hasZeroAlpha(const Primitive* primitive, const Point3D& p) const { if (m_textureMap.elements() < 4) { return false; } int coords[2]; if (!getMapCoords(primitive, p, coords)) { return false; } return m_textureMap(coords[0], coords[1], 3) != 1.0; }
Colour TextureMap::getDiffuse(const Primitive* primitive, const Point3D& p) const { int coords[2]; if (!getMapCoords(primitive, p, coords)) { return Colour(0.0); } int x = coords[0]; int y = coords[1]; return Colour(m_textureMap(x, y, 0), m_textureMap(x, y, 1), m_textureMap(x, y, 2)); }
// ------------------------------------------------------------------ // Name : getMapCoords // ------------------------------------------------------------------ CoordsMap DisplayEngine::getMapCoords(CoordsScreen screenCoords) { screenCoords.z = BOARDPLANE; Coords3D coords3D = get3DCoords(screenCoords, DMS_3D); return getMapCoords(coords3D); }