Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
rjd_geo: fix ray-box collision bug
rjd_array: fix integer conversion warning
  • Loading branch information
rdunnington committed Aug 2, 2023
1 parent 6c0e001 commit b5c4d08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rjd_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void* rjd_array_alloc_impl(uint32_t capacity, struct rjd_mem_allocator* allocato
RJD_ASSERT(sizeof_type > 0);

if (capacity == 0) {
capacity = 128 / sizeof_type;
capacity = 128 / (uint32_t)sizeof_type;
if (capacity < 4) {
capacity = 4;
}
Expand Down
2 changes: 1 addition & 1 deletion rjd_geo.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ bool rjd_geo_ray_boxfast(rjd_math_vec3 ray_pos, rjd_math_vec3 ray_inv_dir, rjd_g
rjd_math_vec3 max = rjd_math_vec3_max(v0, v1);

float tmin = rjd_math_vec3_hmax(min);
float tmax = rjd_math_vec3_hmax(max);
float tmax = rjd_math_vec3_hmin(max);

bool colliding = (tmax >= 0) && (tmax >= tmin) && (tmin <= *t_out);
if (colliding) {
Expand Down

0 comments on commit b5c4d08

Please sign in to comment.