Lagrange
ClosestPointResult.h
1/*
2 * Copyright 2020 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/common.h>
15
16#include <Eigen/Core>
17
18#include <functional>
19
20namespace lagrange {
21namespace raycasting {
22
23template <typename Scalar>
25{
26 // Point type
27 using Point = Eigen::Matrix<Scalar, 3, 1>;
28
29 // Callback to populate triangle corner position given a (mesh_id, facet_id)
30 std::function<void(unsigned, unsigned, Point&, Point&, Point&)> populate_triangle;
31
32 // Current best result
33 unsigned mesh_index = invalid<unsigned>();
34 unsigned facet_index = invalid<unsigned>();
35 Point closest_point;
36 Point barycentric_coord;
37};
38
39} // namespace raycasting
40
41} // namespace lagrange
Main namespace for Lagrange.
Definition: AABBIGL.h:30
Definition: ClosestPointResult.h:25