From ceca6426f88bc765d5163fd924a85e49153cab7a Mon Sep 17 00:00:00 2001 From: Helge Hecht Date: Fri, 19 Jun 2020 19:52:19 +0200 Subject: [PATCH] Added VertexPosition3Color3Normal3Id1 --- .../src/BlueFramework/Rasterizer/vertex.cpp | 5 +++ .../src/BlueFramework/Rasterizer/vertex.h | 36 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/Rasterizer/src/BlueFramework/Rasterizer/vertex.cpp b/Rasterizer/src/BlueFramework/Rasterizer/vertex.cpp index 6833af3..db9009a 100644 --- a/Rasterizer/src/BlueFramework/Rasterizer/vertex.cpp +++ b/Rasterizer/src/BlueFramework/Rasterizer/vertex.cpp @@ -50,6 +50,11 @@ bool operator==(const VertexPosition3Texture2PickId1FaceId1RegionId1& lhs, const return (lhs.position == rhs.position) && (rhs.uv == lhs.uv) && (rhs.pickid == lhs.pickid) && (rhs.faceid == lhs.faceid) && (rhs.regionid == lhs.regionid); } +bool operator==(const VertexPosition3Color3Normal3Id1& lhs, const VertexPosition3Color3Normal3Id1& rhs) +{ + return (lhs.position == rhs.position) && (lhs.color == rhs.color) && (lhs.normal == rhs.normal) && (lhs.id == rhs.id); +} + //---------------------------------------------------------------------------// // Less than //---------------------------------------------------------------------------// diff --git a/Rasterizer/src/BlueFramework/Rasterizer/vertex.h b/Rasterizer/src/BlueFramework/Rasterizer/vertex.h index 5818c76..62be1b6 100644 --- a/Rasterizer/src/BlueFramework/Rasterizer/vertex.h +++ b/Rasterizer/src/BlueFramework/Rasterizer/vertex.h @@ -275,6 +275,40 @@ struct VertexPosition3Color3Normal3 { } }; +struct VertexPosition3Color3Normal3Id1 { +public: + VertexPosition3Color3Normal3Id1() { + } + + VertexPosition3Color3Normal3Id1( + const buw::Vector3f position, + const buw::Vector3f& color, + const buw::Vector3f& normal, + const uint32_t& id) + : + position(position), + color(color), + normal(normal), + id(id) + { } + + Unaligned::Float3 position; + Unaligned::Float3 color; + Unaligned::Float3 normal; + Unaligned::UInt id; + +public: + static VertexLayout getVertexLayout() { + buw::VertexLayout vertexLayout; + vertexLayout.add(buw::eVertexAttributeSemantic::Position, buw::eVertexAttributeFormat::Float3); + vertexLayout.add(buw::eVertexAttributeSemantic::Color, buw::eVertexAttributeFormat::Float3); + vertexLayout.add(buw::eVertexAttributeSemantic::Normal, buw::eVertexAttributeFormat::Float3); + vertexLayout.add(buw::eVertexAttributeSemantic::PickId, buw::eVertexAttributeFormat::UInt); + + return vertexLayout; + } +}; + struct VertexPosition3Color3Texture2 { public: VertexPosition3Color3Texture2() { @@ -436,6 +470,7 @@ bool operator==(const VertexPosition3Color3Normal3& lhs, const VertexPosition3Co bool operator==(const VertexPosition3Normal3Texture2& lhs, const VertexPosition3Normal3Texture2& rhs); bool operator==(const VertexPosition3Color3Texture2& lhs, const VertexPosition3Color3Texture2& rhs); bool operator==(const VertexPosition3Texture2PickId1FaceId1RegionId1& lhs, const VertexPosition3Texture2PickId1FaceId1RegionId1& rhs); +bool operator==(const VertexPosition3Color3Normal3Id1& lhs, const VertexPosition3Color3Normal3Id1& rhs); BLUEFRAMEWORK_RASTERIZER_NAMESPACE_END @@ -456,5 +491,6 @@ BLUE_BLUEFRAMEWORK_RASTERIZER_EMBED_INTO_BUW_NAMESPACE(VertexPosition3Texture3) BLUE_BLUEFRAMEWORK_RASTERIZER_EMBED_INTO_BUW_NAMESPACE(VertexPosition3Texture2PickId1FaceId1RegionId1) BLUE_BLUEFRAMEWORK_RASTERIZER_EMBED_INTO_BUW_NAMESPACE(VertexPosition4) BLUE_BLUEFRAMEWORK_RASTERIZER_EMBED_INTO_BUW_NAMESPACE(VertexPosition4Texture2) +BLUE_BLUEFRAMEWORK_RASTERIZER_EMBED_INTO_BUW_NAMESPACE(VertexPosition3Color3Normal3Id1) #endif // end define BlueFramework_Rasterizer_vertex_96687421_3eaf_4769_80fe_fb2fc11c93da_h