mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
fixed uv type
This commit is contained in:
@@ -173,14 +173,14 @@ int main()
|
||||
Vector3<float> p110{0.5f, 0.5f, -0.5f};
|
||||
Vector3<float> p111{0.5f, 0.5f, 0.5f};
|
||||
|
||||
VertexType v0{p000, Vector3<float>{-1, -1, -1}, Vector3<float>{0, 0, 0}};
|
||||
VertexType v1{p001, Vector3<float>{-1, -1, 1}, Vector3<float>{0, 1, 0}};
|
||||
VertexType v2{p010, Vector3<float>{-1, 1, -1}, Vector3<float>{1, 0, 0}};
|
||||
VertexType v3{p011, Vector3<float>{-1, 1, 1}, Vector3<float>{1, 1, 0}};
|
||||
VertexType v4{p100, Vector3<float>{1, -1, -1}, Vector3<float>{0, 0, 1}};
|
||||
VertexType v5{p101, Vector3<float>{1, -1, 1}, Vector3<float>{0, 1, 1}};
|
||||
VertexType v6{p110, Vector3<float>{1, 1, -1}, Vector3<float>{1, 0, 1}};
|
||||
VertexType v7{p111, Vector3<float>{1, 1, 1}, Vector3<float>{1, 1, 1}};
|
||||
VertexType v0{p000, Vector3<float>{-1, -1, -1}, omath::Vector2<float>{0, 0}};
|
||||
VertexType v1{p001, Vector3<float>{-1, -1, 1}, omath::Vector2<float>{0, 1}};
|
||||
VertexType v2{p010, Vector3<float>{-1, 1, -1}, omath::Vector2<float>{1, 0}};
|
||||
VertexType v3{p011, Vector3<float>{-1, 1, 1}, omath::Vector2<float>{1, 1}};
|
||||
VertexType v4{p100, Vector3<float>{1, -1, -1}, omath::Vector2<float>{0, 0}};
|
||||
VertexType v5{p101, Vector3<float>{1, -1, 1}, omath::Vector2<float>{0, 1}};
|
||||
VertexType v6{p110, Vector3<float>{1, 1, -1}, omath::Vector2<float>{1, 0}};
|
||||
VertexType v7{p111, Vector3<float>{1, 1, 1}, omath::Vector2<float>{1, 1}};
|
||||
|
||||
vbo.push_back(v0); // 0
|
||||
vbo.push_back(v1); // 1
|
||||
|
||||
@@ -11,13 +11,14 @@
|
||||
|
||||
namespace omath::primitives
|
||||
{
|
||||
template<class T = Vector3<float>>
|
||||
template<class VecType = Vector3<float>, class UvT = Vector2<float>>
|
||||
struct Vertex final
|
||||
{
|
||||
using VectorType = T;
|
||||
using VectorType = VecType;
|
||||
using UvType = UvT;
|
||||
VectorType position;
|
||||
VectorType normal;
|
||||
VectorType uv;
|
||||
UvType uv;
|
||||
};
|
||||
|
||||
template<typename T> concept HasPosition = requires(T vertex) { vertex.position; };
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace omath::collision
|
||||
class Epa final
|
||||
{
|
||||
public:
|
||||
using VectorType = typename ColliderType::VectorType;
|
||||
using VectorType = ColliderType::VectorType;
|
||||
static_assert(EpaVector<VectorType>, "VertexType must satisfy EpaVector concept");
|
||||
|
||||
struct Result final
|
||||
@@ -45,8 +45,8 @@ namespace omath::collision
|
||||
|
||||
// Precondition: simplex.size()==4 and contains the origin.
|
||||
[[nodiscard]]
|
||||
static std::optional<Result> solve(const ColliderType& a, const ColliderType& b, const Simplex<VectorType>& simplex,
|
||||
const Params params = {})
|
||||
static std::optional<Result> solve(const ColliderType& a, const ColliderType& b,
|
||||
const Simplex<VectorType>& simplex, const Params params = {})
|
||||
{
|
||||
// --- Build initial polytope from simplex (4 points) ---
|
||||
std::vector<VectorType> vertexes;
|
||||
|
||||
Reference in New Issue
Block a user