![]() |
Wise&mystical
1.0
Project about Europe
|
#include "raylib.h"
#include "config.h"
#include "utils.h"
#include "rlgl.h"
#include "raymath.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "external/tinyobj_loader_c.h"
#include "external/cgltf.h"
#include "external/vox_loader.h"
#include "external/par_shapes.h"
#include <unistd.h>
Go to the source code of this file.
Macros | |
#define | TINYOBJ_MALLOC RL_MALLOC |
rmodels - Basic functions to draw 3d shapes and load and draw 3d models More... | |
#define | TINYOBJ_CALLOC RL_CALLOC |
#define | TINYOBJ_REALLOC RL_REALLOC |
#define | TINYOBJ_FREE RL_FREE |
#define | TINYOBJ_LOADER_C_IMPLEMENTATION |
#define | CGLTF_MALLOC RL_MALLOC |
#define | CGLTF_FREE RL_FREE |
#define | CGLTF_IMPLEMENTATION |
#define | VOX_MALLOC RL_MALLOC |
#define | VOX_CALLOC RL_CALLOC |
#define | VOX_REALLOC RL_REALLOC |
#define | VOX_FREE RL_FREE |
#define | VOX_LOADER_IMPLEMENTATION |
#define | PAR_MALLOC(T, N) ((T*)RL_MALLOC(N*sizeof(T))) |
#define | PAR_CALLOC(T, N) ((T*)RL_CALLOC(N*sizeof(T), 1)) |
#define | PAR_REALLOC(T, BUF, N) ((T*)RL_REALLOC(BUF, sizeof(T)*(N))) |
#define | PAR_FREE RL_FREE |
#define | PAR_SHAPES_IMPLEMENTATION |
#define | CHDIR chdir |
#define | CUSTOM_MESH_GEN_PLANE |
#define | CUSTOM_MESH_GEN_CUBE |
#define | GRAY_VALUE(c) ((c.r+c.g+c.b)/3) |
#define | COLOR_EQUAL(col1, col2) ((col1.r == col2.r)&&(col1.g == col2.g)&&(col1.b == col2.b)&&(col1.a == col2.a)) |
#define | EPSILON 0.000001f |
#define | IQM_MAGIC "INTERQUAKEMODEL" |
#define | IQM_VERSION 2 |
#define | BONE_NAME_LENGTH 32 |
#define | MESH_NAME_LENGTH 32 |
#define | MATERIAL_NAME_LENGTH 32 |
#define | IQM_MAGIC "INTERQUAKEMODEL" |
#define | IQM_VERSION 2 |
#define | LOAD_ATTRIBUTE(accesor, numComp, dataType, dstPtr) |
Functions | |
void | DrawLine3D (Vector3 startPos, Vector3 endPos, Color color) |
void | DrawPoint3D (Vector3 position, Color color) |
void | DrawCircle3D (Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color) |
void | DrawTriangle3D (Vector3 v1, Vector3 v2, Vector3 v3, Color color) |
void | DrawTriangleStrip3D (Vector3 *points, int pointCount, Color color) |
void | DrawCube (Vector3 position, float width, float height, float length, Color color) |
void | DrawCubeV (Vector3 position, Vector3 size, Color color) |
void | DrawCubeWires (Vector3 position, float width, float height, float length, Color color) |
void | DrawCubeWiresV (Vector3 position, Vector3 size, Color color) |
void | DrawCubeTexture (Texture2D texture, Vector3 position, float width, float height, float length, Color color) |
void | DrawCubeTextureRec (Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color) |
void | DrawSphere (Vector3 centerPos, float radius, Color color) |
void | DrawSphereEx (Vector3 centerPos, float radius, int rings, int slices, Color color) |
void | DrawSphereWires (Vector3 centerPos, float radius, int rings, int slices, Color color) |
void | DrawCylinder (Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color) |
void | DrawCylinderEx (Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color) |
void | DrawCylinderWires (Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color) |
void | DrawCylinderWiresEx (Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color) |
void | DrawPlane (Vector3 centerPos, Vector2 size, Color color) |
void | DrawRay (Ray ray, Color color) |
void | DrawGrid (int slices, float spacing) |
Model | LoadModel (const char *fileName) |
Model | LoadModelFromMesh (Mesh mesh) |
void | UnloadModel (Model model) |
void | UnloadModelKeepMeshes (Model model) |
BoundingBox | GetModelBoundingBox (Model model) |
void | UploadMesh (Mesh *mesh, bool dynamic) |
void | UpdateMeshBuffer (Mesh mesh, int index, const void *data, int dataSize, int offset) |
void | DrawMesh (Mesh mesh, Material material, Matrix transform) |
void | DrawMeshInstanced (Mesh mesh, Material material, const Matrix *transforms, int instances) |
void | UnloadMesh (Mesh mesh) |
bool | ExportMesh (Mesh mesh, const char *fileName) |
Material * | LoadMaterials (const char *fileName, int *materialCount) |
Material | LoadMaterialDefault (void) |
void | UnloadMaterial (Material material) |
void | SetMaterialTexture (Material *material, int mapType, Texture2D texture) |
void | SetModelMeshMaterial (Model *model, int meshId, int materialId) |
ModelAnimation * | LoadModelAnimations (const char *fileName, unsigned int *animCount) |
void | UpdateModelAnimation (Model model, ModelAnimation anim, int frame) |
void | UnloadModelAnimations (ModelAnimation *animations, unsigned int count) |
void | UnloadModelAnimation (ModelAnimation anim) |
bool | IsModelAnimationValid (Model model, ModelAnimation anim) |
Mesh | GenMeshPoly (int sides, float radius) |
Mesh | GenMeshPlane (float width, float length, int resX, int resZ) |
Mesh | GenMeshCube (float width, float height, float length) |
Mesh | GenMeshSphere (float radius, int rings, int slices) |
Mesh | GenMeshHemiSphere (float radius, int rings, int slices) |
Mesh | GenMeshCylinder (float radius, float height, int slices) |
Mesh | GenMeshCone (float radius, float height, int slices) |
Mesh | GenMeshTorus (float radius, float size, int radSeg, int sides) |
Mesh | GenMeshKnot (float radius, float size, int radSeg, int sides) |
Mesh | GenMeshHeightmap (Image heightmap, Vector3 size) |
Mesh | GenMeshCubicmap (Image cubicmap, Vector3 cubeSize) |
BoundingBox | GetMeshBoundingBox (Mesh mesh) |
void | GenMeshTangents (Mesh *mesh) |
void | GenMeshBinormals (Mesh *mesh) |
void | DrawModel (Model model, Vector3 position, float scale, Color tint) |
void | DrawModelEx (Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) |
void | DrawModelWires (Model model, Vector3 position, float scale, Color tint) |
void | DrawModelWiresEx (Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) |
void | DrawBillboard (Camera camera, Texture2D texture, Vector3 position, float size, Color tint) |
void | DrawBillboardRec (Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint) |
void | DrawBillboardPro (Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) |
void | DrawBoundingBox (BoundingBox box, Color color) |
bool | CheckCollisionSpheres (Vector3 center1, float radius1, Vector3 center2, float radius2) |
bool | CheckCollisionBoxes (BoundingBox box1, BoundingBox box2) |
bool | CheckCollisionBoxSphere (BoundingBox box, Vector3 center, float radius) |
RayCollision | GetRayCollisionSphere (Ray ray, Vector3 center, float radius) |
RayCollision | GetRayCollisionBox (Ray ray, BoundingBox box) |
RayCollision | GetRayCollisionMesh (Ray ray, Mesh mesh, Matrix transform) |
RayCollision | GetRayCollisionTriangle (Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) |
RayCollision | GetRayCollisionQuad (Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4) |
#define BONE_NAME_LENGTH 32 |
#define COLOR_EQUAL | ( | col1, | |
col2 | |||
) | ((col1.r == col2.r)&&(col1.g == col2.g)&&(col1.b == col2.b)&&(col1.a == col2.a)) |
#define CUSTOM_MESH_GEN_CUBE |
#define CUSTOM_MESH_GEN_PLANE |
#define EPSILON 0.000001f |
#define GRAY_VALUE | ( | c | ) | ((c.r+c.g+c.b)/3) |
#define IQM_MAGIC "INTERQUAKEMODEL" |
#define IQM_MAGIC "INTERQUAKEMODEL" |
#define IQM_VERSION 2 |
#define IQM_VERSION 2 |
#define LOAD_ATTRIBUTE | ( | accesor, | |
numComp, | |||
dataType, | |||
dstPtr | |||
) |
#define MATERIAL_NAME_LENGTH 32 |
#define MESH_NAME_LENGTH 32 |
#define PAR_CALLOC | ( | T, | |
N | |||
) | ((T*)RL_CALLOC(N*sizeof(T), 1)) |
#define PAR_REALLOC | ( | T, | |
BUF, | |||
N | |||
) | ((T*)RL_REALLOC(BUF, sizeof(T)*(N))) |
#define TINYOBJ_MALLOC RL_MALLOC |
rmodels - Basic functions to draw 3d shapes and load and draw 3d models
CONFIGURATION:
#define SUPPORT_MODULE_RMODELS rmodels module is included in the build
#define SUPPORT_FILEFORMAT_OBJ #define SUPPORT_FILEFORMAT_MTL #define SUPPORT_FILEFORMAT_IQM #define SUPPORT_FILEFORMAT_GLTF #define SUPPORT_FILEFORMAT_VOX Selected desired fileformats to be supported for model data loading.
#define SUPPORT_MESH_GENERATION Support procedural mesh generation functions, uses external par_shapes.h library NOTE: Some generated meshes DO NOT include generated texture coordinates
LICENSE: zlib/libpng
Copyright (c) 2013-2022 Ramon Santamaria (@raysan5)
This software is provided "as-is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
#define TINYOBJ_REALLOC RL_REALLOC |
#define VOX_REALLOC RL_REALLOC |
bool CheckCollisionBoxes | ( | BoundingBox | box1, |
BoundingBox | box2 | ||
) |
bool CheckCollisionBoxSphere | ( | BoundingBox | box, |
Vector3 | center, | ||
float | radius | ||
) |
void DrawBoundingBox | ( | BoundingBox | box, |
Color | color | ||
) |
void DrawGrid | ( | int | slices, |
float | spacing | ||
) |
Mesh GenMeshCone | ( | float | radius, |
float | height, | ||
int | slices | ||
) |
Mesh GenMeshCube | ( | float | width, |
float | height, | ||
float | length | ||
) |
Mesh GenMeshCylinder | ( | float | radius, |
float | height, | ||
int | slices | ||
) |
Mesh GenMeshHemiSphere | ( | float | radius, |
int | rings, | ||
int | slices | ||
) |
Mesh GenMeshKnot | ( | float | radius, |
float | size, | ||
int | radSeg, | ||
int | sides | ||
) |
Mesh GenMeshPlane | ( | float | width, |
float | length, | ||
int | resX, | ||
int | resZ | ||
) |
Mesh GenMeshPoly | ( | int | sides, |
float | radius | ||
) |
Mesh GenMeshSphere | ( | float | radius, |
int | rings, | ||
int | slices | ||
) |
void GenMeshTangents | ( | Mesh * | mesh | ) |
Mesh GenMeshTorus | ( | float | radius, |
float | size, | ||
int | radSeg, | ||
int | sides | ||
) |
BoundingBox GetMeshBoundingBox | ( | Mesh | mesh | ) |
BoundingBox GetModelBoundingBox | ( | Model | model | ) |
RayCollision GetRayCollisionBox | ( | Ray | ray, |
BoundingBox | box | ||
) |
RayCollision GetRayCollisionMesh | ( | Ray | ray, |
Mesh | mesh, | ||
Matrix | transform | ||
) |
RayCollision GetRayCollisionSphere | ( | Ray | ray, |
Vector3 | center, | ||
float | radius | ||
) |
RayCollision GetRayCollisionTriangle | ( | Ray | ray, |
Vector3 | p1, | ||
Vector3 | p2, | ||
Vector3 | p3 | ||
) |
bool IsModelAnimationValid | ( | Model | model, |
ModelAnimation | anim | ||
) |
Material LoadMaterialDefault | ( | void | ) |
Material * LoadMaterials | ( | const char * | fileName, |
int * | materialCount | ||
) |
Model LoadModel | ( | const char * | fileName | ) |
ModelAnimation * LoadModelAnimations | ( | const char * | fileName, |
unsigned int * | animCount | ||
) |
void SetModelMeshMaterial | ( | Model * | model, |
int | meshId, | ||
int | materialId | ||
) |
void UnloadMaterial | ( | Material | material | ) |
void UnloadMesh | ( | Mesh | mesh | ) |
void UnloadModel | ( | Model | model | ) |
void UnloadModelAnimation | ( | ModelAnimation | anim | ) |
void UnloadModelAnimations | ( | ModelAnimation * | animations, |
unsigned int | count | ||
) |
void UpdateMeshBuffer | ( | Mesh | mesh, |
int | index, | ||
const void * | data, | ||
int | dataSize, | ||
int | offset | ||
) |
void UpdateModelAnimation | ( | Model | model, |
ModelAnimation | anim, | ||
int | frame | ||
) |