Commit Graph

64 Commits

Author SHA1 Message Date
Ray
7b971e0623 Added Quaternion typedef 2018-07-02 18:53:46 +02:00
Ray
7dedb84fd0 Added function: Vector3RotateByQuaternion()
Rotate a Vector3 by a Quaternion
2018-06-30 22:00:16 +02:00
Ray
0148432588 fabsf() not working with TCC
Replaced by fabs() that seem to work ok
2018-05-28 00:48:45 +02:00
raysan5
23e335d933 Implemented MeshTangents()
- Added Vector3OrthoNormalize() to raymath.h - not sure if it is correct
- Implemented MeshBinormals() - Mesh struct has not a place for them...
- Updated model_material_pbr example - tested but not working on my GPU
(old Intel HD), actually, it never worked on it...
2018-04-30 02:47:48 +02:00
Ahmad Fatoum
8b0fef6c34
raymath: Workaround tcc inline function limitation
Reported in #435, tcc generates out-of-line definitions for inline
symbols, something it shouldn't.  This fix punishes tcc for that
by making applications it compiles (slightly) larger...
2018-04-11 10:43:27 +02:00
Ray
61e0e4b4f3 Complete review of raymath for API consistency 2018-03-16 13:47:01 +01:00
Ray
9d8f15c19d Reviewed raymath changes 2018-03-15 12:37:23 +01:00
Ahmad Fatoum
f52d2de582
raymath.h: Use C99 inline semantics
RAYMATH_EXTERN_INLINE was renamed to RAYMATH_HEADER_ONLY, which user code
may define if they want to use it as header-only library. If multiple
files in the same project define RAYMATH_HEADER_ONLY, they might each
have duplicate out-of-line definitions of the same functions.

By default, raymath.h exposes inline definitions, which instructs the
compiler _not_ to generate out-of-line definitons, if out-of-line
definitions are required, those of the file defined with
RAYLIB_IMPLEMENTATION are used instead. There may be only one such file.

In C++ mode, the compiler will select only one out-of-line definition
automatically, so no need to define a RAYLIB_IMPLEMENTATION.

Unfortunately, we have to remove raymath function declaration from
raylib.h as those declarations would lead to duplicate out-of-line
definitions which would yield linker errors. This problem didn't
exist with GNU89 or C++, because there multiple defintions are ok,
but in C99 they aren't.
2018-02-24 23:39:23 +01:00
Ahmad Fatoum
ed6962edd3
Make MatrixToFloat and Vector3ToFloat reentrant
Besides making it thread-safe, it suppresses a GCC warning
when making them static inline in an upcoming patch.
2018-02-24 23:39:17 +01:00
Ahmad Fatoum
a5881fb9cc
Revert "raymath.h: Use C99 inline semantics"
This reverts commit 6ffc8cb799.
and commit e4d7bbec1e.
which I pushed by mistake...
2018-02-24 15:40:08 +01:00
Ahmad Fatoum
6ffc8cb799
raymath.h: Use C99 inline semantics
RAYMATH_EXTERN_INLINE was renamed to RAYMATH_HEADER_ONLY, which user code
may define if they want to use it as header-only library. If multiple
files in the same project define RAYMATH_HEADER_ONLY, they might each
have duplicate out-of-line definitions of the same functions.

By default, raymath.h exposes inline definitions, which instructs the
compiler _not_ to generate out-of-line definitons, if out-of-line
definitions are required, those of the file defined with
RAYLIB_IMPLEMENTATION are used instead. There may be only one such file.

In C++ mode, the compiler will select only one out-of-line definition
automatically, so no need to define a RAYLIB_IMPLEMENTATION.

Unfortunately, we have to remove raymath function declaration from
raylib.h as those declarations would lead to duplicate out-of-line
definitions which would yield linker errors. This problem didn't
exist with GNU89 or C++, because there multiple defintions are ok,
but in C99 they aren't.
2018-02-24 15:37:37 +01:00
Ahmad Fatoum
e4d7bbec1e
Make MatrixToFloat and Vector3ToFloat reentrant
Besides making it thread-safe, it suppresses a GCC warning
when making them static inline in an upcoming patch.
2018-02-24 15:37:37 +01:00
Ray San
53ad53d051 Manually review previous PR 2017-12-15 13:44:31 +01:00
user
d51f382ef8 optimized matrixrotate function by removing identity matrix 2017-12-14 11:48:33 +01:00
user
b5395b22cc make raymath compiling with msvc in c++ mode 2017-12-14 11:47:52 +01:00
Ray San
0cd327ccb2 Moved QuaternionNlerp() function 2017-12-04 11:03:45 +01:00
Michael Campagnaro
18bf0ac044 Fix typo in raymath.h 2017-08-23 22:55:43 -04:00
Ray
d071418cba Added Vector3MultiplyV()
To multiply Vector3 by Vector3
2017-07-28 20:58:38 +02:00
raysan5
b2712b6db7 Corrected issue on QuaternionFromVector3ToVector3() 2017-07-23 17:29:51 +02:00
raysan5
f57367e786 Implemented some changes 2017-07-23 13:20:35 +02:00
raysan5
3655c6e466 Renamed Vector*() functions to Vector3*()
For consistency!
2017-07-22 22:13:26 +02:00
raysan5
00d2768bc9 Corrected bug on MatrixPerspective()
Some other tweaks...
2017-07-22 10:35:49 +02:00
raysan5
c6cd07c373 Some tweaks raymath related 2017-07-21 17:46:44 +02:00
raysan5
e52032f646 Complete review of raymath
Now it should be coherent with OpenGL math standards
2017-07-21 17:19:28 +02:00
raysan5
38d9fcb08e Moved some functions to raymath
Exposed some raymath useful functions to raylib API
2017-07-21 15:25:35 +02:00
raysan5
84aff31973 MatrixPerspective() angle required in radians
Consistent with similar functions in raymath
2017-07-21 10:42:41 +02:00
Wilhem Barbier
056a494baf Fix some other typos 2017-06-29 10:36:58 +02:00
Wilhem Barbier
aba3739c13 Fix some typos in raymath.h 2017-06-29 10:30:21 +02:00
raysan5
402a8bfd68 Added note about transposing 2017-06-05 18:53:53 +02:00
raysan5
43cb6414f6 Added note about transposing 2017-06-05 18:53:37 +02:00
Ray
70a7c65668 Return angles as degrees 2017-05-04 17:41:51 +02:00
Ray
18b31f6792 Added two new functions to raymath 2017-05-04 00:35:41 +02:00
raysan5
f5894278b7 Added Vector2 math functions
Reviewed some Vector3 functions
Added auxiliary Clamp() function
2017-04-16 13:48:46 +02:00
Ray
59652c75b4 Review some comments 2017-03-20 20:34:44 +01:00
Ray
05cff44d0a Improved modules description -IN PROGRESS-
Working in modules configuration flags...
2017-02-16 00:50:02 +01:00
raysan5
658c280669 Lattest PR review
Function names, code formatting...
2017-01-05 19:33:05 +01:00
Joel Davis
d5d391faaf Added RaycastMesh function and example test case 2017-01-02 21:56:25 -08:00
Ray
377dcb025f Corrected some warnings 2016-12-05 01:14:18 +01:00
raysan5
c46c0fc652 Corrected keywords usage 2016-06-11 12:18:08 +02:00
raysan5
0bc71d84f8 Added functions to customize internal matrix
Internal modelview and projection matrices can be replaced before
drawing.
2016-06-02 20:23:09 +02:00
raysan5
5bcddca5e1 Remove useless stuff 2016-06-02 18:29:49 +02:00
raysan5
d17a0cee1a Review text formatting (spacing, tabs...) 2016-05-31 19:12:37 +02:00
raysan5
e060944b34 Added QuaternionInvert() 2016-05-12 13:02:04 +02:00
raysan5
4476a9e241 Review rlglUnproject() system 2016-03-02 17:13:31 +01:00
Ray
df5c64d0be Functions parameters reorganize: Axis and Angle
sin(), cos() functions cached and replaced by float c99 versions sinf(),
cos()
2016-02-02 18:41:01 +01:00
raysan5
3113a20390 Added bounding box calculation 2016-01-25 11:12:31 +01:00
raysan5
882e2abee1 Corrected bug 2016-01-21 12:24:12 +01:00
raysan5
efa1c96d19 Adapted raymath as single header library
Added support for single header implementation and also inline functions
support
2016-01-20 18:20:05 +01:00
Joshua Reisenauer
ae87a35f6e standalone raymath
look over for errors
2016-01-19 15:00:48 -08:00
raysan5
5e7686695f Review Light/Material system
Simplified for the user (more intuitive and clear)
Removed lighting module dependency
2016-01-11 13:29:55 +01:00