change bools to ints because windows compiler incorrectly says C bools are 1 byte when they should be 4
This commit is contained in:
parent
9be6e97073
commit
ff8f9f71b5
6 changed files with 1619 additions and 1623 deletions
|
@ -316,6 +316,7 @@ typedef struct Ray {
|
|||
} Ray;
|
||||
|
||||
// Raycast hit information
|
||||
|
||||
typedef struct RayHitInfo {
|
||||
bool hit; // Did the ray hit something?
|
||||
float distance; // Distance to nearest hit
|
||||
|
|
File diff suppressed because it is too large
Load diff
Binary file not shown.
Binary file not shown.
|
@ -3,7 +3,7 @@
|
|||
from cffi import FFI
|
||||
|
||||
ffibuilder = FFI()
|
||||
ffibuilder.cdef(open("../raylib_modified.h").read().replace('RLAPI ', ''))
|
||||
ffibuilder.cdef(open("../raylib_modified.h").read().replace('RLAPI ', '').replace('bool','int'))
|
||||
ffibuilder.set_source("_raylib_cffi",
|
||||
"""
|
||||
#include "../raylib.h"
|
||||
|
|
|
@ -20,6 +20,11 @@ model.materials.maps[pyray.MAP_DIFFUSE].texture = texture
|
|||
pyray.unload_image(image)
|
||||
pyray.set_camera_mode(camera, pyray.CAMERA_ORBITAL)
|
||||
|
||||
pos = pyray.get_mouse_position()
|
||||
ray = pyray.get_mouse_ray(pos, camera)
|
||||
rayhit = pyray.get_collision_ray_ground(ray, 0)
|
||||
print(str(rayhit.position.x))
|
||||
|
||||
while not pyray.window_should_close():
|
||||
pyray.update_camera(pyray.pointer(camera))
|
||||
pyray.begin_drawing()
|
||||
|
@ -30,4 +35,10 @@ while not pyray.window_should_close():
|
|||
pyray.end_mode_3d()
|
||||
pyray.draw_text("This mesh should be textured", 190, 200, 20, VIOLET)
|
||||
pyray.end_drawing()
|
||||
|
||||
pos = pyray.get_mouse_position()
|
||||
ray = pyray.get_mouse_ray(pos, camera)
|
||||
rayhit = pyray.get_collision_ray_ground(ray, 0)
|
||||
print(str(rayhit.position.x))
|
||||
|
||||
pyray.close_window()
|
||||
|
|
Reference in a new issue