Skip to content

Commit

Permalink
rayvertex v0.11.4: Fix compilation on windows and remove errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tylermorganwall committed Jul 10, 2024
1 parent 04e0a4d commit ff77198
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]",
role = c("aut", "cph", "cre"), comment = c(ORCID = "0000-0002-3131-3814")),
person("Syoyo", "Fujita", role=c("ctb", "cph")),
Expand Down
4 changes: 1 addition & 3 deletions src/displacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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;

Expand All @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/filltri.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 3 additions & 2 deletions src/loopsubdiv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "glm.hpp"
#include "Rcpp.h"
#include <queue>
#include <memory>

using namespace Rcpp;

Expand Down Expand Up @@ -174,11 +175,11 @@ List LoopSubdivide(List mesh,
std::vector<std::unique_ptr<SDFace> > face_storage;

std::vector<glm::vec3> p(vertex_matrix.nrow());
for(size_t i = 0; i < vertex_matrix.nrow(); i++) {
for(size_t i = 0; i < static_cast<size_t>(vertex_matrix.nrow()); i++) {
p[i] = glm::vec3(vertex_matrix(i,0),vertex_matrix(i,1),vertex_matrix(i,2));
}
std::vector<glm::vec2> uv(texcoord_matrix.nrow());
for(size_t i = 0; i < texcoord_matrix.nrow(); i++) {
for(size_t i = 0; i < static_cast<size_t>(texcoord_matrix.nrow()); i++) {
uv[i] = glm::vec2(texcoord_matrix(i,0),texcoord_matrix(i,1));
}
bool has_uv = texcoord_matrix.nrow() > 0;
Expand Down

0 comments on commit ff77198

Please sign in to comment.