Skip to content

Commit 1aff083

Browse files
committed
fixed uv type
1 parent 6414922 commit 1aff083

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

examples/example_glfw3.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ int main()
173173
Vector3<float> p110{0.5f, 0.5f, -0.5f};
174174
Vector3<float> p111{0.5f, 0.5f, 0.5f};
175175

176-
VertexType v0{p000, Vector3<float>{-1, -1, -1}, Vector3<float>{0, 0, 0}};
177-
VertexType v1{p001, Vector3<float>{-1, -1, 1}, Vector3<float>{0, 1, 0}};
178-
VertexType v2{p010, Vector3<float>{-1, 1, -1}, Vector3<float>{1, 0, 0}};
179-
VertexType v3{p011, Vector3<float>{-1, 1, 1}, Vector3<float>{1, 1, 0}};
180-
VertexType v4{p100, Vector3<float>{1, -1, -1}, Vector3<float>{0, 0, 1}};
181-
VertexType v5{p101, Vector3<float>{1, -1, 1}, Vector3<float>{0, 1, 1}};
182-
VertexType v6{p110, Vector3<float>{1, 1, -1}, Vector3<float>{1, 0, 1}};
183-
VertexType v7{p111, Vector3<float>{1, 1, 1}, Vector3<float>{1, 1, 1}};
176+
VertexType v0{p000, Vector3<float>{-1, -1, -1}, omath::Vector2<float>{0, 0}};
177+
VertexType v1{p001, Vector3<float>{-1, -1, 1}, omath::Vector2<float>{0, 1}};
178+
VertexType v2{p010, Vector3<float>{-1, 1, -1}, omath::Vector2<float>{1, 0}};
179+
VertexType v3{p011, Vector3<float>{-1, 1, 1}, omath::Vector2<float>{1, 1}};
180+
VertexType v4{p100, Vector3<float>{1, -1, -1}, omath::Vector2<float>{0, 0}};
181+
VertexType v5{p101, Vector3<float>{1, -1, 1}, omath::Vector2<float>{0, 1}};
182+
VertexType v6{p110, Vector3<float>{1, 1, -1}, omath::Vector2<float>{1, 0}};
183+
VertexType v7{p111, Vector3<float>{1, 1, 1}, omath::Vector2<float>{1, 1}};
184184

185185
vbo.push_back(v0); // 0
186186
vbo.push_back(v1); // 1

include/omath/3d_primitives/mesh.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
namespace omath::primitives
1313
{
14-
template<class T = Vector3<float>>
14+
template<class VecType = Vector3<float>, class UvT = Vector2<float>>
1515
struct Vertex final
1616
{
17-
using VectorType = T;
17+
using VectorType = VecType;
18+
using UvType = UvT;
1819
VectorType position;
1920
VectorType normal;
20-
VectorType uv;
21+
UvType uv;
2122
};
2223

2324
template<typename T> concept HasPosition = requires(T vertex) { vertex.position; };

include/omath/collision/epa_algorithm.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace omath::collision
2424
class Epa final
2525
{
2626
public:
27-
using VectorType = typename ColliderType::VectorType;
27+
using VectorType = ColliderType::VectorType;
2828
static_assert(EpaVector<VectorType>, "VertexType must satisfy EpaVector concept");
2929

3030
struct Result final
@@ -45,8 +45,8 @@ namespace omath::collision
4545

4646
// Precondition: simplex.size()==4 and contains the origin.
4747
[[nodiscard]]
48-
static std::optional<Result> solve(const ColliderType& a, const ColliderType& b, const Simplex<VectorType>& simplex,
49-
const Params params = {})
48+
static std::optional<Result> solve(const ColliderType& a, const ColliderType& b,
49+
const Simplex<VectorType>& simplex, const Params params = {})
5050
{
5151
// --- Build initial polytope from simplex (4 points) ---
5252
std::vector<VectorType> vertexes;

0 commit comments

Comments
 (0)