Closed chriscamacho closed 2 years ago
the i suppose you'd need
v3.toPtr()
and a wrapper that knows when it needs a pointer!
There's already helper functions in pyray.py to create 'Vector2','Vector3','Vector4','Camera2D', 'Camera3D', 'Quaternion', 'Color', 'Rectangle' structs. And I just added code so that functions that require pointers automatically create pointers for their arguments.
it would be nice to have the functions!
here's my take on raymath, quaternion functions still to do.
warning ! contains sharp edges! you need to know when you need to dereference ...
I still do wonder if it wouldn't be worth including raymath.h in the wrapper...
https://gist.github.com/chriscamacho/63a9427deca505634f162e882e369172
raymath.h is a pain to include because it doesn't have any function declarations.
Compare to physac.h... although it's an h
file, inside it you have declaration void InitPhysics(void);
and then you have a separate definition with a function body void InitPhysics(void) { ... }
raymath only has the definitions, so we would need to generate the declarations ourselves.
raymath added
I got a fair way into porting raymath.h to python, when I noticed that its all messing with ffi types an awful lot, and probably wasting my time....
with helper functions like
and a submodule for raymath RAYMATH_STANDALONE ? (or will this just drag in Vector2 again...)
then most of the "scary" ffi.new stuff goes away!
the remaining issue I'm not over worried about.....
only issue is accessing members of the struct
is there anyway to automagically turn this
into