diff --git a/DESCRIPTION b/DESCRIPTION index d6acfed..ebd661e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: rayvertex Type: Package Title: 3D Software Rasterizer -Version: 0.11.3 -Date: 2024-06-18 +Version: 0.11.4 +Date: 2024-07-10 Authors@R: c(person("Tyler", "Morgan-Wall", email = "tylermw@gmail.com", role = c("aut", "cph", "cre"), comment = c(ORCID = "0000-0002-3131-3814")), person("Syoyo", "Fujita", role=c("ctb", "cph")), diff --git a/src/displacement.cpp b/src/displacement.cpp index e1f2aa5..46e5029 100644 --- a/src/displacement.cpp +++ b/src/displacement.cpp @@ -43,7 +43,7 @@ NumericMatrix DisplaceMesh(Rcpp::List raymesh, bool has_tex = texcoords.nrow() > 0; int nNormals = normals.nrow(); int nTex = texcoords.nrow(); - int nVertices = vertices.nrow(); + size_t nVertices = vertices.nrow(); if(!has_tex) { throw std::runtime_error("Texcoords required for displacement mapping: no texcoords on mesh."); @@ -62,7 +62,6 @@ NumericMatrix DisplaceMesh(Rcpp::List raymesh, if(!displacement_vector) { for(size_t i = 0; i < nVertices; i++) { vec2 uv = vec2(texcoords(i,0),texcoords(i,1)); - vec3 pp = vec3(vertices(i,0),vertices(i,1),vertices(i,2)); int ii = uv[0] * (double)nx; int jj = (1-uv[1]) * (double)ny; @@ -84,7 +83,6 @@ NumericMatrix DisplaceMesh(Rcpp::List raymesh, for(size_t i = 0; i < nVertices; i++) { vec2 uv = vec2(texcoords(i,0),texcoords(i,1)); - vec3 pp = vec3(vertices(i,0),vertices(i,1),vertices(i,2)); int ii = uv[0] * (double)nx; int jj = (1-uv[1]) * (double)ny; diff --git a/src/filltri.h b/src/filltri.h index f80ead4..baf9b90 100644 --- a/src/filltri.h +++ b/src/filltri.h @@ -8,8 +8,8 @@ #include "alphainfo.h" #include "defines.h" -static void print_vec(vec3 m); -static void print_vec(vec4 m); +// static void print_vec(vec3 m); +// static void print_vec(vec4 m); inline Float DifferenceOfProducts(Float a, Float b, Float c, Float d); inline Float edgeFunction(const vec3 &a, const vec3 &b, const vec3 &c); diff --git a/src/loopsubdiv.cpp b/src/loopsubdiv.cpp index 73f4a91..58568c2 100644 --- a/src/loopsubdiv.cpp +++ b/src/loopsubdiv.cpp @@ -4,6 +4,7 @@ #include "glm.hpp" #include "Rcpp.h" #include +#include using namespace Rcpp; @@ -174,11 +175,11 @@ List LoopSubdivide(List mesh, std::vector > face_storage; std::vector p(vertex_matrix.nrow()); - for(size_t i = 0; i < vertex_matrix.nrow(); i++) { + for(size_t i = 0; i < static_cast(vertex_matrix.nrow()); i++) { p[i] = glm::vec3(vertex_matrix(i,0),vertex_matrix(i,1),vertex_matrix(i,2)); } std::vector uv(texcoord_matrix.nrow()); - for(size_t i = 0; i < texcoord_matrix.nrow(); i++) { + for(size_t i = 0; i < static_cast(texcoord_matrix.nrow()); i++) { uv[i] = glm::vec2(texcoord_matrix(i,0),texcoord_matrix(i,1)); } bool has_uv = texcoord_matrix.nrow() > 0;