bug fix:正方体遮挡判断问题
This commit is contained in:
parent
55a96143fc
commit
b5f81958df
|
|
@ -30,5 +30,11 @@ namespace RenderData
|
||||||
if (value > 255) return 255;
|
if (value > 255) return 255;
|
||||||
return static_cast<uint8_t>(value);
|
return static_cast<uint8_t>(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Color Red() { return Color(255, 0, 0, 255); }
|
||||||
|
static Color Green() { return Color(0, 255, 0, 255); }
|
||||||
|
static Color Blue() { return Color(0, 0, 255, 255); }
|
||||||
|
static Color White() { return Color(255, 255, 255, 255); }
|
||||||
|
static Color Black() { return Color(0, 0, 0, 255); }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -171,7 +171,7 @@ static bool IsFaceVisible(const CubeFace& face, const std::array<Math::Vector3,
|
||||||
viewSpaceVertices[face.vertices[2]] +
|
viewSpaceVertices[face.vertices[2]] +
|
||||||
viewSpaceVertices[face.vertices[3]]) / 4.0f;
|
viewSpaceVertices[face.vertices[3]]) / 4.0f;
|
||||||
|
|
||||||
return faceNormal.dot(faceCenter) < 0.0f;
|
return faceNormal.dot(faceCenter) > 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue