Skip to content

Commit 0ee332a

Browse files
fixed ccube_get_surface_normal again
1 parent dfe061e commit 0ee332a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/sim/cube.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,11 @@ vec3_t ccube_get_surface_normal(ccube_t cube, vec3_t point_on_surface) {
9393
// box operation
9494
bbox_t cube_box;
9595
bbox_make(&cube_box, 0, 0, 0, cube.length, cube.width, cube.height);
96-
return bbox_get_surface_normal(cube_box, point_on_surface);
96+
vec3_t surface_normal = bbox_get_surface_normal(cube_box, point_on_surface);
97+
98+
// undo the rotation, but not the translation
99+
cube.position = VEC3_ZERO;
100+
ccube_undo_cube_transformations(cube, &surface_normal);
101+
102+
return surface_normal;
97103
}

0 commit comments

Comments
 (0)