Skip to content

Commit

Permalink
Added Quaternion typedef
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Jul 2, 2018
1 parent 1727bba commit 7b971e0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 25 deletions.
38 changes: 21 additions & 17 deletions release/include/raylib.h
Expand Up @@ -3,6 +3,8 @@
* raylib - A simple and easy-to-use library to learn videogames programming (www.raylib.com)
*
* FEATURES:
* - NO external dependencies, all required libraries included with raylib
* - Multiple platforms support: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5.
* - Written in plain C code (C99) in PascalCase/camelCase notation
* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile)
* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
Expand All @@ -12,10 +14,8 @@
* - Flexible Materials system, supporting classic maps and PBR maps
* - Shaders support, including Model shaders and Postprocessing shaders
* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath]
* - Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD)
* - Multiple platforms support: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5.
* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
* - VR stereo rendering with configurable HMD device parameters
* - NO external dependencies, all required libraries included with raylib
* - Complete bindings to LUA (raylib-lua) and Go (raylib-go)
*
* NOTES:
Expand All @@ -33,14 +33,15 @@
* stb_image_resize (Sean Barret) for image resizing algorythms [textures]
* stb_image_write (Sean Barret) for image writting (PNG) [utils]
* stb_truetype (Sean Barret) for ttf fonts loading [text]
* stb_rect_pack (Sean Barret) for rectangles packing [text]
* stb_vorbis (Sean Barret) for OGG audio loading [audio]
* stb_perlin (Sean Barret) for Perlin noise image generation [textures]
* par_shapes (Philip Rideout) for parametric 3d shapes generation [models]
* jar_xm (Joshua Reisenauer) for XM audio module loading [audio]
* jar_mod (Joshua Reisenauer) for MOD audio module loading [audio]
* dr_flac (David Reid) for FLAC audio file loading [audio]
* dr_mp3 (David Reid) for MP3 audio file loading [audio]
* rgif (Charlie Tangora, Ramon Santamaria) for GIF recording [core]
* tinfl for data decompression (DEFLATE algorithm) [rres]
*
*
* LICENSE: zlib/libpng
Expand Down Expand Up @@ -331,6 +332,8 @@ typedef struct Vector4 {
float w;
} Vector4;

typedef Vector4 Quaternion;

// Matrix type (OpenGL style 4x4 - right handed, column major)
typedef struct Matrix {
float m0, m4, m8, m12;
Expand Down Expand Up @@ -540,12 +543,12 @@ typedef struct VrDeviceInfo {
// Enumerators Definition
//----------------------------------------------------------------------------------
// Trace log type
typedef enum {
typedef enum {
LOG_INFO = 1,
LOG_WARNING = 2,
LOG_ERROR = 4,
LOG_DEBUG = 8,
LOG_OTHER = 16
LOG_WARNING = 2,
LOG_ERROR = 4,
LOG_DEBUG = 8,
LOG_OTHER = 16
} LogType;

// Shader location point type
Expand Down Expand Up @@ -637,16 +640,16 @@ typedef enum {
} TextureFilterMode;

// Texture parameters: wrap mode
typedef enum {
WRAP_REPEAT = 0,
WRAP_CLAMP,
WRAP_MIRROR
typedef enum {
WRAP_REPEAT = 0,
WRAP_CLAMP,
WRAP_MIRROR
} TextureWrapMode;

// Color blending modes (pre-defined)
typedef enum {
BLEND_ALPHA = 0,
BLEND_ADDITIVE,
typedef enum {
BLEND_ALPHA = 0,
BLEND_ADDITIVE,
BLEND_MULTIPLIED
} BlendMode;

Expand Down Expand Up @@ -964,6 +967,7 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest
// Font loading/unloading functions
RLAPI Font GetDefaultFont(void); // Get the default Font
RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load font from file with extended parameters
RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, bool sdf); // Load font data for further use
RLAPI Image GenImageFontAtlas(CharInfo *chars, int fontSize, int charsCount, int padding, int packMethod); // Generate image font atlas using chars info
RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
Expand Down Expand Up @@ -1018,7 +1022,7 @@ RLAPI void ExportMesh(const char *fileName, Mesh mesh);

// Mesh manipulation functions
RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals

// Mesh generation functions
Expand Down
Binary file modified release/libs/win32/mingw32/libraylib.a
Binary file not shown.
2 changes: 2 additions & 0 deletions src/raylib.h
Expand Up @@ -332,6 +332,8 @@ typedef struct Vector4 {
float w;
} Vector4;

typedef Vector4 Quaternion;

// Matrix type (OpenGL style 4x4 - right handed, column major)
typedef struct Matrix {
float m0, m4, m8, m12;
Expand Down
16 changes: 8 additions & 8 deletions src/raymath.h
Expand Up @@ -114,6 +114,14 @@
float y;
float z;
} Vector3;

// Quaternion type
typedef struct Quaternion {
float x;
float y;
float z;
float w;
} Quaternion;

// Matrix type (OpenGL style 4x4 - right handed, column major)
typedef struct Matrix {
Expand All @@ -122,14 +130,6 @@
float m2, m6, m10, m14;
float m3, m7, m11, m15;
} Matrix;

// Quaternion type
typedef struct Quaternion {
float x;
float y;
float z;
float w;
} Quaternion;
#endif

// NOTE: Helper types to be used instead of array return types for *ToFloat functions
Expand Down

0 comments on commit 7b971e0

Please sign in to comment.