mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:47:34 +00:00
LibSoftGPU: Switch to using east const in Clipper.[h,cpp]
This commit is contained in:
parent
66216d3af6
commit
0da3a2ddde
2 changed files with 6 additions and 6 deletions
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace SoftGPU {
|
||||
|
||||
bool Clipper::point_within_clip_plane(const FloatVector4& vertex, ClipPlane plane)
|
||||
bool Clipper::point_within_clip_plane(FloatVector4 const& vertex, ClipPlane plane)
|
||||
{
|
||||
switch (plane) {
|
||||
case ClipPlane::LEFT:
|
||||
|
@ -31,7 +31,7 @@ bool Clipper::point_within_clip_plane(const FloatVector4& vertex, ClipPlane plan
|
|||
return false;
|
||||
}
|
||||
|
||||
Vertex Clipper::clip_intersection_point(const Vertex& p1, const Vertex& p2, ClipPlane plane_index)
|
||||
Vertex Clipper::clip_intersection_point(Vertex const& p1, Vertex const& p2, ClipPlane plane_index)
|
||||
{
|
||||
// See https://www.microsoft.com/en-us/research/wp-content/uploads/1978/01/p245-blinn.pdf
|
||||
// "Clipping Using Homogeneous Coordinates" Blinn/Newell, 1978
|
||||
|
@ -65,8 +65,8 @@ void Clipper::clip_triangle_against_frustum(Vector<Vertex>& input_verts)
|
|||
write_to->clear_with_capacity();
|
||||
// Save me, C++23
|
||||
for (size_t i = 0; i < read_from->size(); i++) {
|
||||
const auto& curr_vec = read_from->at((i + 1) % read_from->size());
|
||||
const auto& prev_vec = read_from->at(i);
|
||||
auto const& curr_vec = read_from->at((i + 1) % read_from->size());
|
||||
auto const& prev_vec = read_from->at(i);
|
||||
|
||||
if (point_within_clip_plane(curr_vec.clip_coordinates, static_cast<ClipPlane>(plane))) {
|
||||
if (!point_within_clip_plane(prev_vec.clip_coordinates, static_cast<ClipPlane>(plane))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue