1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00

Comentários em VertexPosition

This commit is contained in:
Danilo 2024-08-05 17:52:51 -03:00
parent 2752335893
commit fe6c1fd1b7

View File

@ -6,70 +6,74 @@
#include "../default.hpp" #include "../default.hpp"
namespace xna { namespace xna {
//Describes a custom vertex format structure that contains position and color information.
struct VertexPositionColor { struct VertexPositionColor {
Vector3 position{}; Vector3 Position{};
Color color{}; xna::Color Color{};
constexpr VertexPositionColor() = default; constexpr VertexPositionColor() = default;
constexpr VertexPositionColor(Vector3 const& position, Color const& color): constexpr VertexPositionColor(Vector3 const& position, xna::Color const& color):
position(position), color(color){} Position(position), Color(color){}
constexpr bool operator==(const VertexPositionColor& other) const { constexpr bool operator==(const VertexPositionColor& other) const {
return position == other.position && color == other.color; return Position == other.Position && Color == other.Color;
} }
}; };
//Describes a custom vertex format structure that contains position and one set of texture coordinates.
struct VertexPositionTexture { struct VertexPositionTexture {
Vector3 position{}; Vector3 Position{};
Vector2 textureCoordinate{}; Vector2 TextureCoordinate{};
constexpr VertexPositionTexture() = default; constexpr VertexPositionTexture() = default;
constexpr bool operator==(const VertexPositionTexture& other) const { constexpr bool operator==(const VertexPositionTexture& other) const {
return position == other.position return Position == other.Position
&& textureCoordinate == other.textureCoordinate; && TextureCoordinate == other.TextureCoordinate;
} }
constexpr VertexPositionTexture(const Vector3& position, const Vector2& textureCoordinate) constexpr VertexPositionTexture(const Vector3& position, const Vector2& textureCoordinate)
: position(position), textureCoordinate(textureCoordinate) : Position(position), TextureCoordinate(textureCoordinate)
{ {
} }
}; };
//Describes a custom vertex format structure that contains position, color, and one set of texture coordinates.
struct VertexPositionColorTexture { struct VertexPositionColorTexture {
Vector3 position{}; Vector3 Position{};
Vector2 textureCoodinate{}; Vector2 TextureCoodinate{};
Color color{}; xna::Color Color{};
constexpr VertexPositionColorTexture() = default; constexpr VertexPositionColorTexture() = default;
constexpr bool operator==(const VertexPositionColorTexture& other) const { constexpr bool operator==(const VertexPositionColorTexture& other) const {
return position == other.position return Position == other.Position
&& textureCoodinate == other.textureCoodinate && TextureCoodinate == other.TextureCoodinate
&& color == other.color; && Color == other.Color;
} }
constexpr VertexPositionColorTexture(const Vector3& position, const Vector2& textureCoodinate, const Color& color) constexpr VertexPositionColorTexture(const Vector3& position, const Vector2& textureCoodinate, const xna::Color& color)
: position(position), textureCoodinate(textureCoodinate), color(color) : Position(position), TextureCoodinate(textureCoodinate), Color(color)
{ {
} }
}; };
//Describes a custom vertex format structure that contains position, normal data, and one set of texture coordinates.
struct VertexPositionNormalTexture { struct VertexPositionNormalTexture {
Vector3 position{}; Vector3 Position{};
Vector3 normal{}; Vector3 Normal{};
Vector2 textureCoodinate{}; Vector2 TextureCoodinate{};
constexpr VertexPositionNormalTexture() = default; constexpr VertexPositionNormalTexture() = default;
bool operator==(const VertexPositionNormalTexture& other) const { bool operator==(const VertexPositionNormalTexture& other) const {
return position == other.position return Position == other.Position
&& normal == other.normal && Normal == other.Normal
&& textureCoodinate == other.textureCoodinate; && TextureCoodinate == other.TextureCoodinate;
} }
constexpr VertexPositionNormalTexture(const Vector3& position, const Vector3& normal, const Vector2& textureCoodinate) constexpr VertexPositionNormalTexture(const Vector3& position, const Vector3& normal, const Vector2& textureCoodinate)
: position(position), normal(normal), textureCoodinate(textureCoodinate) : Position(position), Normal(normal), TextureCoodinate(textureCoodinate)
{ {
} }
}; };