godot/thirdparty/manifold/src/shared.h

// Copyright 2021 The Manifold Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include "./parallel.h"
#include "./sparse.h"
#include "./utils.h"
#include "./vec.h"

namespace manifold {

inline vec3 SafeNormalize(vec3 v) {}

inline double MaxEpsilon(double minEpsilon, const Box& bBox) {}

inline int NextHalfedge(int current) {}

inline mat3 NormalTransform(const mat3x4& transform) {}

/**
 * By using the closest axis-aligned projection to the normal instead of a
 * projection along the normal, we avoid introducing any rounding error.
 */
inline mat2x3 GetAxisAlignedProjection(vec3 normal) {}

inline vec3 GetBarycentric(const vec3& v, const mat3& triPos,
                           double tolerance) {}

/**
 * The fundamental component of the halfedge data structure used for storing and
 * operating on the Manifold.
 */
struct Halfedge {};

struct Barycentric {};

struct TriRef {};

/**
 * This is a temporary edge structure which only stores edges forward and
 * references the halfedge it was created from.
 */
struct TmpEdge {};

Vec<TmpEdge> inline CreateTmpEdges(const Vec<Halfedge>& halfedge) {}

template <const bool inverted>
struct ReindexEdge {};

#ifdef MANIFOLD_DEBUG
inline std::ostream& operator<<(std::ostream& stream, const Halfedge& edge) {
  return stream << "startVert = " << edge.startVert
                << ", endVert = " << edge.endVert
                << ", pairedHalfedge = " << edge.pairedHalfedge;
}

inline std::ostream& operator<<(std::ostream& stream, const Barycentric& bary) {
  return stream << "tri = " << bary.tri << ", uvw = " << bary.uvw;
}

inline std::ostream& operator<<(std::ostream& stream, const TriRef& ref) {
  return stream << "meshID: " << ref.meshID
                << ", originalID: " << ref.originalID << ", tri: " << ref.tri
                << ", faceID: " << ref.faceID;
}
#endif
}  // namespace manifold