18#ifndef DRACO_MESH_MESH_MISC_FUNCTIONS_H_
19#define DRACO_MESH_MESH_MISC_FUNCTIONS_H_
48 if (opp_ci == kInvalidCornerIndex) {
70template <
typename InterpolatedVectorT>
73 const std::array<float, 3> &barycentric_coord) {
76 InterpolatedVectorT val[3];
77 for (
int c = 0; c < 3; ++c) {
81 InterpolatedVectorT res;
82 for (
int d = 0;
d < InterpolatedVectorT::dimension; ++
d) {
83 const float interpolated_component = barycentric_coord[0] * val[0][
d] +
84 barycentric_coord[1] * val[1][
d] +
85 barycentric_coord[2] * val[2][
d];
86 if (std::is_integral<typename InterpolatedVectorT::Scalar>::value) {
87 res[
d] = std::floor(interpolated_component + 0.5f);
89 res[
d] = interpolated_component;
Definition corner_table.h:53
CornerIndex Opposite(CornerIndex corner) const
Definition corner_table.h:83
CornerIndex Next(CornerIndex corner) const
Definition corner_table.h:89
CornerIndex Previous(CornerIndex corner) const
Definition corner_table.h:95
Type
Definition geometry_attribute.h:46
PointIndex CornerToPointId(int ci) const
Definition mesh.h:140
const Face & face(FaceIndex face_id) const
Definition mesh.h:79
std::array< PointIndex, 3 > Face
Definition mesh.h:54
Definition point_attribute.h:33
AttributeValueIndex mapped_index(PointIndex point_index) const
Definition point_attribute.h:56
void GetMappedValue(PointIndex point_index, void *out_data) const
Definition point_attribute.h:108
d
Definition meshpage.php:3895
Definition attribute_octahedron_transform.cc:21
InterpolatedVectorT ComputeInterpolatedAttributeValueOnMeshFace(const Mesh &mesh, const PointAttribute &attribute, FaceIndex fi, const std::array< float, 3 > &barycentric_coord)
Definition mesh_misc_functions.h:71
std::unique_ptr< CornerTable > CreateCornerTableFromAttribute(const Mesh *mesh, GeometryAttribute::Type type)
Definition mesh_misc_functions.cc:24
std::unique_ptr< CornerTable > CreateCornerTableFromAllAttributes(const Mesh *mesh)
Definition mesh_misc_functions.cc:46
bool IsCornerOppositeToAttributeSeam(CornerIndex ci, const PointAttribute &att, const Mesh &mesh, const CornerTable &ct)
Definition mesh_misc_functions.h:43
CornerIndex CornerIndex
Definition mesh_edgebreaker_encoder_impl.cc:35
FaceIndex FaceIndex
Definition mesh_edgebreaker_encoder_impl.cc:36
std::unique_ptr< CornerTable > CreateCornerTableFromPositionAttribute(const Mesh *mesh)
Definition mesh_misc_functions.cc:19