Graphics: Add origin to all sprite-based renderables (and made it a factor)

This commit is contained in:
SirLynix
2022-12-17 14:48:50 +01:00
parent 0537be3201
commit d4422c4102
12 changed files with 98 additions and 38 deletions

View File

@@ -33,6 +33,8 @@ namespace Nz
inline const Corner& GetBottomRightCorner() const;
const std::shared_ptr<MaterialInstance>& GetMaterial(std::size_t i = 0) const override;
std::size_t GetMaterialCount() const override;
inline const Vector2f& GetOrigin() const;
inline const Vector2f& GetSize() const;
inline const Corner& GetTopLeftCorner() const;
inline const Rectf& GetTextureCoords() const;
Vector3ui GetTextureSize() const;
@@ -42,6 +44,7 @@ namespace Nz
inline void SetCornersSize(const Vector2f& topLeftSize, const Vector2f& bottomRightSize);
inline void SetCornersTextureCoords(const Vector2f& topLeftTextureCoords, const Vector2f& bottomRightTextureCoords);
inline void SetMaterial(std::shared_ptr<MaterialInstance> material);
inline void SetOrigin(const Vector2f& origin);
inline void SetSize(const Vector2f& size);
inline void SetTextureCoords(const Rectf& textureCoords);
inline void SetTextureRect(const Rectf& textureRect);
@@ -65,6 +68,7 @@ namespace Nz
Corner m_topLeftCorner;
Corner m_bottomRightCorner;
Rectf m_textureCoords;
Vector2f m_origin;
Vector2f m_size;
};
}