Skip to content

Commit

Permalink
Added VertexPosition3Color3Normal3Id1
Browse files Browse the repository at this point in the history
  • Loading branch information
Helge Hecht committed Jun 19, 2020
1 parent c102d54 commit ceca642
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Rasterizer/src/BlueFramework/Rasterizer/vertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//---------------------------------------------------------------------------//
Expand Down
36 changes: 36 additions & 0 deletions Rasterizer/src/BlueFramework/Rasterizer/vertex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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

Expand All @@ -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

0 comments on commit ceca642

Please sign in to comment.