├── GL3v3 ├── Makefile ├── data │ ├── ball.gbo │ ├── ball.png │ ├── barrel.png │ ├── box.gbo │ ├── box.png │ ├── crate.png │ ├── drum.gbo │ ├── jupiter.png │ ├── stone.png │ ├── sun.png │ ├── textured.frag │ └── textured.vert ├── include │ ├── gl_core_3_3.h │ ├── lodepng.h │ ├── obj.h │ ├── phys.h │ └── util.h ├── resource │ ├── OBJ.h │ ├── ball.obj │ ├── box.obj │ ├── builder.c │ ├── drum.obj │ ├── makeGBO.sh │ └── obj2opengl.pl ├── src │ ├── gl_core_3_3.c │ ├── lodepng.c │ ├── main.c │ ├── obj.c │ └── util.c └── valgind.suppression.txt ├── LICENSE ├── capi ├── Makefile ├── bullet.mk ├── capi.cpp ├── capi.h ├── capi.hpp ├── doc │ ├── html │ │ ├── annotated.html │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── capi_8h.html │ │ ├── capi_8h_source.html │ │ ├── capi_8hpp_source.html │ │ ├── classes.html │ │ ├── closed.png │ │ ├── doc.png │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── dynsections.js │ │ ├── files.html │ │ ├── folderclosed.png │ │ ├── folderopen.png │ │ ├── globals.html │ │ ├── globals_defs.html │ │ ├── globals_enum.html │ │ ├── globals_func.html │ │ ├── index.html │ │ ├── jquery.js │ │ ├── menu.js │ │ ├── menudata.js │ │ ├── nav_f.png │ │ ├── nav_g.png │ │ ├── nav_h.png │ │ ├── open.png │ │ ├── search │ │ │ ├── all_0.html │ │ │ ├── all_0.js │ │ │ ├── all_1.html │ │ │ ├── all_1.js │ │ │ ├── all_2.html │ │ │ ├── all_2.js │ │ │ ├── all_3.html │ │ │ ├── all_3.js │ │ │ ├── all_4.html │ │ │ ├── all_4.js │ │ │ ├── all_5.html │ │ │ ├── all_5.js │ │ │ ├── all_6.html │ │ │ ├── all_6.js │ │ │ ├── classes_0.html │ │ │ ├── classes_0.js │ │ │ ├── close.png │ │ │ ├── defines_0.html │ │ │ ├── defines_0.js │ │ │ ├── enums_0.html │ │ │ ├── enums_0.js │ │ │ ├── enums_1.html │ │ │ ├── enums_1.js │ │ │ ├── files_0.html │ │ │ ├── files_0.js │ │ │ ├── functions_0.html │ │ │ ├── functions_0.js │ │ │ ├── functions_1.html │ │ │ ├── functions_1.js │ │ │ ├── functions_2.html │ │ │ ├── functions_2.js │ │ │ ├── functions_3.html │ │ │ ├── functions_3.js │ │ │ ├── functions_4.html │ │ │ ├── functions_4.js │ │ │ ├── functions_5.html │ │ │ ├── functions_5.js │ │ │ ├── mag_sel.png │ │ │ ├── nomatches.html │ │ │ ├── search.css │ │ │ ├── search.js │ │ │ ├── search_l.png │ │ │ ├── search_m.png │ │ │ ├── search_r.png │ │ │ └── searchdata.js │ │ ├── splitbar.png │ │ ├── structVec.html │ │ ├── sync_off.png │ │ ├── sync_on.png │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ └── tabs.css │ └── latex │ │ ├── Makefile │ │ ├── annotated.tex │ │ ├── capi_8h.tex │ │ ├── doxygen.sty │ │ ├── files.tex │ │ ├── refman.tex │ │ └── structVec.tex ├── doxygen.conf ├── lib │ └── .gitignore ├── obj │ └── .gitignore └── test.c ├── cppHello ├── Makefile └── hello.cpp ├── gluTest ├── Makefile ├── main.c ├── obj │ └── .gitignore └── valgind.suppression.txt └── readme.md /GL3v3/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS=-Ofast --fast-math -c -Iinclude -I../../kazmath/kazmath/ -Wall 3 | CFLAGS+= -I../capi/ -I../../bullet3/src/ 4 | LDFLAGS=-lGL -lm -lglfw ../capi/lib/libbullet.a 5 | 6 | SRCmain=$(wildcard src/*.c) 7 | SRCkaz=$(wildcard ../../kazmath/kazmath/*.c) 8 | SRC=$(SRCmain) $(SRCkaz) 9 | OBJ=$(SRCmain:src/%.c=obj/%.o) 10 | OBJkaz=$(SRCkaz:../../kazmath/kazmath/%.c=obj/kaz/%.o) 11 | 12 | CC=gcc 13 | 14 | main: $(OBJ) $(OBJkaz) 15 | g++ $(OBJ) ../capi/capi.a ../capi/lib/libbullet.a $(OBJkaz) -o main $(LDFLAGS) 16 | 17 | $(OBJ): obj/%.o : src/%.c 18 | $(CC) -std=c99 $(CFLAGS) -c $< -o $@ 19 | 20 | $(OBJkaz): obj/kaz/%.o : ../../kazmath/kazmath/%.c 21 | $(CC) -std=c99 -c $(CFLAGS) -c $< -o $@ 22 | 23 | #obj/capi.o: ../capi/capi.cpp 24 | # g++ -c $(CFLAGS) ../capi/capi.cpp -o obj/capi.o 25 | 26 | 27 | check: main 28 | valgrind --gen-suppressions=all --suppressions=valgind.suppression.txt --track-origins=yes --leak-check=full ./main 29 | 30 | clean: 31 | rm -rf main 32 | rm -rf obj/*.o 33 | rm -rf obj/kaz/*.o 34 | rm -rf obj/capi.o 35 | 36 | 37 | -------------------------------------------------------------------------------- /GL3v3/data/ball.gbo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/ball.gbo -------------------------------------------------------------------------------- /GL3v3/data/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/ball.png -------------------------------------------------------------------------------- /GL3v3/data/barrel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/barrel.png -------------------------------------------------------------------------------- /GL3v3/data/box.gbo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/box.gbo -------------------------------------------------------------------------------- /GL3v3/data/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/box.png -------------------------------------------------------------------------------- /GL3v3/data/crate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/crate.png -------------------------------------------------------------------------------- /GL3v3/data/drum.gbo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/drum.gbo -------------------------------------------------------------------------------- /GL3v3/data/jupiter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/jupiter.png -------------------------------------------------------------------------------- /GL3v3/data/stone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/stone.png -------------------------------------------------------------------------------- /GL3v3/data/sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/GL3v3/data/sun.png -------------------------------------------------------------------------------- /GL3v3/data/textured.frag: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | uniform sampler2D u_texture; 4 | 5 | uniform vec3 u_lightDir; 6 | uniform vec3 u_viewDir; 7 | 8 | in vec3 v_Position; 9 | in vec3 v_Normal; 10 | in vec2 v_frag_uv; 11 | 12 | out vec4 frag_color; 13 | 14 | void main() { 15 | 16 | vec4 baseColour = texture2D(u_texture, v_frag_uv); 17 | float nDOTl = clamp(dot(v_Normal, u_lightDir),0,1); 18 | 19 | vec3 reflect = (2.0 * v_Normal * nDOTl) - u_lightDir; 20 | float rDOTv = max(0.1, dot(reflect,u_viewDir)); 21 | 22 | // these three vec4's could be material uniforms. 23 | vec4 ambi = vec4(.4,.4,.4,0) * baseColour; 24 | vec4 diffu = vec4(.5,.5,.5,0) * nDOTl * baseColour;; 25 | 26 | // spec strength (could be a material uniform) 27 | vec4 specu = vec4(.4,.4,.4,0) * pow(rDOTv, 8.0); 28 | 29 | //gl_FragColor = (ambi + diffu + specu); 30 | frag_color = ambi + diffu + specu; 31 | } 32 | -------------------------------------------------------------------------------- /GL3v3/data/textured.vert: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | in vec3 vertex_attrib; 4 | in vec2 uv_attrib; 5 | in vec3 norm_attrib; 6 | 7 | uniform mat4 mvp_uniform; 8 | uniform mat4 mv_uniform; 9 | uniform vec3 sz_uniform; 10 | 11 | out vec2 v_frag_uv; 12 | out vec3 v_Position; 13 | out vec3 v_Normal; 14 | 15 | void main(void) { 16 | 17 | 18 | v_frag_uv = uv_attrib; 19 | vec3 vp = sz_uniform * vertex_attrib; 20 | v_Position = vec3(mv_uniform * vec4(vp,0)) ; 21 | v_Normal = vec3(mv_uniform * vec4(norm_attrib, 0.0)); 22 | gl_Position = mvp_uniform * vec4(vp,1); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /GL3v3/include/obj.h: -------------------------------------------------------------------------------- 1 | #ifndef OBJ_H 2 | #define OBJ_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | typedef struct __obj_t obj_t; 9 | 10 | struct __obj_t { 11 | GLuint vao; 12 | GLuint vbo_vert, vbo_tex, vbo_norm; 13 | GLint vert_attrib, tex_attrib, norm_attrib; 14 | GLint sz_uniform, mvp_uniform, mv_uniform, tex_uniform; 15 | GLint lightDir_uniform, viewDir_uniform; 16 | int num_verts; 17 | GLuint program; 18 | }; 19 | 20 | 21 | int createObj(obj_t *obj, int numVerts, float verts[], float txVert[], 22 | float norms[], char *vertShader, char *fragShader); 23 | int createObjCopyShader(obj_t *obj, int numVerts, float verts[], 24 | float txVert[], float norms[], obj_t *sdrobj); 25 | void drawObj(obj_t *obj, Vec sz, int texu, kmMat4 * combined, kmMat4 * mv, kmVec3 lightDir, kmVec3 viewDir); 26 | 27 | int loadObj(obj_t *obj,const char *objFile, char *vert, char *frag); 28 | int loadObjCopyShader(obj_t *obj,const char *objFile, obj_t *sdrobj); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /GL3v3/include/phys.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | typedef struct __phys_t phys_t; 6 | 7 | struct __phys_t { 8 | Vec sz; // "scale" or size of the bodies shape 9 | void* body; 10 | }; 11 | -------------------------------------------------------------------------------- /GL3v3/include/util.h: -------------------------------------------------------------------------------- 1 | #include "gl_core_3_3.h" 2 | 3 | // cast void* to a small ranged integer 4 | #define asTiny(x) (long) x & 0xffff 5 | 6 | 7 | enum shaderLocationType { shaderAttrib, shaderUniform }; 8 | 9 | GLuint create_shader(const char *filename, GLenum type); 10 | GLuint getShaderLocation(int type, GLuint prog, const char *name); 11 | char *file_read(const char *filename); 12 | 13 | void glCheckError(char* f, int l); 14 | int loadPNG(const char *filename); 15 | 16 | -------------------------------------------------------------------------------- /GL3v3/resource/box.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.79 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib box.mtl 4 | o Cube 5 | v -1.000000 1.000000 1.000000 6 | v -1.000000 -1.000000 -1.000000 7 | v -1.000000 -1.000000 1.000000 8 | v -1.000000 1.000000 -1.000000 9 | v 1.000000 -1.000000 -1.000000 10 | v 1.000000 1.000000 -1.000000 11 | v 1.000000 -1.000000 1.000000 12 | v 1.000000 1.000000 1.000000 13 | vt 0.999092 0.997583 14 | vt 0.003926 0.002417 15 | vt 0.999092 0.002417 16 | vt 0.007661 0.004643 17 | vt 0.998457 0.995439 18 | vt 0.007661 0.995439 19 | vt 0.995935 0.002514 20 | vt 0.004147 0.994303 21 | vt 0.004147 0.002514 22 | vt 0.997277 0.997277 23 | vt 0.002641 0.002641 24 | vt 0.997277 0.002641 25 | vt 0.996458 0.003542 26 | vt 0.003542 0.996458 27 | vt 0.003542 0.003543 28 | vt 1.002708 0.998016 29 | vt 0.000393 -0.004299 30 | vt 1.002708 -0.004299 31 | vt 0.003926 0.997583 32 | vt 0.998457 0.004643 33 | vt 0.995935 0.994303 34 | vt 0.002641 0.997277 35 | vt 0.996458 0.996458 36 | vt 0.000393 0.998016 37 | vn -0.5774 0.5774 0.5774 38 | vn -0.5774 -0.5774 -0.5774 39 | vn -0.5774 -0.5774 0.5774 40 | vn -0.5774 0.5774 -0.5774 41 | vn 0.5774 -0.5774 -0.5774 42 | vn 0.5774 0.5774 -0.5774 43 | vn 0.5774 -0.5774 0.5774 44 | vn 0.5774 0.5774 0.5774 45 | usemtl None 46 | s 1 47 | f 1/1/1 2/2/2 3/3/3 48 | f 4/4/4 5/5/5 2/6/2 49 | f 6/7/6 7/8/7 5/9/5 50 | f 8/10/8 3/11/3 7/12/7 51 | f 5/13/5 3/14/3 2/15/2 52 | f 4/16/4 8/17/8 6/18/6 53 | f 1/1/1 4/19/4 2/2/2 54 | f 4/4/4 6/20/6 5/5/5 55 | f 6/7/6 8/21/8 7/8/7 56 | f 8/10/8 1/22/1 3/11/3 57 | f 5/13/5 7/23/7 3/14/3 58 | f 4/16/4 1/24/1 8/17/8 59 | -------------------------------------------------------------------------------- /GL3v3/resource/builder.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "OBJ.h" 5 | 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | if (argc!=2) exit(-1); 10 | 11 | //OBJNumVerts 12 | //OBJVerts 13 | //OBJNormals 14 | //OBJTexCoords 15 | 16 | // printf("%s\n",argv[1]); 17 | 18 | unsigned int magic; 19 | magic=0x614F4247; // GBOa in little endian - initial version "a" 20 | 21 | FILE *pFile; 22 | pFile = fopen ( argv[1] , "wb" ); 23 | fwrite (&magic , 1 , sizeof(unsigned int) , pFile ); 24 | fwrite (&OBJNumVerts , 1 , sizeof(unsigned int) , pFile ); 25 | fwrite (OBJVerts , 1 , sizeof(float) * 3 * OBJNumVerts, pFile ); 26 | fwrite (OBJNormals , 1 , sizeof(float) * 3 * OBJNumVerts , pFile ); 27 | fwrite (OBJTexCoords , 1 , sizeof(float) * 2 * OBJNumVerts , pFile ); 28 | fclose(pFile); 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /GL3v3/resource/drum.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.79 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib drum.mtl 4 | o drum 5 | v -1.000000 0.000000 -1.000000 6 | v -0.980786 -0.195090 1.000000 7 | v -1.000000 0.000000 1.000000 8 | v -0.980786 -0.195090 -1.000000 9 | v -0.923880 -0.382684 1.000000 10 | v -0.923880 -0.382684 -1.000000 11 | v -0.831470 -0.555570 1.000000 12 | v -0.831470 -0.555570 -1.000000 13 | v -0.707106 -0.707106 1.000000 14 | v -0.707106 -0.707106 -1.000000 15 | v -0.555570 -0.831470 1.000000 16 | v -0.555570 -0.831470 -1.000000 17 | v -0.382684 -0.923880 1.000000 18 | v -0.382684 -0.923880 -1.000000 19 | v -0.195090 -0.980786 1.000000 20 | v -0.195090 -0.980786 -1.000000 21 | v 0.000000 -1.000000 1.000000 22 | v 0.000000 -1.000000 -1.000000 23 | v 0.195090 -0.980786 1.000000 24 | v 0.195090 -0.980786 -1.000000 25 | v 0.382684 -0.923880 1.000000 26 | v 0.382684 -0.923880 -1.000000 27 | v 0.555570 -0.831470 1.000000 28 | v 0.555570 -0.831470 -1.000000 29 | v 0.707106 -0.707106 1.000000 30 | v 0.707106 -0.707106 -1.000000 31 | v 0.831470 -0.555570 1.000000 32 | v 0.831470 -0.555570 -1.000000 33 | v 0.923880 -0.382684 1.000000 34 | v 0.923880 -0.382684 -1.000000 35 | v 0.980786 -0.195090 1.000000 36 | v 0.980786 -0.195090 -1.000000 37 | v 1.000000 0.000000 1.000000 38 | v 1.000000 0.000000 -1.000000 39 | v 0.980786 0.195090 1.000000 40 | v 0.980786 0.195090 -1.000000 41 | v 0.923880 0.382684 1.000000 42 | v 0.923880 0.382684 -1.000000 43 | v 0.831470 0.555570 1.000000 44 | v 0.831470 0.555570 -1.000000 45 | v 0.707106 0.707108 1.000000 46 | v 0.707106 0.707108 -1.000000 47 | v 0.555570 0.831470 1.000000 48 | v 0.555570 0.831470 -1.000000 49 | v 0.382682 0.923880 1.000000 50 | v 0.382682 0.923880 -1.000000 51 | v 0.195090 0.980786 1.000000 52 | v 0.195090 0.980786 -1.000000 53 | v 0.000000 1.000000 1.000000 54 | v 0.000000 1.000000 -1.000000 55 | v -0.195092 0.980786 1.000000 56 | v -0.195092 0.980786 -1.000000 57 | v -0.382684 0.923880 1.000000 58 | v -0.382684 0.923880 -1.000000 59 | v -0.555572 0.831468 1.000000 60 | v -0.555572 0.831468 -1.000000 61 | v -0.707108 0.707106 1.000000 62 | v -0.707108 0.707106 -1.000000 63 | v -0.831470 0.555570 1.000000 64 | v -0.831470 0.555570 -1.000000 65 | v -0.923880 0.382682 1.000000 66 | v -0.923880 0.382682 -1.000000 67 | v -0.980786 0.195088 1.000000 68 | v -0.980786 0.195088 -1.000000 69 | vt 0.746152 0.451989 70 | vt 0.777164 0.998187 71 | vt 0.746151 0.998187 72 | vt 0.777165 0.451989 73 | vt 0.808177 0.998188 74 | vt 0.808178 0.451989 75 | vt 0.839191 0.998188 76 | vt 0.839191 0.451989 77 | vt 0.870204 0.998188 78 | vt 0.870204 0.451989 79 | vt 0.901217 0.998188 80 | vt 0.901217 0.451989 81 | vt 0.932230 0.998188 82 | vt 0.932230 0.451989 83 | vt 0.963243 0.998188 84 | vt 0.963243 0.451989 85 | vt 0.994256 0.998188 86 | vt 0.001841 0.451980 87 | vt 0.032850 0.998178 88 | vt 0.001837 0.998178 89 | vt 0.032854 0.451981 90 | vt 0.063863 0.998179 91 | vt 0.063867 0.451981 92 | vt 0.094877 0.998179 93 | vt 0.094880 0.451982 94 | vt 0.125890 0.998180 95 | vt 0.125893 0.451982 96 | vt 0.156903 0.998181 97 | vt 0.156906 0.451983 98 | vt 0.187916 0.998181 99 | vt 0.187919 0.451983 100 | vt 0.218929 0.998182 101 | vt 0.218932 0.451984 102 | vt 0.249942 0.998182 103 | vt 0.249945 0.451984 104 | vt 0.280955 0.998183 105 | vt 0.280958 0.451985 106 | vt 0.311968 0.998183 107 | vt 0.311971 0.451985 108 | vt 0.342981 0.998183 109 | vt 0.342984 0.451985 110 | vt 0.373994 0.998184 111 | vt 0.373997 0.451986 112 | vt 0.405007 0.998184 113 | vt 0.405010 0.451986 114 | vt 0.436020 0.998185 115 | vt 0.436023 0.451986 116 | vt 0.467034 0.998185 117 | vt 0.467036 0.451987 118 | vt 0.498047 0.998185 119 | vt 0.498049 0.451987 120 | vt 0.529060 0.998186 121 | vt 0.529062 0.451987 122 | vt 0.560073 0.998186 123 | vt 0.560075 0.451988 124 | vt 0.591086 0.998186 125 | vt 0.591088 0.451988 126 | vt 0.622099 0.998186 127 | vt 0.622101 0.451988 128 | vt 0.653112 0.998187 129 | vt 0.653114 0.451988 130 | vt 0.684125 0.998187 131 | vt 0.126292 0.418056 132 | vt 0.015156 0.287270 133 | vt 0.167748 0.011566 134 | vt 0.684127 0.451988 135 | vt 0.715138 0.998187 136 | vt 0.715140 0.451988 137 | vt 0.740143 -0.002851 138 | vt 0.992441 0.195566 139 | vt 0.533089 0.238921 140 | vt 0.994256 0.451989 141 | vt 0.211756 0.003112 142 | vt 0.256626 0.003112 143 | vt 0.300634 0.011566 144 | vt 0.342088 0.028149 145 | vt 0.379396 0.052224 146 | vt 0.411124 0.082866 147 | vt 0.436053 0.118897 148 | vt 0.453224 0.158932 149 | vt 0.461978 0.201434 150 | vt 0.461978 0.244769 151 | vt 0.453225 0.287271 152 | vt 0.436053 0.327307 153 | vt 0.411125 0.363339 154 | vt 0.300634 0.434640 155 | vt 0.379397 0.393981 156 | vt 0.342088 0.418056 157 | vt 0.256626 0.443094 158 | vt 0.211755 0.443094 159 | vt 0.167747 0.434640 160 | vt 0.088984 0.393981 161 | vt 0.057255 0.363338 162 | vt 0.032327 0.327306 163 | vt 0.006402 0.244768 164 | vt 0.006403 0.201434 165 | vt 0.015157 0.158932 166 | vt 0.032328 0.118897 167 | vt 0.057257 0.082866 168 | vt 0.088985 0.052224 169 | vt 0.126293 0.028149 170 | vt 0.785385 0.437338 171 | vt 0.740144 0.437338 172 | vt 0.695771 0.428880 173 | vt 0.653972 0.412288 174 | vt 0.616355 0.388202 175 | vt 0.584364 0.357545 176 | vt 0.559229 0.321497 177 | vt 0.541915 0.281443 178 | vt 0.533088 0.195567 179 | vt 0.541914 0.153045 180 | vt 0.559228 0.112990 181 | vt 0.584363 0.076942 182 | vt 0.616354 0.046285 183 | vt 0.653971 0.022198 184 | vt 0.695770 0.005607 185 | vt 0.785385 -0.002851 186 | vt 0.829759 0.005607 187 | vt 0.871557 0.022198 188 | vt 0.909175 0.046285 189 | vt 0.941166 0.076942 190 | vt 0.966301 0.112990 191 | vt 0.983615 0.153045 192 | vt 0.992441 0.238921 193 | vt 0.983614 0.281443 194 | vt 0.966301 0.321497 195 | vt 0.941166 0.357545 196 | vt 0.909174 0.388202 197 | vt 0.871557 0.412289 198 | vt 0.829758 0.428880 199 | vn -0.7279 0.0000 -0.6857 200 | vn -0.7139 -0.1420 0.6857 201 | vn -0.7279 0.0000 0.6857 202 | vn -0.7139 -0.1420 -0.6857 203 | vn -0.6725 -0.2786 0.6857 204 | vn -0.6725 -0.2786 -0.6857 205 | vn -0.6052 -0.4044 0.6857 206 | vn -0.6052 -0.4044 -0.6857 207 | vn -0.5147 -0.5147 0.6857 208 | vn -0.5147 -0.5147 -0.6857 209 | vn -0.4044 -0.6052 0.6857 210 | vn -0.4044 -0.6052 -0.6857 211 | vn -0.2786 -0.6725 0.6857 212 | vn -0.2786 -0.6725 -0.6857 213 | vn -0.1420 -0.7139 0.6857 214 | vn -0.1420 -0.7139 -0.6857 215 | vn -0.0000 -0.7279 0.6857 216 | vn 0.0000 -0.7279 -0.6857 217 | vn 0.1420 -0.7139 0.6857 218 | vn 0.1420 -0.7139 -0.6857 219 | vn 0.2786 -0.6725 0.6857 220 | vn 0.2786 -0.6725 -0.6857 221 | vn 0.4044 -0.6052 0.6857 222 | vn 0.4044 -0.6052 -0.6857 223 | vn 0.5147 -0.5147 0.6857 224 | vn 0.5147 -0.5147 -0.6857 225 | vn 0.6052 -0.4044 0.6857 226 | vn 0.6052 -0.4044 -0.6857 227 | vn 0.6725 -0.2786 0.6857 228 | vn 0.6725 -0.2786 -0.6857 229 | vn 0.7139 -0.1420 0.6857 230 | vn 0.7139 -0.1420 -0.6857 231 | vn 0.7279 -0.0000 0.6857 232 | vn 0.7279 0.0000 -0.6857 233 | vn 0.7139 0.1420 0.6857 234 | vn 0.7139 0.1420 -0.6857 235 | vn 0.6725 0.2786 0.6857 236 | vn 0.6725 0.2786 -0.6857 237 | vn 0.6052 0.4044 0.6857 238 | vn 0.6052 0.4044 -0.6857 239 | vn 0.5147 0.5147 0.6857 240 | vn 0.5147 0.5147 -0.6857 241 | vn 0.4044 0.6052 0.6857 242 | vn 0.4044 0.6052 -0.6857 243 | vn 0.2786 0.6725 0.6857 244 | vn 0.2786 0.6725 -0.6857 245 | vn 0.1420 0.7139 0.6857 246 | vn 0.1420 0.7139 -0.6857 247 | vn 0.0000 0.7279 0.6857 248 | vn 0.0000 0.7279 -0.6857 249 | vn -0.1420 0.7139 0.6857 250 | vn -0.1420 0.7139 -0.6857 251 | vn -0.2786 0.6725 0.6857 252 | vn -0.2786 0.6725 -0.6857 253 | vn -0.4044 0.6052 0.6857 254 | vn -0.4044 0.6052 -0.6857 255 | vn -0.5147 0.5147 0.6857 256 | vn -0.5147 0.5147 -0.6857 257 | vn -0.6052 0.4044 0.6857 258 | vn -0.6052 0.4044 -0.6857 259 | vn -0.6725 0.2785 0.6857 260 | vn -0.6725 0.2785 -0.6857 261 | vn -0.7139 0.1420 0.6857 262 | vn -0.7139 0.1420 -0.6857 263 | usemtl None.002 264 | s 1 265 | f 1/1/1 2/2/2 3/3/3 266 | f 4/4/4 5/5/5 2/2/2 267 | f 6/6/6 7/7/7 5/5/5 268 | f 8/8/8 9/9/9 7/7/7 269 | f 10/10/10 11/11/11 9/9/9 270 | f 12/12/12 13/13/13 11/11/11 271 | f 14/14/14 15/15/15 13/13/13 272 | f 16/16/16 17/17/17 15/15/15 273 | f 18/18/18 19/19/19 17/20/17 274 | f 20/21/20 21/22/21 19/19/19 275 | f 22/23/22 23/24/23 21/22/21 276 | f 24/25/24 25/26/25 23/24/23 277 | f 26/27/26 27/28/27 25/26/25 278 | f 28/29/28 29/30/29 27/28/27 279 | f 30/31/30 31/32/31 29/30/29 280 | f 32/33/32 33/34/33 31/32/31 281 | f 34/35/34 35/36/35 33/34/33 282 | f 36/37/36 37/38/37 35/36/35 283 | f 38/39/38 39/40/39 37/38/37 284 | f 40/41/40 41/42/41 39/40/39 285 | f 42/43/42 43/44/43 41/42/41 286 | f 44/45/44 45/46/45 43/44/43 287 | f 46/47/46 47/48/47 45/46/45 288 | f 48/49/48 49/50/49 47/48/47 289 | f 50/51/50 51/52/51 49/50/49 290 | f 52/53/52 53/54/53 51/52/51 291 | f 54/55/54 55/56/55 53/54/53 292 | f 56/57/56 57/58/57 55/56/55 293 | f 58/59/58 59/60/59 57/58/57 294 | f 60/61/60 61/62/61 59/60/59 295 | f 30/63/30 22/64/22 6/65/6 296 | f 62/66/62 63/67/63 61/62/61 297 | f 64/68/64 3/3/3 63/67/63 298 | f 31/69/31 47/70/47 15/71/15 299 | f 1/1/1 4/4/4 2/2/2 300 | f 4/4/4 6/6/6 5/5/5 301 | f 6/6/6 8/8/8 7/7/7 302 | f 8/8/8 10/10/10 9/9/9 303 | f 10/10/10 12/12/12 11/11/11 304 | f 12/12/12 14/14/14 13/13/13 305 | f 14/14/14 16/16/16 15/15/15 306 | f 16/16/16 18/72/18 17/17/17 307 | f 18/18/18 20/21/20 19/19/19 308 | f 20/21/20 22/23/22 21/22/21 309 | f 22/23/22 24/25/24 23/24/23 310 | f 24/25/24 26/27/26 25/26/25 311 | f 26/27/26 28/29/28 27/28/27 312 | f 28/29/28 30/31/30 29/30/29 313 | f 30/31/30 32/33/32 31/32/31 314 | f 32/33/32 34/35/34 33/34/33 315 | f 34/35/34 36/37/36 35/36/35 316 | f 36/37/36 38/39/38 37/38/37 317 | f 38/39/38 40/41/40 39/40/39 318 | f 40/41/40 42/43/42 41/42/41 319 | f 42/43/42 44/45/44 43/44/43 320 | f 44/45/44 46/47/46 45/46/45 321 | f 46/47/46 48/49/48 47/48/47 322 | f 48/49/48 50/51/50 49/50/49 323 | f 50/51/50 52/53/52 51/52/51 324 | f 52/53/52 54/55/54 53/54/53 325 | f 54/55/54 56/57/56 55/56/55 326 | f 56/57/56 58/59/58 57/58/57 327 | f 58/59/58 60/61/60 59/60/59 328 | f 60/61/60 62/66/62 61/62/61 329 | f 6/65/6 4/73/4 1/74/1 330 | f 1/74/1 64/75/64 6/65/6 331 | f 62/76/62 60/77/60 58/78/58 332 | f 58/78/58 56/79/56 54/80/54 333 | f 54/80/54 52/81/52 50/82/50 334 | f 50/82/50 48/83/48 54/80/54 335 | f 46/84/46 44/85/44 38/86/38 336 | f 42/87/42 40/88/40 38/86/38 337 | f 38/86/38 36/89/36 34/90/34 338 | f 34/90/34 32/91/32 38/86/38 339 | f 30/63/30 28/92/28 26/93/26 340 | f 26/93/26 24/94/24 22/64/22 341 | f 22/64/22 20/95/20 18/96/18 342 | f 18/96/18 16/97/16 14/98/14 343 | f 14/98/14 12/99/12 10/100/10 344 | f 10/100/10 8/101/8 6/65/6 345 | f 6/65/6 64/75/64 62/76/62 346 | f 62/76/62 58/78/58 6/65/6 347 | f 54/80/54 48/83/48 46/84/46 348 | f 44/85/44 42/87/42 38/86/38 349 | f 38/86/38 32/91/32 30/63/30 350 | f 30/63/30 26/93/26 22/64/22 351 | f 22/64/22 18/96/18 14/98/14 352 | f 14/98/14 10/100/10 22/64/22 353 | f 6/65/6 58/78/58 54/80/54 354 | f 54/80/54 46/84/46 38/86/38 355 | f 38/86/38 30/63/30 6/65/6 356 | f 22/64/22 10/100/10 6/65/6 357 | f 6/65/6 54/80/54 38/86/38 358 | f 62/66/62 64/68/64 63/67/63 359 | f 64/68/64 1/1/1 3/3/3 360 | f 63/102/63 3/103/3 2/104/2 361 | f 2/104/2 5/105/5 7/106/7 362 | f 7/106/7 9/107/9 11/108/11 363 | f 11/108/11 13/109/13 7/106/7 364 | f 15/71/15 17/110/17 19/111/19 365 | f 19/111/19 21/112/21 15/71/15 366 | f 23/113/23 25/114/25 31/69/31 367 | f 27/115/27 29/116/29 31/69/31 368 | f 31/69/31 33/117/33 35/118/35 369 | f 35/118/35 37/119/37 31/69/31 370 | f 39/120/39 41/121/41 43/122/43 371 | f 43/122/43 45/123/45 47/70/47 372 | f 47/70/47 49/124/49 51/125/51 373 | f 51/125/51 53/126/53 55/127/55 374 | f 55/127/55 57/128/57 63/102/63 375 | f 59/129/59 61/130/61 63/102/63 376 | f 63/102/63 2/104/2 15/71/15 377 | f 7/106/7 13/109/13 15/71/15 378 | f 15/71/15 21/112/21 23/113/23 379 | f 25/114/25 27/115/27 31/69/31 380 | f 31/69/31 37/119/37 39/120/39 381 | f 39/120/39 43/122/43 47/70/47 382 | f 47/70/47 51/125/51 63/102/63 383 | f 57/128/57 59/129/59 63/102/63 384 | f 2/104/2 7/106/7 15/71/15 385 | f 15/71/15 23/113/23 31/69/31 386 | f 31/69/31 39/120/39 47/70/47 387 | f 51/125/51 55/127/55 63/102/63 388 | f 63/102/63 15/71/15 47/70/47 389 | -------------------------------------------------------------------------------- /GL3v3/resource/makeGBO.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ./obj2opengl.pl -noverbose -noScale -noMove -o OBJ.h $1.obj 4 | gcc builder.c -o builder 5 | ./builder $1.gbo 6 | 7 | -------------------------------------------------------------------------------- /GL3v3/src/obj.c: -------------------------------------------------------------------------------- 1 | #include "gl_core_3_3.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "obj.h" 7 | #include 8 | #include "util.h" 9 | 10 | // custom binary format not wavefront obj ! 11 | // see makeGBO.sh 12 | 13 | /* each OBJ shader is expected to have at least these attribs and uniforms 14 | 15 | vertex_attrib vertex coordinates 16 | uv_attrib uv coordinates 17 | mvp_uniform combined model, view and projection matrix 18 | mv_uniform view, model matrix for lighting 19 | texture_uniform texture sampler 20 | 21 | other custom attribs/uniforms should be handled as a special case in the 22 | main code 23 | 24 | */ 25 | 26 | // TODO TODO TODO - release obj free all resources buffers etc 27 | 28 | 29 | int loadObj(obj_t *obj,const char *objFile, char *vert, char *frag) 30 | { 31 | FILE *pFile; 32 | pFile = fopen( objFile, "rb" ); 33 | if (pFile==NULL) { 34 | printf("Cant find open model - %s\n",objFile); 35 | return false; 36 | } 37 | unsigned int magic; 38 | int NumVerts; 39 | 40 | fread (&magic,1, sizeof(unsigned int), pFile ); 41 | if (magic!=0x614f4247) { 42 | printf("Does not appear to be a version 'a' GBO file\n"); 43 | return false; 44 | } 45 | fread(&NumVerts,1,sizeof(unsigned int), pFile ); 46 | 47 | float* Verts = malloc(sizeof(float) * 3 * NumVerts); 48 | fread(Verts,1,sizeof(float) * 3 * NumVerts, pFile ); 49 | 50 | float* Norms = malloc(sizeof(float) * 3 * NumVerts); 51 | fread(Norms,1,sizeof(float) * 3 * NumVerts, pFile ); 52 | 53 | float* TexCoords = malloc(sizeof(float) * 2 * NumVerts); 54 | fread(TexCoords,1,sizeof(float) * 2 * NumVerts, pFile ); 55 | 56 | createObj(obj,NumVerts,Verts,TexCoords,Norms,vert,frag); 57 | 58 | free(TexCoords); 59 | free(Norms); 60 | free(Verts); 61 | 62 | return true; 63 | } 64 | 65 | int loadObjCopyShader(obj_t *obj,const char *objFile, obj_t *sdrobj) 66 | { 67 | FILE *pFile; 68 | pFile = fopen( objFile, "rb" ); 69 | if (pFile==NULL) 70 | { 71 | printf("Cant find open model - %s\n",objFile); 72 | return false; 73 | } 74 | unsigned int magic; 75 | int NumVerts; 76 | 77 | fread (&magic,1, sizeof(unsigned int), pFile ); 78 | if (magic!=0x614f4247) 79 | { 80 | printf("Does not appear to be a version 'a' GBO file\n"); 81 | return false; 82 | } 83 | fread(&NumVerts,1,sizeof(unsigned int), pFile ); 84 | 85 | float* Verts = malloc(sizeof(float) * 3 * NumVerts); 86 | fread(Verts,1,sizeof(float) * 3 * NumVerts, pFile ); 87 | 88 | float* Norms = malloc(sizeof(float) * 3 * NumVerts); 89 | fread(Norms,1,sizeof(float) * 3 * NumVerts, pFile ); 90 | 91 | float* TexCoords = malloc(sizeof(float) * 2 * NumVerts); 92 | fread(TexCoords,1,sizeof(float) * 2 * NumVerts, pFile ); 93 | 94 | createObjCopyShader(obj,NumVerts, Verts,TexCoords, 95 | Norms, sdrobj); 96 | 97 | free(TexCoords); 98 | free(Norms); 99 | free(Verts); 100 | 101 | return true; 102 | } 103 | 104 | 105 | int createObj(obj_t *obj, int numVerts, float *verts, float *txVert, 106 | float *norms, char *vertShader, char *fragShader) 107 | { 108 | obj->num_verts = numVerts; 109 | 110 | glGenVertexArrays(1, &obj->vao); 111 | glBindVertexArray(obj->vao); 112 | 113 | glGenBuffers(1, &obj->vbo_vert); 114 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_vert); 115 | glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 3 * numVerts, verts, 116 | GL_STATIC_DRAW); 117 | 118 | glGenBuffers(1, &obj->vbo_tex); 119 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_tex); 120 | glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 2 * numVerts, txVert, 121 | GL_STATIC_DRAW); 122 | 123 | glGenBuffers(1, &obj->vbo_norm); 124 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_norm); 125 | glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 3 * numVerts, norms, 126 | GL_STATIC_DRAW); 127 | 128 | GLint link_ok = GL_FALSE; 129 | 130 | GLuint vs, fs; 131 | if ((vs = create_shader(vertShader, GL_VERTEX_SHADER)) == 0) 132 | return -1; 133 | if ((fs = create_shader(fragShader, GL_FRAGMENT_SHADER)) == 0) 134 | return -1; 135 | 136 | obj->program = glCreateProgram(); 137 | glAttachShader(obj->program, vs); 138 | glAttachShader(obj->program, fs); 139 | glLinkProgram(obj->program); 140 | glGetProgramiv(obj->program, GL_LINK_STATUS, &link_ok); 141 | if (!link_ok) 142 | { 143 | fprintf(stderr,"error glLinkProgram\n"); 144 | int len; 145 | GLchar log[1024]; 146 | glGetProgramInfoLog(obj->program, 1024, &len, log); 147 | fprintf(stderr,"%s\n\n",log); 148 | return -1; 149 | } 150 | 151 | obj->vert_attrib = 152 | getShaderLocation(shaderAttrib, obj->program, "vertex_attrib"); 153 | glCheckError(__FILE__,__LINE__); 154 | obj->tex_attrib = 155 | getShaderLocation(shaderAttrib, obj->program, "uv_attrib"); 156 | glCheckError(__FILE__,__LINE__); 157 | obj->norm_attrib = 158 | getShaderLocation(shaderAttrib, obj->program, "norm_attrib"); 159 | glCheckError(__FILE__,__LINE__); 160 | obj->mvp_uniform = 161 | getShaderLocation(shaderUniform, obj->program, "mvp_uniform"); 162 | glCheckError(__FILE__,__LINE__); 163 | obj->mv_uniform = 164 | getShaderLocation(shaderUniform, obj->program, "mv_uniform"); 165 | glCheckError(__FILE__,__LINE__); 166 | obj->tex_uniform = 167 | getShaderLocation(shaderUniform, obj->program, "u_texture"); 168 | glCheckError(__FILE__,__LINE__); 169 | obj->lightDir_uniform = 170 | getShaderLocation(shaderUniform, obj->program, "u_lightDir"); 171 | glCheckError(__FILE__,__LINE__); 172 | obj->viewDir_uniform = 173 | getShaderLocation(shaderUniform, obj->program, "u_viewDir"); 174 | obj->sz_uniform = 175 | getShaderLocation(shaderUniform, obj->program, "sz_uniform"); 176 | glCheckError(__FILE__,__LINE__); 177 | 178 | glEnableVertexAttribArray(obj->vert_attrib); 179 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_vert); 180 | glVertexAttribPointer(obj->vert_attrib, 3, GL_FLOAT, GL_FALSE, 0, 0); 181 | 182 | glEnableVertexAttribArray(obj->norm_attrib); 183 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_norm); 184 | glVertexAttribPointer(obj->norm_attrib, 3, GL_FLOAT, GL_FALSE, 0, 0); 185 | 186 | glEnableVertexAttribArray(obj->tex_attrib); 187 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_tex); 188 | glVertexAttribPointer(obj->tex_attrib, 2, GL_FLOAT, GL_FALSE, 0, 0); 189 | 190 | glBindVertexArray(0); 191 | glCheckError(__FILE__,__LINE__); 192 | 193 | return 0; 194 | } 195 | 196 | /* 197 | * create an obj from supplied verts using an existing models shader 198 | */ 199 | int createObjCopyShader(obj_t *obj, int numVerts, float *verts, 200 | float *txVert, float *norms, obj_t *sdrobj) 201 | { 202 | obj->num_verts = numVerts; 203 | 204 | glGenVertexArrays(1, &obj->vao); 205 | glBindVertexArray(obj->vao); 206 | 207 | glGenBuffers(1, &obj->vbo_vert); 208 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_vert); 209 | glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 3 * numVerts, verts, 210 | GL_STATIC_DRAW); 211 | 212 | 213 | glGenBuffers(1, &obj->vbo_tex); 214 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_tex); 215 | glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 2 * numVerts, txVert, 216 | GL_STATIC_DRAW); 217 | 218 | 219 | glGenBuffers(1, &obj->vbo_norm); 220 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_norm); 221 | glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 3 * numVerts, norms, 222 | GL_STATIC_DRAW); 223 | 224 | obj->vert_attrib = sdrobj->vert_attrib; 225 | obj->tex_attrib = sdrobj->tex_attrib; 226 | obj->norm_attrib = sdrobj->norm_attrib; 227 | obj->mvp_uniform = sdrobj->mvp_uniform; 228 | obj->mv_uniform = sdrobj->mv_uniform; 229 | obj->tex_uniform = sdrobj->tex_uniform; 230 | obj->lightDir_uniform = sdrobj->lightDir_uniform; 231 | obj->viewDir_uniform = sdrobj->viewDir_uniform; 232 | obj->sz_uniform = sdrobj->sz_uniform; 233 | obj->program = sdrobj->program; 234 | 235 | glEnableVertexAttribArray(obj->vert_attrib); 236 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_vert); 237 | glVertexAttribPointer(obj->vert_attrib, 3, GL_FLOAT, GL_FALSE, 0, 0); 238 | 239 | glEnableVertexAttribArray(obj->norm_attrib); 240 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_norm); 241 | glVertexAttribPointer(obj->norm_attrib, 3, GL_FLOAT, GL_FALSE, 0, 0); 242 | 243 | glEnableVertexAttribArray(obj->tex_attrib); 244 | glBindBuffer(GL_ARRAY_BUFFER, obj->vbo_tex); 245 | glVertexAttribPointer(obj->tex_attrib, 2, GL_FLOAT, GL_FALSE, 0, 0); 246 | 247 | glBindVertexArray(0); 248 | glCheckError(__FILE__,__LINE__); 249 | 250 | return 0; 251 | } 252 | 253 | void drawObj(obj_t *obj, Vec sz, int texu, kmMat4 * combined, kmMat4 * mv, kmVec3 lightDir, kmVec3 viewDir) 254 | { 255 | glUseProgram(obj->program); 256 | 257 | glBindVertexArray(obj->vao); 258 | 259 | glUniformMatrix4fv(obj->mvp_uniform, 1, GL_FALSE, (GLfloat *) combined); 260 | glUniformMatrix4fv(obj->mv_uniform, 1, GL_FALSE, (GLfloat *) mv); 261 | glUniform1i(obj->tex_uniform, texu); 262 | glUniform3f(obj->sz_uniform, sz.x, sz.y, sz.z); 263 | glUniform3f(obj->viewDir_uniform,viewDir.x,viewDir.y,viewDir.z); 264 | glUniform3f(obj->lightDir_uniform,lightDir.x,lightDir.y,lightDir.z); 265 | 266 | glDrawArrays(GL_TRIANGLES, 0, obj->num_verts); 267 | 268 | glBindVertexArray(0); 269 | 270 | } 271 | -------------------------------------------------------------------------------- /GL3v3/src/util.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "util.h" 3 | #include "lodepng.h" 4 | #include 5 | 6 | float rand_range(float start,float range) { 7 | return start + range * ((float)rand() / RAND_MAX) ; 8 | } 9 | 10 | 11 | /** 12 | * Store all the file's contents in memory, useful to pass shaders 13 | * source code to OpenGL 14 | */ 15 | char *file_read(const char *filename) 16 | { 17 | FILE *in = fopen(filename, "rb"); 18 | if (in == NULL) 19 | return NULL; 20 | 21 | int res_size = BUFSIZ; 22 | char *res = (char *)malloc(res_size); 23 | int nb_read_total = 0; 24 | 25 | while (!feof(in) && !ferror(in)) 26 | { 27 | if (nb_read_total + BUFSIZ > res_size) 28 | { 29 | if (res_size > 10 * 1024 * 1024) 30 | break; 31 | res_size = res_size * 2; 32 | res = (char *)realloc(res, res_size); 33 | } 34 | char *p_res = res + nb_read_total; 35 | nb_read_total += fread(p_res, 1, BUFSIZ, in); 36 | } 37 | 38 | fclose(in); 39 | res = (char *)realloc(res, nb_read_total + 1); 40 | res[nb_read_total] = '\0'; 41 | return res; 42 | } 43 | 44 | 45 | GLuint getShaderLocation(int type, GLuint prog, const char *name) 46 | { 47 | GLuint ret=-1; 48 | if (type == shaderAttrib) 49 | ret = glGetAttribLocation(prog, name); 50 | if (type == shaderUniform) 51 | ret = glGetUniformLocation(prog, name); 52 | if (ret == -1) 53 | { 54 | printf("Cound not bind shader location %s\n", name); 55 | } 56 | return ret; 57 | } 58 | 59 | /** 60 | * Compile the shader from file 'filename', with error handling 61 | */ 62 | GLuint create_shader(const char *filename, GLenum type) { 63 | const GLchar *source = file_read(filename); 64 | if (source == NULL) 65 | { 66 | fprintf(stderr, "Error opening %s: ", filename); 67 | perror(""); 68 | return 0; 69 | } 70 | GLuint res = glCreateShader(type); 71 | const GLchar *sources[] = { source }; 72 | glShaderSource(res, 1, sources, NULL); 73 | free((void *)source); 74 | 75 | glCompileShader(res); 76 | GLint compile_ok = GL_FALSE; 77 | glGetShaderiv(res, GL_COMPILE_STATUS, &compile_ok); 78 | if (compile_ok == GL_FALSE) 79 | { 80 | fprintf(stderr, "%s:\n", filename); 81 | int len; 82 | GLchar log[1024]; 83 | glGetShaderInfoLog(res, 1024, &len, log); 84 | fprintf(stderr,"%s\n\n",log); 85 | glDeleteShader(res); 86 | return 0; 87 | } 88 | 89 | return res; 90 | } 91 | 92 | struct token_string 93 | { 94 | GLuint Token; 95 | const char *String; 96 | }; 97 | 98 | static const struct token_string Errors[] = { 99 | { GL_NO_ERROR, "no error" }, 100 | { GL_INVALID_ENUM, "invalid enumerant" }, 101 | { GL_INVALID_VALUE, "invalid value" }, 102 | { GL_INVALID_OPERATION, "invalid operation" }, 103 | { GL_OUT_OF_MEMORY, "out of memory" }, 104 | #ifdef GL_EXT_framebuffer_object 105 | { GL_INVALID_FRAMEBUFFER_OPERATION_EXT, "invalid framebuffer operation" }, 106 | #endif 107 | { ~0, NULL } /* end of list indicator */ 108 | }; 109 | 110 | 111 | 112 | const GLubyte* 113 | glErrorString(GLenum errorCode) 114 | { 115 | int i; 116 | for (i = 0; Errors[i].String; i++) { 117 | if (Errors[i].Token == errorCode) 118 | return (const GLubyte *) Errors[i].String; 119 | } 120 | 121 | return (const GLubyte *) 0; 122 | } 123 | 124 | void glCheckError(char* f, int l) { 125 | int e = glGetError(); 126 | if (e == GL_NO_ERROR) return; 127 | fprintf(stderr,"file %s line %i: %s\n",f,l,glErrorString(e)); 128 | } 129 | 130 | // returns GL texture handle 131 | int loadPNG(const char *filename) { 132 | 133 | unsigned error; 134 | unsigned char* image; 135 | unsigned w, h; 136 | GLuint texture; 137 | LodePNGState state; 138 | unsigned char* png; 139 | size_t pngsize; 140 | size_t components; 141 | 142 | lodepng_state_init(&state); 143 | lodepng_load_file(&png, &pngsize, filename); 144 | error = lodepng_inspect(&w, &h, &state, png, 1024); 145 | if (error) 146 | { 147 | printf("error loading %s\n",filename); 148 | return 0; 149 | } 150 | 151 | GLenum glcolortype = GL_RGBA; 152 | LodePNGColorMode colormode = state.info_png.color; 153 | // unsigned bitdepth = colormode.bitdepth; 154 | LodePNGColorType colortype = colormode.colortype; 155 | switch(colortype) 156 | { 157 | /* 158 | case LCT_GREY: 159 | glcolortype = GL_LUMINANCE; 160 | error = lodepng_decode_memory(&image, &w, &h, png, pngsize, colortype, bitdepth); 161 | components = 1; 162 | break; 163 | case LCT_GREY_ALPHA: 164 | glcolortype = GL_LUMINANCE_ALPHA; 165 | error = lodepng_decode_memory(&image, &w, &h, png, pngsize, colortype, bitdepth); 166 | components = 2; 167 | break; 168 | */ 169 | case LCT_RGB: 170 | glcolortype = GL_RGB; 171 | error = lodepng_decode24(&image, &w, &h, png, pngsize); 172 | components = 3; 173 | break; 174 | case LCT_RGBA: 175 | glcolortype = GL_RGBA; 176 | error = lodepng_decode32(&image, &w, &h, png, pngsize); 177 | components = 4; 178 | break; 179 | case LCT_PALETTE: 180 | default: 181 | glcolortype = GL_RGBA; 182 | error = lodepng_decode32(&image, &w, &h, png, pngsize); 183 | components = 4; 184 | break; 185 | } 186 | 187 | if(error) 188 | { 189 | printf("PNG decoder error %u: %s\n", error, lodepng_error_text(error)); 190 | return 0; 191 | } 192 | 193 | free(png); 194 | 195 | // Texture size must be power of 2 (for some implementations of GLES) 196 | // Find next power of two 197 | size_t u2 = 1; 198 | while(u2 < w) u2 *= 2; 199 | size_t v2 = 1; 200 | while(v2 < h) v2 *= 2; 201 | 202 | // Make power of two version of the image. 203 | unsigned char *image2 = (unsigned char *)malloc(sizeof(unsigned char) * u2 * v2 * components); 204 | for(size_t y = 0; y < h; y++) 205 | { 206 | for(size_t x = 0; x < w; x++) 207 | { 208 | for(size_t c = 0; c < components; c++) 209 | { 210 | unsigned char val = image[components * w * y + components * x + c]; 211 | image2[components * u2 * y + components * x + c] = val; 212 | } 213 | } 214 | } 215 | 216 | glGenTextures(1, &texture); 217 | glBindTexture(GL_TEXTURE_2D, texture); 218 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 219 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 220 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 221 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 222 | 223 | glTexImage2D(GL_TEXTURE_2D, 0, glcolortype, u2, v2, 0, glcolortype, GL_UNSIGNED_BYTE, image2); 224 | 225 | /*cleanup*/ 226 | lodepng_state_cleanup(&state); 227 | free(image2); 228 | free(image); 229 | 230 | return texture; 231 | } 232 | -------------------------------------------------------------------------------- /GL3v3/valgind.suppression.txt: -------------------------------------------------------------------------------- 1 | { 2 | cond 3 | Memcheck:Cond 4 | fun:sqrtf 5 | } 6 | 7 | { 8 | cond 9 | Memcheck:Cond 10 | fun:kmVec3Normalize 11 | } 12 | 13 | { 14 | cond 15 | Memcheck:Cond 16 | fun:__cos_avx 17 | } 18 | 19 | { 20 | cond 21 | Memcheck:Cond 22 | fun:__sin_avx 23 | } 24 | 25 | { 26 | val8 27 | Memcheck:Value8 28 | fun:do_cos 29 | } 30 | 31 | { 32 | val8 33 | Memcheck:Value8 34 | fun:do_sin 35 | } 36 | 37 | { 38 | ignore video driver 39 | Memcheck:Addr8 40 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 41 | } 42 | 43 | { 44 | ignore video driver 45 | Memcheck:Addr4 46 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 47 | } 48 | 49 | { 50 | ignore video driver 51 | Memcheck:Addr1 52 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 53 | } 54 | 55 | { 56 | ignore video driver 57 | Memcheck:Addr8 58 | fun:memmove 59 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 60 | } 61 | 62 | { 63 | ignore video driver 64 | Memcheck:Addr8 65 | fun:bcmp 66 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 67 | } 68 | 69 | { 70 | ignore video driver 71 | Memcheck:Addr4 72 | fun:memmove 73 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 74 | } 75 | 76 | { 77 | ignore video driver 78 | Memcheck:Addr2 79 | fun:memmove 80 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 81 | } 82 | 83 | { 84 | ignore video driver 85 | Memcheck:Addr1 86 | fun:bcmp 87 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 88 | } 89 | 90 | { 91 | ignore video driver 92 | Memcheck:Addr1 93 | fun:memmove 94 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 95 | } 96 | -------------------------------------------------------------------------------- /capi/Makefile: -------------------------------------------------------------------------------- 1 | 2 | FLAGS=-Ofast -c -I$(BULL) --fast-math 3 | #-Wfatal-errors 4 | 5 | 6 | all: test 7 | 8 | include bullet.mk 9 | 10 | capi.a: capi.cpp lib/libbullet.a 11 | g++ $(FLAGS) capi.cpp -o obj/capi.o 12 | ar rcs capi.a obj/capi.o 13 | 14 | test: obj/test.o capi.a 15 | g++ obj/test.o capi.a lib/libbullet.a -o test 16 | 17 | obj/test.o: test.c 18 | gcc -std=c11 $(FLAGS) test.c -o obj/test.o 19 | 20 | cleanall: clean 21 | rm -rf obj/*.o 22 | rm -rf lib/libbullet.a 23 | 24 | clean: 25 | rm -rf test 26 | rm -rf obj/test.o 27 | rm -rf obj/capi.o 28 | rm -rf capi.a 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /capi/bullet.mk: -------------------------------------------------------------------------------- 1 | # root of bullet source code 2 | BULL=../../bullet3/src/ 3 | 4 | # sources required from each bullet component 5 | CollisionShapesSRC=$(BULL)BulletCollision/CollisionShapes/btConcaveShape.cpp \ 6 | $(BULL)BulletCollision/CollisionShapes/btOptimizedBvh.cpp \ 7 | $(BULL)BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \ 8 | $(BULL)BulletCollision/CollisionShapes/btConvexPolyhedron.cpp \ 9 | $(BULL)BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \ 10 | $(BULL)BulletCollision/CollisionShapes/btTriangleCallback.cpp \ 11 | $(BULL)BulletCollision/CollisionShapes/btCollisionShape.cpp \ 12 | $(BULL)BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \ 13 | $(BULL)BulletCollision/CollisionShapes/btSphereShape.cpp \ 14 | $(BULL)BulletCollision/CollisionShapes/btConvexShape.cpp \ 15 | $(BULL)BulletCollision/CollisionShapes/btConvexInternalShape.cpp \ 16 | $(BULL)BulletCollision/CollisionShapes/btBoxShape.cpp \ 17 | $(BULL)BulletCollision/CollisionShapes/btCylinderShape.cpp \ 18 | $(BULL)BulletCollision/CollisionShapes/btCompoundShape.cpp \ 19 | $(BULL)BulletCollision/CollisionShapes/btSdfCollisionShape.cpp \ 20 | $(BULL)BulletCollision/CollisionShapes/btMiniSDF.cpp 21 | 22 | CollisionDispatchSRC=$(BULL)BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \ 23 | $(BULL)BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \ 24 | $(BULL)BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \ 25 | $(BULL)BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp \ 26 | $(BULL)BulletCollision/CollisionDispatch/btHashedSimplePairCache.cpp \ 27 | $(BULL)BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp \ 28 | $(BULL)BulletCollision/CollisionDispatch/btUnionFind.cpp \ 29 | $(BULL)BulletCollision/CollisionDispatch/btCollisionObject.cpp \ 30 | $(BULL)BulletCollision/CollisionDispatch/btCollisionWorld.cpp \ 31 | $(BULL)BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \ 32 | $(BULL)BulletCollision/CollisionDispatch/btManifoldResult.cpp \ 33 | $(BULL)BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \ 34 | $(BULL)BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp \ 35 | $(BULL)BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \ 36 | $(BULL)BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp \ 37 | $(BULL)BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp \ 38 | $(BULL)BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \ 39 | $(BULL)BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \ 40 | $(BULL)BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \ 41 | $(BULL)BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp 42 | 43 | BroadphaseCollisionSRC=$(BULL)BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp \ 44 | $(BULL)BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \ 45 | $(BULL)BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \ 46 | $(BULL)BulletCollision/BroadphaseCollision/btDbvt.cpp \ 47 | $(BULL)BulletCollision/BroadphaseCollision/btDispatcher.cpp \ 48 | $(BULL)BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp 49 | 50 | NarrowPhaseCollisionSRC=$(BULL)BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \ 51 | $(BULL)BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp \ 52 | $(BULL)BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \ 53 | $(BULL)BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \ 54 | $(BULL)BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \ 55 | $(BULL)BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \ 56 | $(BULL)BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp \ 57 | $(BULL)BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \ 58 | $(BULL)BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \ 59 | $(BULL)BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \ 60 | $(BULL)BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \ 61 | $(BULL)BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp 62 | 63 | DynamicsSRC=$(BULL)BulletDynamics/Dynamics/btRigidBody.cpp \ 64 | $(BULL)BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp 65 | 66 | ConstraintSolverSRC=$(BULL)BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \ 67 | $(BULL)BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \ 68 | $(BULL)BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \ 69 | $(BULL)BulletDynamics/ConstraintSolver/btTypedConstraint.cpp \ 70 | $(BULL)BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp \ 71 | $(BULL)BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.cpp \ 72 | $(BULL)BulletDynamics/ConstraintSolver/btHingeConstraint.cpp 73 | 74 | LinearMathSRC=$(BULL)LinearMath/btConvexHullComputer.cpp \ 75 | $(BULL)LinearMath/btGeometryUtil.cpp \ 76 | $(BULL)LinearMath/btQuickprof.cpp \ 77 | $(BULL)LinearMath/btAlignedAllocator.cpp 78 | 79 | # list .o files for each bullet component 80 | LinearMathOBJ=$(patsubst $(BULL)LinearMath/%.cpp,obj/%.o,$(LinearMathSRC)) 81 | ConstraintSolverOBJ=$(patsubst $(BULL)BulletDynamics/ConstraintSolver/%.cpp,obj/%.o,$(ConstraintSolverSRC)) 82 | DynamicsOBJ=$(patsubst $(BULL)BulletDynamics/Dynamics/%.cpp,obj/%.o,$(DynamicsSRC)) 83 | NarrowPhaseCollisionOBJ=$(patsubst $(BULL)BulletCollision/NarrowPhaseCollision/%.cpp,obj/%.o,$(NarrowPhaseCollisionSRC)) 84 | BroadphaseCollisionOBJ=$(patsubst $(BULL)BulletCollision/BroadphaseCollision/%.cpp,obj/%.o,$(BroadphaseCollisionSRC)) 85 | CollisionDispatchOBJ=$(patsubst $(BULL)BulletCollision/CollisionDispatch/%.cpp,obj/%.o,$(CollisionDispatchSRC)) 86 | CollisionShapesOBJ=$(patsubst $(BULL)BulletCollision/CollisionShapes/%.cpp,obj/%.o,$(CollisionShapesSRC)) 87 | 88 | # all the bullet components together (object files) 89 | BOBJ=$(LinearMathOBJ) $(ConstraintSolverOBJ) $(DynamicsOBJ) \ 90 | $(NarrowPhaseCollisionOBJ) $(BroadphaseCollisionOBJ) \ 91 | $(CollisionDispatchOBJ) $(CollisionShapesOBJ) $(SharedMemoryOBJ) 92 | 93 | 94 | # compile rule for each component of bullet 95 | $(LinearMathOBJ): obj/%.o: $(BULL)LinearMath/%.cpp 96 | g++ $(FLAGS) -o $@ $^ 97 | 98 | $(ConstraintSolverOBJ): obj/%.o: $(BULL)BulletDynamics/ConstraintSolver/%.cpp 99 | g++ $(FLAGS) -o $@ $^ 100 | 101 | $(DynamicsOBJ): obj/%.o: $(BULL)BulletDynamics/Dynamics/%.cpp 102 | g++ $(FLAGS) -o $@ $^ 103 | 104 | $(NarrowPhaseCollisionOBJ): obj/%.o: $(BULL)BulletCollision/NarrowPhaseCollision/%.cpp 105 | g++ $(FLAGS) -o $@ $^ 106 | 107 | $(BroadphaseCollisionOBJ): obj/%.o: $(BULL)BulletCollision/BroadphaseCollision/%.cpp 108 | g++ $(FLAGS) -o $@ $^ 109 | 110 | $(CollisionDispatchOBJ): obj/%.o: $(BULL)BulletCollision/CollisionDispatch/%.cpp 111 | g++ $(FLAGS) -o $@ $^ 112 | 113 | $(CollisionShapesOBJ): obj/%.o: $(BULL)BulletCollision/CollisionShapes/%.cpp 114 | g++ $(FLAGS) -o $@ $^ 115 | 116 | lib/libbullet.a: $(BOBJ) 117 | ar -cvq lib/libbullet.a $(BOBJ) 118 | 119 | -------------------------------------------------------------------------------- /capi/capi.hpp: -------------------------------------------------------------------------------- 1 | /// note to self, use camel case, 'cause such irrelevancies, are just *loved* on reddit 2 | 3 | #include "btBulletDynamicsCommon.h" 4 | 5 | // C-api only sees this as a void pointer like bullet class pointers 6 | /** \cond HIDDEN */ 7 | typedef struct { 8 | btDefaultCollisionConfiguration* collisionConfiguration; 9 | btCollisionDispatcher* dispatcher; 10 | btBroadphaseInterface* broadphase; 11 | btSequentialImpulseConstraintSolver* solver; 12 | btDiscreteDynamicsWorld* dynamicsWorld; 13 | btAlignedObjectArray *collisionShapes; 14 | } universe; 15 | /** \endcond */ 16 | // to ease casting a void* 17 | #define UNI(x) ((universe*)x) 18 | #define SHAPE(x) ((btCollisionShape*)x) 19 | #define BODY(x) ((btRigidBody*)x) 20 | #define JOINT(x) ((btTypedConstraint*)x) 21 | 22 | 23 | extern "C" { 24 | 25 | #include "capi.h" 26 | 27 | } 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /capi/doc/html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: Data Structures 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
bulletCapi 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 |
49 | 50 |
54 |
55 | 56 | 57 |
58 | 61 |
62 | 63 |
64 |
65 |
Data Structures
66 |
67 |
68 |
Here are the data structures with brief descriptions:
69 | 70 | 71 |
 CVec
72 |
73 |
74 | 75 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /capi/doc/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/bc_s.png -------------------------------------------------------------------------------- /capi/doc/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/bdwn.png -------------------------------------------------------------------------------- /capi/doc/html/capi_8hpp_source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: capi.hpp Source File 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
bulletCapi 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 |
49 | 50 |
54 |
55 | 56 | 57 |
58 | 61 |
62 | 63 |
64 |
65 |
capi.hpp
66 |
67 |
68 |
1 
3 #include "btBulletDynamicsCommon.h"
4 
5 // C-api only sees this as a void pointer like bullet class pointers
7 typedef struct {
8  btDefaultCollisionConfiguration* collisionConfiguration;
9  btCollisionDispatcher* dispatcher;
10  btBroadphaseInterface* broadphase;
11  btSequentialImpulseConstraintSolver* solver;
12  btDiscreteDynamicsWorld* dynamicsWorld;
13  btAlignedObjectArray<btCollisionShape*> *collisionShapes;
14 } universe;
16 // to ease casting a void*
17 #define UNI(x) ((universe*)x)
18 #define SHAPE(x) ((btCollisionShape*)x)
19 #define BODY(x) ((btRigidBody*)x)
20 #define JOINT(x) ((btTypedConstraint*)x)
21 
22 
23 extern "C" {
24 
25  #include "capi.h"
26 
27 }
28 
29 
30 
31 
32 
33 
34 
a C wrapper for the bullet physics engine
69 |
70 | 71 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /capi/doc/html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: Data Structure Index 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
bulletCapi 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 |
49 | 50 |
54 |
55 | 56 | 57 |
58 | 61 |
62 | 63 |
64 |
65 |
Data Structure Index
66 |
67 |
68 | 69 | 70 | 72 | 73 | 74 | 75 |
  v  
71 |
Vec   
76 | 77 |
78 | 79 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /capi/doc/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/closed.png -------------------------------------------------------------------------------- /capi/doc/html/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/doc.png -------------------------------------------------------------------------------- /capi/doc/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/doxygen.png -------------------------------------------------------------------------------- /capi/doc/html/dynsections.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the 3 | JavaScript code in this file. 4 | 5 | Copyright (C) 1997-2017 by Dimitri van Heesch 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License along 18 | with this program; if not, write to the Free Software Foundation, Inc., 19 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 | 21 | @licend The above is the entire license notice 22 | for the JavaScript code in this file 23 | */ 24 | function toggleVisibility(linkObj) 25 | { 26 | var base = $(linkObj).attr('id'); 27 | var summary = $('#'+base+'-summary'); 28 | var content = $('#'+base+'-content'); 29 | var trigger = $('#'+base+'-trigger'); 30 | var src=$(trigger).attr('src'); 31 | if (content.is(':visible')===true) { 32 | content.hide(); 33 | summary.show(); 34 | $(linkObj).addClass('closed').removeClass('opened'); 35 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); 36 | } else { 37 | content.show(); 38 | summary.hide(); 39 | $(linkObj).removeClass('closed').addClass('opened'); 40 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); 41 | } 42 | return false; 43 | } 44 | 45 | function updateStripes() 46 | { 47 | $('table.directory tr'). 48 | removeClass('even').filter(':visible:even').addClass('even'); 49 | } 50 | 51 | function toggleLevel(level) 52 | { 53 | $('table.directory tr').each(function() { 54 | var l = this.id.split('_').length-1; 55 | var i = $('#img'+this.id.substring(3)); 56 | var a = $('#arr'+this.id.substring(3)); 57 | if (l 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: File List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
bulletCapi 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 |
49 | 50 |
54 |
55 | 56 | 57 |
58 | 61 |
62 | 63 |
64 |
65 |
File List
66 |
67 |
68 |
Here is a list of all documented files with brief descriptions:
69 | 70 | 71 | 72 |
 capi.hC wrapper for the bullet physics engine
 capi.hpp
73 |
74 |
75 | 76 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /capi/doc/html/folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/folderclosed.png -------------------------------------------------------------------------------- /capi/doc/html/folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/folderopen.png -------------------------------------------------------------------------------- /capi/doc/html/globals.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: Globals 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
bulletCapi 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 |
49 | 50 |
54 |
55 | 56 | 57 |
58 | 61 |
62 | 63 |
64 |
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
65 | 66 |

- b -

    67 |
  • bodyApplyImpulse() 68 | : capi.h 69 |
  • 70 |
  • bodyApplyTorque() 71 | : capi.h 72 |
  • 73 |
  • bodyCreate() 74 | : capi.h 75 |
  • 76 |
  • bodyDelete() 77 | : capi.h 78 |
  • 79 |
  • bodyGetAngularVelocity() 80 | : capi.h 81 |
  • 82 |
  • bodyGetFriction() 83 | : capi.h 84 |
  • 85 |
  • bodyGetLinearVelocity() 86 | : capi.h 87 |
  • 88 |
  • bodyGetOpenGLMatrix() 89 | : capi.h 90 |
  • 91 |
  • bodyGetOrientation() 92 | : capi.h 93 |
  • 94 |
  • bodyGetPosition() 95 | : capi.h 96 |
  • 97 |
  • bodyGetPositionAndOrientation() 98 | : capi.h 99 |
  • 100 |
  • bodyGetShape() 101 | : capi.h 102 |
  • 103 |
  • bodyGetShapeType() 104 | : capi.h 105 |
  • 106 |
  • bodyRemove() 107 | : capi.h 108 |
  • 109 |
  • bodySetAngularVelocity() 110 | : capi.h 111 |
  • 112 |
  • bodySetDeactivation() 113 | : capi.h 114 |
  • 115 |
  • bodySetFriction() 116 | : capi.h 117 |
  • 118 |
  • bodySetLinearVelocity() 119 | : capi.h 120 |
  • 121 |
  • bodySetPosition() 122 | : capi.h 123 |
  • 124 |
  • bodySetRestitution() 125 | : capi.h 126 |
  • 127 |
  • bodySetRotation() 128 | : capi.h 129 |
  • 130 |
  • bodySetRotationEular() 131 | : capi.h 132 |
  • 133 |
134 | 135 | 136 |

- c -

    137 |
  • collisionCallback() 138 | : capi.h 139 |
  • 140 |
  • compoundAddChild() 141 | : capi.h 142 |
  • 143 |
  • compoundGetNumChildren() 144 | : capi.h 145 |
  • 146 |
  • compoundRemoveShape() 147 | : capi.h 148 |
  • 149 |
  • constraintIsEnabled() 150 | : capi.h 151 |
  • 152 |
  • ConstraintParams 153 | : capi.h 154 |
  • 155 |
  • constraintSetEnabled() 156 | : capi.h 157 |
  • 158 |
  • constraintSetParam() 159 | : capi.h 160 |
  • 161 |
162 | 163 | 164 |

- d -

    165 |
  • DEACTIVATION_DISABLE 166 | : capi.h 167 |
  • 168 |
  • DEACTIVATION_ENABLE 169 | : capi.h 170 |
  • 171 |
172 | 173 | 174 |

- h -

    175 |
  • hinge2Create() 176 | : capi.h 177 |
  • 178 |
  • hinge2enableMotor() 179 | : capi.h 180 |
  • 181 |
  • hinge2getAngle1() 182 | : capi.h 183 |
  • 184 |
  • hinge2getAngle2() 185 | : capi.h 186 |
  • 187 |
  • hinge2setDamping() 188 | : capi.h 189 |
  • 190 |
  • hinge2setLowerLimit() 191 | : capi.h 192 |
  • 193 |
  • hinge2setMaxMotorForce() 194 | : capi.h 195 |
  • 196 |
  • hinge2setStiffness() 197 | : capi.h 198 |
  • 199 |
  • hinge2setTargetVelocity() 200 | : capi.h 201 |
  • 202 |
  • hinge2setUpperLimit() 203 | : capi.h 204 |
  • 205 |
  • hingeCreate() 206 | : capi.h 207 |
  • 208 |
  • hingeEnableAngularMotor() 209 | : capi.h 210 |
  • 211 |
  • hingeSetLimit() 212 | : capi.h 213 |
  • 214 |
215 | 216 | 217 |

- s -

    218 |
  • shapeCreateBox() 219 | : capi.h 220 |
  • 221 |
  • shapeCreateCompound() 222 | : capi.h 223 |
  • 224 |
  • shapeCreateCylinderX() 225 | : capi.h 226 |
  • 227 |
  • shapeCreateCylinderY() 228 | : capi.h 229 |
  • 230 |
  • shapeCreateCylinderZ() 231 | : capi.h 232 |
  • 233 |
  • shapeCreateSphere() 234 | : capi.h 235 |
  • 236 |
  • shapeDelete() 237 | : capi.h 238 |
  • 239 |
  • ShapeType 240 | : capi.h 241 |
  • 242 |
243 | 244 | 245 |

- u -

    246 |
  • universeCreate() 247 | : capi.h 248 |
  • 249 |
  • universeDestroy() 250 | : capi.h 251 |
  • 252 |
  • universeSetGravity() 253 | : capi.h 254 |
  • 255 |
  • universeStep() 256 | : capi.h 257 |
  • 258 |
259 |
260 | 261 | 266 | 267 | 268 | -------------------------------------------------------------------------------- /capi/doc/html/globals_defs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: Globals 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
bulletCapi 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 |
49 | 50 |
54 |
55 | 56 | 57 |
58 | 61 |
62 | 63 |
64 |  
    65 |
  • DEACTIVATION_DISABLE 66 | : capi.h 67 |
  • 68 |
  • DEACTIVATION_ENABLE 69 | : capi.h 70 |
  • 71 |
72 |
73 | 74 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /capi/doc/html/globals_enum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: Globals 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
bulletCapi 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 |
49 | 50 |
54 |
55 | 56 | 57 |
58 | 61 |
62 | 63 |
64 |  
    65 |
  • ConstraintParams 66 | : capi.h 67 |
  • 68 |
  • ShapeType 69 | : capi.h 70 |
  • 71 |
72 |
73 | 74 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /capi/doc/html/globals_func.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: Globals 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
bulletCapi 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 |
49 | 50 |
54 |
55 | 56 | 57 |
58 | 61 |
62 | 63 |
64 |   65 | 66 |

- b -

    67 |
  • bodyApplyImpulse() 68 | : capi.h 69 |
  • 70 |
  • bodyApplyTorque() 71 | : capi.h 72 |
  • 73 |
  • bodyCreate() 74 | : capi.h 75 |
  • 76 |
  • bodyDelete() 77 | : capi.h 78 |
  • 79 |
  • bodyGetAngularVelocity() 80 | : capi.h 81 |
  • 82 |
  • bodyGetFriction() 83 | : capi.h 84 |
  • 85 |
  • bodyGetLinearVelocity() 86 | : capi.h 87 |
  • 88 |
  • bodyGetOpenGLMatrix() 89 | : capi.h 90 |
  • 91 |
  • bodyGetOrientation() 92 | : capi.h 93 |
  • 94 |
  • bodyGetPosition() 95 | : capi.h 96 |
  • 97 |
  • bodyGetPositionAndOrientation() 98 | : capi.h 99 |
  • 100 |
  • bodyGetShape() 101 | : capi.h 102 |
  • 103 |
  • bodyGetShapeType() 104 | : capi.h 105 |
  • 106 |
  • bodyRemove() 107 | : capi.h 108 |
  • 109 |
  • bodySetAngularVelocity() 110 | : capi.h 111 |
  • 112 |
  • bodySetDeactivation() 113 | : capi.h 114 |
  • 115 |
  • bodySetFriction() 116 | : capi.h 117 |
  • 118 |
  • bodySetLinearVelocity() 119 | : capi.h 120 |
  • 121 |
  • bodySetPosition() 122 | : capi.h 123 |
  • 124 |
  • bodySetRestitution() 125 | : capi.h 126 |
  • 127 |
  • bodySetRotation() 128 | : capi.h 129 |
  • 130 |
  • bodySetRotationEular() 131 | : capi.h 132 |
  • 133 |
134 | 135 | 136 |

- c -

    137 |
  • collisionCallback() 138 | : capi.h 139 |
  • 140 |
  • compoundAddChild() 141 | : capi.h 142 |
  • 143 |
  • compoundGetNumChildren() 144 | : capi.h 145 |
  • 146 |
  • compoundRemoveShape() 147 | : capi.h 148 |
  • 149 |
  • constraintIsEnabled() 150 | : capi.h 151 |
  • 152 |
  • constraintSetEnabled() 153 | : capi.h 154 |
  • 155 |
  • constraintSetParam() 156 | : capi.h 157 |
  • 158 |
159 | 160 | 161 |

- h -

    162 |
  • hinge2Create() 163 | : capi.h 164 |
  • 165 |
  • hinge2enableMotor() 166 | : capi.h 167 |
  • 168 |
  • hinge2getAngle1() 169 | : capi.h 170 |
  • 171 |
  • hinge2getAngle2() 172 | : capi.h 173 |
  • 174 |
  • hinge2setDamping() 175 | : capi.h 176 |
  • 177 |
  • hinge2setLowerLimit() 178 | : capi.h 179 |
  • 180 |
  • hinge2setMaxMotorForce() 181 | : capi.h 182 |
  • 183 |
  • hinge2setStiffness() 184 | : capi.h 185 |
  • 186 |
  • hinge2setTargetVelocity() 187 | : capi.h 188 |
  • 189 |
  • hinge2setUpperLimit() 190 | : capi.h 191 |
  • 192 |
  • hingeCreate() 193 | : capi.h 194 |
  • 195 |
  • hingeEnableAngularMotor() 196 | : capi.h 197 |
  • 198 |
  • hingeSetLimit() 199 | : capi.h 200 |
  • 201 |
202 | 203 | 204 |

- s -

    205 |
  • shapeCreateBox() 206 | : capi.h 207 |
  • 208 |
  • shapeCreateCompound() 209 | : capi.h 210 |
  • 211 |
  • shapeCreateCylinderX() 212 | : capi.h 213 |
  • 214 |
  • shapeCreateCylinderY() 215 | : capi.h 216 |
  • 217 |
  • shapeCreateCylinderZ() 218 | : capi.h 219 |
  • 220 |
  • shapeCreateSphere() 221 | : capi.h 222 |
  • 223 |
  • shapeDelete() 224 | : capi.h 225 |
  • 226 |
227 | 228 | 229 |

- u -

    230 |
  • universeCreate() 231 | : capi.h 232 |
  • 233 |
  • universeDestroy() 234 | : capi.h 235 |
  • 236 |
  • universeSetGravity() 237 | : capi.h 238 |
  • 239 |
  • universeStep() 240 | : capi.h 241 |
  • 242 |
243 |
244 | 245 | 250 | 251 | 252 | -------------------------------------------------------------------------------- /capi/doc/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: Main Page 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
bulletCapi 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 |
49 | 50 |
54 |
55 | 56 | 57 |
58 | 61 |
62 | 63 |
64 |
65 |
bulletCapi Documentation
66 |
67 |
68 |
69 | 70 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /capi/doc/html/menu.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the 3 | JavaScript code in this file. 4 | 5 | Copyright (C) 1997-2017 by Dimitri van Heesch 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License along 18 | with this program; if not, write to the Free Software Foundation, Inc., 19 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 | 21 | @licend The above is the entire license notice 22 | for the JavaScript code in this file 23 | */ 24 | function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { 25 | function makeTree(data,relPath) { 26 | var result=''; 27 | if ('children' in data) { 28 | result+=''; 35 | } 36 | return result; 37 | } 38 | 39 | $('#main-nav').append(makeTree(menudata,relPath)); 40 | $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); 41 | if (searchEnabled) { 42 | if (serverSide) { 43 | $('#main-menu').append('
  • '); 44 | } else { 45 | $('#main-menu').append('
  • '); 46 | } 47 | } 48 | $('#main-menu').smartmenus(); 49 | } 50 | /* @license-end */ 51 | -------------------------------------------------------------------------------- /capi/doc/html/menudata.js: -------------------------------------------------------------------------------- 1 | /* 2 | @ @licstart The following is the entire license notice for the 3 | JavaScript code in this file. 4 | 5 | Copyright (C) 1997-2017 by Dimitri van Heesch 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License along 18 | with this program; if not, write to the Free Software Foundation, Inc., 19 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 | 21 | @licend The above is the entire license notice 22 | for the JavaScript code in this file 23 | */ 24 | var menudata={children:[ 25 | {text:"Main Page",url:"index.html"}, 26 | {text:"Data Structures",url:"annotated.html",children:[ 27 | {text:"Data Structures",url:"annotated.html"}, 28 | {text:"Data Structure Index",url:"classes.html"}]}, 29 | {text:"Files",url:"files.html",children:[ 30 | {text:"File List",url:"files.html"}, 31 | {text:"Globals",url:"globals.html",children:[ 32 | {text:"All",url:"globals.html",children:[ 33 | {text:"b",url:"globals.html#index_b"}, 34 | {text:"c",url:"globals.html#index_c"}, 35 | {text:"d",url:"globals.html#index_d"}, 36 | {text:"h",url:"globals.html#index_h"}, 37 | {text:"s",url:"globals.html#index_s"}, 38 | {text:"u",url:"globals.html#index_u"}]}, 39 | {text:"Functions",url:"globals_func.html",children:[ 40 | {text:"b",url:"globals_func.html#index_b"}, 41 | {text:"c",url:"globals_func.html#index_c"}, 42 | {text:"h",url:"globals_func.html#index_h"}, 43 | {text:"s",url:"globals_func.html#index_s"}, 44 | {text:"u",url:"globals_func.html#index_u"}]}, 45 | {text:"Enumerations",url:"globals_enum.html"}, 46 | {text:"Macros",url:"globals_defs.html"}]}]}]} 47 | -------------------------------------------------------------------------------- /capi/doc/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/nav_f.png -------------------------------------------------------------------------------- /capi/doc/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/nav_g.png -------------------------------------------------------------------------------- /capi/doc/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/nav_h.png -------------------------------------------------------------------------------- /capi/doc/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/open.png -------------------------------------------------------------------------------- /capi/doc/html/search/all_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['bodyapplyimpulse',['bodyApplyImpulse',['../capi_8h.html#a8992b561935682783cf9eb8668ee8088',1,'capi.cpp']]], 4 | ['bodyapplytorque',['bodyApplyTorque',['../capi_8h.html#a2a64d2c84ad3e182ad6a103ec546a43a',1,'capi.cpp']]], 5 | ['bodycreate',['bodyCreate',['../capi_8h.html#a881080af2fdc2186367e5de23552e90b',1,'capi.cpp']]], 6 | ['bodydelete',['bodyDelete',['../capi_8h.html#a1e8f0a89244cfc35af83640d3a52332c',1,'capi.cpp']]], 7 | ['bodygetangularvelocity',['bodyGetAngularVelocity',['../capi_8h.html#a145c14111a443f7262592085ac960e4d',1,'capi.cpp']]], 8 | ['bodygetfriction',['bodyGetFriction',['../capi_8h.html#ab8625157c1582930fdb1a152c0993b8b',1,'capi.cpp']]], 9 | ['bodygetlinearvelocity',['bodyGetLinearVelocity',['../capi_8h.html#a1780084df9bac7d49896f3635b422043',1,'capi.cpp']]], 10 | ['bodygetopenglmatrix',['bodyGetOpenGLMatrix',['../capi_8h.html#a97d48ab1541cf5824890d6cbe10306bc',1,'capi.cpp']]], 11 | ['bodygetorientation',['bodyGetOrientation',['../capi_8h.html#a479ba24227b9d904cbfa83dea95bee6e',1,'capi.cpp']]], 12 | ['bodygetposition',['bodyGetPosition',['../capi_8h.html#a16f2def38f131e871a6b3216f3ffbca5',1,'capi.cpp']]], 13 | ['bodygetpositionandorientation',['bodyGetPositionAndOrientation',['../capi_8h.html#a5341eb23d2aec30cb906cba8aef13de6',1,'capi.cpp']]], 14 | ['bodygetshape',['bodyGetShape',['../capi_8h.html#a74b05ee781b25a85347517a272e507a0',1,'capi.cpp']]], 15 | ['bodygetshapetype',['bodyGetShapeType',['../capi_8h.html#a96c2db7e2572d2ee88210f1a2e89be7e',1,'capi.cpp']]], 16 | ['bodyremove',['bodyRemove',['../capi_8h.html#ab8ba93c0973bbb2469c97fa63e84ccaf',1,'capi.cpp']]], 17 | ['bodysetangularvelocity',['bodySetAngularVelocity',['../capi_8h.html#aad1f0d6f3c8919f0cdb814e963e4f581',1,'capi.cpp']]], 18 | ['bodysetdeactivation',['bodySetDeactivation',['../capi_8h.html#a6fcb09b5998eafa5081ed23f67eebbf8',1,'capi.cpp']]], 19 | ['bodysetfriction',['bodySetFriction',['../capi_8h.html#a4300ab56fc0fc972fbdf6c15ab31b65d',1,'capi.cpp']]], 20 | ['bodysetlinearvelocity',['bodySetLinearVelocity',['../capi_8h.html#a8d67a9e2c22a06dbea2237393d61505e',1,'capi.cpp']]], 21 | ['bodysetposition',['bodySetPosition',['../capi_8h.html#acddf692da50b4a00af73bd6983343264',1,'capi.cpp']]], 22 | ['bodysetrestitution',['bodySetRestitution',['../capi_8h.html#a3a35dfd727669a8d9dc3a943063e7664',1,'capi.cpp']]], 23 | ['bodysetrotation',['bodySetRotation',['../capi_8h.html#a53717d1532f8ea2498751519ab1729fc',1,'capi.cpp']]], 24 | ['bodysetrotationeular',['bodySetRotationEular',['../capi_8h.html#aecd465318dca089ea0a6bd1971e612dc',1,'capi.cpp']]] 25 | ]; 26 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['capi_2eh',['capi.h',['../capi_8h.html',1,'']]], 4 | ['collisioncallback',['collisionCallback',['../capi_8h.html#a3fadee39316f37ad415628eaa6de48bd',1,'capi.cpp']]], 5 | ['compoundaddchild',['compoundAddChild',['../capi_8h.html#a51be306ac6df7490773cf9d1da8dd4bc',1,'capi.cpp']]], 6 | ['compoundgetnumchildren',['compoundGetNumChildren',['../capi_8h.html#ae1e8fee627d20bd79b7038f08f93fc40',1,'capi.cpp']]], 7 | ['compoundremoveshape',['compoundRemoveShape',['../capi_8h.html#ae606eba645f3aa65dea6d61a845af066',1,'capi.cpp']]], 8 | ['constraintisenabled',['constraintIsEnabled',['../capi_8h.html#a9b850c38f2e8b05c9536c27466bd8c91',1,'capi.cpp']]], 9 | ['constraintparams',['ConstraintParams',['../capi_8h.html#a3df0933f5b096404c2f1d8b3d7c83198',1,'capi.h']]], 10 | ['constraintsetenabled',['constraintSetEnabled',['../capi_8h.html#a9347a026bea1bc7a6c2360277cc24fe8',1,'capi.cpp']]], 11 | ['constraintsetparam',['constraintSetParam',['../capi_8h.html#a27ed468d07fc6c10e7df81081e37228c',1,'capi.cpp']]] 12 | ]; 13 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['deactivation_5fdisable',['DEACTIVATION_DISABLE',['../capi_8h.html#a95bef1245d58aa0159f776cab846680f',1,'capi.h']]], 4 | ['deactivation_5fenable',['DEACTIVATION_ENABLE',['../capi_8h.html#a0025743cf4d256fe0e51296786b1e512',1,'capi.h']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['hinge2create',['hinge2Create',['../capi_8h.html#a62aeee2a493c8ab734fcf0fc60bbe099',1,'capi.cpp']]], 4 | ['hinge2enablemotor',['hinge2enableMotor',['../capi_8h.html#a30e8edf5bcb774ed6927115750527bb0',1,'capi.cpp']]], 5 | ['hinge2getangle1',['hinge2getAngle1',['../capi_8h.html#a73f55d78324f1ab95d633684938a85fe',1,'capi.cpp']]], 6 | ['hinge2getangle2',['hinge2getAngle2',['../capi_8h.html#aa7e5f76c301fad3f32358ed1216269bc',1,'capi.cpp']]], 7 | ['hinge2setdamping',['hinge2setDamping',['../capi_8h.html#a740a482c1a90fb5a11b71c46bc5c4674',1,'capi.cpp']]], 8 | ['hinge2setlowerlimit',['hinge2setLowerLimit',['../capi_8h.html#abe3dfd9a1a25bc11ca9c759a58f27da4',1,'capi.cpp']]], 9 | ['hinge2setmaxmotorforce',['hinge2setMaxMotorForce',['../capi_8h.html#ac868368c35270efd0da8b08dfa8a4202',1,'capi.cpp']]], 10 | ['hinge2setstiffness',['hinge2setStiffness',['../capi_8h.html#a94901e579f87842894287d6f14145cf3',1,'capi.cpp']]], 11 | ['hinge2settargetvelocity',['hinge2setTargetVelocity',['../capi_8h.html#a80818a4101fef0143d542035b9d69ec7',1,'capi.cpp']]], 12 | ['hinge2setupperlimit',['hinge2setUpperLimit',['../capi_8h.html#a37cf3d071a984652751a14823547fc41',1,'capi.cpp']]], 13 | ['hingecreate',['hingeCreate',['../capi_8h.html#adcc28f50481071b4496a313057555f6e',1,'capi.cpp']]], 14 | ['hingeenableangularmotor',['hingeEnableAngularMotor',['../capi_8h.html#a72629030d4c4b058f0b2f95827ae4932',1,'capi.cpp']]], 15 | ['hingesetlimit',['hingeSetLimit',['../capi_8h.html#a0ac70731dd11a6f45ec9eb86e659aaea',1,'capi.cpp']]] 16 | ]; 17 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['shapecreatebox',['shapeCreateBox',['../capi_8h.html#a6f0ad2a659f3af39dab209a4bdf66db7',1,'capi.cpp']]], 4 | ['shapecreatecompound',['shapeCreateCompound',['../capi_8h.html#ad02b95087eb70b712f2f46e3cf049bf4',1,'capi.cpp']]], 5 | ['shapecreatecylinderx',['shapeCreateCylinderX',['../capi_8h.html#a6d3c1c9454b91534fd8ab6c1b23dc7e7',1,'capi.cpp']]], 6 | ['shapecreatecylindery',['shapeCreateCylinderY',['../capi_8h.html#a7f99dfc2a35fd0756a1d61fcb8bdb9b2',1,'capi.cpp']]], 7 | ['shapecreatecylinderz',['shapeCreateCylinderZ',['../capi_8h.html#a17cbd32d4b85b0c373905c8bb5499432',1,'capi.cpp']]], 8 | ['shapecreatesphere',['shapeCreateSphere',['../capi_8h.html#a83c8c65bcc92ca80953844299d15dfe2',1,'capi.cpp']]], 9 | ['shapedelete',['shapeDelete',['../capi_8h.html#a13c109bebdb45c4e54a224afabde4e0e',1,'capi.cpp']]], 10 | ['shapetype',['ShapeType',['../capi_8h.html#a5a4538eeab397888d88a4eefcc5a1345',1,'capi.h']]] 11 | ]; 12 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['universecreate',['universeCreate',['../capi_8h.html#a0352c614d462f94bd4296227384c3e54',1,'capi.cpp']]], 4 | ['universedestroy',['universeDestroy',['../capi_8h.html#a36589f055ba6a9a9aef1f49c6f659c58',1,'capi.cpp']]], 5 | ['universesetgravity',['universeSetGravity',['../capi_8h.html#a6497a1ac64eccb6e281667fbf51d5fd8',1,'capi.cpp']]], 6 | ['universestep',['universeStep',['../capi_8h.html#a9d2bc7478eec8196f0f1c41169b02ebe',1,'capi.cpp']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['vec',['Vec',['../structVec.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /capi/doc/html/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['vec',['Vec',['../structVec.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /capi/doc/html/search/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/search/close.png -------------------------------------------------------------------------------- /capi/doc/html/search/defines_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/defines_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['deactivation_5fdisable',['DEACTIVATION_DISABLE',['../capi_8h.html#a95bef1245d58aa0159f776cab846680f',1,'capi.h']]], 4 | ['deactivation_5fenable',['DEACTIVATION_ENABLE',['../capi_8h.html#a0025743cf4d256fe0e51296786b1e512',1,'capi.h']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /capi/doc/html/search/enums_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/enums_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['constraintparams',['ConstraintParams',['../capi_8h.html#a3df0933f5b096404c2f1d8b3d7c83198',1,'capi.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /capi/doc/html/search/enums_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/enums_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['shapetype',['ShapeType',['../capi_8h.html#a5a4538eeab397888d88a4eefcc5a1345',1,'capi.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /capi/doc/html/search/files_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/files_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['capi_2eh',['capi.h',['../capi_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['bodyapplyimpulse',['bodyApplyImpulse',['../capi_8h.html#a8992b561935682783cf9eb8668ee8088',1,'capi.cpp']]], 4 | ['bodyapplytorque',['bodyApplyTorque',['../capi_8h.html#a2a64d2c84ad3e182ad6a103ec546a43a',1,'capi.cpp']]], 5 | ['bodycreate',['bodyCreate',['../capi_8h.html#a881080af2fdc2186367e5de23552e90b',1,'capi.cpp']]], 6 | ['bodydelete',['bodyDelete',['../capi_8h.html#a1e8f0a89244cfc35af83640d3a52332c',1,'capi.cpp']]], 7 | ['bodygetangularvelocity',['bodyGetAngularVelocity',['../capi_8h.html#a145c14111a443f7262592085ac960e4d',1,'capi.cpp']]], 8 | ['bodygetfriction',['bodyGetFriction',['../capi_8h.html#ab8625157c1582930fdb1a152c0993b8b',1,'capi.cpp']]], 9 | ['bodygetlinearvelocity',['bodyGetLinearVelocity',['../capi_8h.html#a1780084df9bac7d49896f3635b422043',1,'capi.cpp']]], 10 | ['bodygetopenglmatrix',['bodyGetOpenGLMatrix',['../capi_8h.html#a97d48ab1541cf5824890d6cbe10306bc',1,'capi.cpp']]], 11 | ['bodygetorientation',['bodyGetOrientation',['../capi_8h.html#a479ba24227b9d904cbfa83dea95bee6e',1,'capi.cpp']]], 12 | ['bodygetposition',['bodyGetPosition',['../capi_8h.html#a16f2def38f131e871a6b3216f3ffbca5',1,'capi.cpp']]], 13 | ['bodygetpositionandorientation',['bodyGetPositionAndOrientation',['../capi_8h.html#a5341eb23d2aec30cb906cba8aef13de6',1,'capi.cpp']]], 14 | ['bodygetshape',['bodyGetShape',['../capi_8h.html#a74b05ee781b25a85347517a272e507a0',1,'capi.cpp']]], 15 | ['bodygetshapetype',['bodyGetShapeType',['../capi_8h.html#a96c2db7e2572d2ee88210f1a2e89be7e',1,'capi.cpp']]], 16 | ['bodyremove',['bodyRemove',['../capi_8h.html#ab8ba93c0973bbb2469c97fa63e84ccaf',1,'capi.cpp']]], 17 | ['bodysetangularvelocity',['bodySetAngularVelocity',['../capi_8h.html#aad1f0d6f3c8919f0cdb814e963e4f581',1,'capi.cpp']]], 18 | ['bodysetdeactivation',['bodySetDeactivation',['../capi_8h.html#a6fcb09b5998eafa5081ed23f67eebbf8',1,'capi.cpp']]], 19 | ['bodysetfriction',['bodySetFriction',['../capi_8h.html#a4300ab56fc0fc972fbdf6c15ab31b65d',1,'capi.cpp']]], 20 | ['bodysetlinearvelocity',['bodySetLinearVelocity',['../capi_8h.html#a8d67a9e2c22a06dbea2237393d61505e',1,'capi.cpp']]], 21 | ['bodysetposition',['bodySetPosition',['../capi_8h.html#acddf692da50b4a00af73bd6983343264',1,'capi.cpp']]], 22 | ['bodysetrestitution',['bodySetRestitution',['../capi_8h.html#a3a35dfd727669a8d9dc3a943063e7664',1,'capi.cpp']]], 23 | ['bodysetrotation',['bodySetRotation',['../capi_8h.html#a53717d1532f8ea2498751519ab1729fc',1,'capi.cpp']]], 24 | ['bodysetrotationeular',['bodySetRotationEular',['../capi_8h.html#aecd465318dca089ea0a6bd1971e612dc',1,'capi.cpp']]] 25 | ]; 26 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['collisioncallback',['collisionCallback',['../capi_8h.html#a3fadee39316f37ad415628eaa6de48bd',1,'capi.cpp']]], 4 | ['compoundaddchild',['compoundAddChild',['../capi_8h.html#a51be306ac6df7490773cf9d1da8dd4bc',1,'capi.cpp']]], 5 | ['compoundgetnumchildren',['compoundGetNumChildren',['../capi_8h.html#ae1e8fee627d20bd79b7038f08f93fc40',1,'capi.cpp']]], 6 | ['compoundremoveshape',['compoundRemoveShape',['../capi_8h.html#ae606eba645f3aa65dea6d61a845af066',1,'capi.cpp']]], 7 | ['constraintisenabled',['constraintIsEnabled',['../capi_8h.html#a9b850c38f2e8b05c9536c27466bd8c91',1,'capi.cpp']]], 8 | ['constraintsetenabled',['constraintSetEnabled',['../capi_8h.html#a9347a026bea1bc7a6c2360277cc24fe8',1,'capi.cpp']]], 9 | ['constraintsetparam',['constraintSetParam',['../capi_8h.html#a27ed468d07fc6c10e7df81081e37228c',1,'capi.cpp']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['hinge2create',['hinge2Create',['../capi_8h.html#a62aeee2a493c8ab734fcf0fc60bbe099',1,'capi.cpp']]], 4 | ['hinge2enablemotor',['hinge2enableMotor',['../capi_8h.html#a30e8edf5bcb774ed6927115750527bb0',1,'capi.cpp']]], 5 | ['hinge2getangle1',['hinge2getAngle1',['../capi_8h.html#a73f55d78324f1ab95d633684938a85fe',1,'capi.cpp']]], 6 | ['hinge2getangle2',['hinge2getAngle2',['../capi_8h.html#aa7e5f76c301fad3f32358ed1216269bc',1,'capi.cpp']]], 7 | ['hinge2setdamping',['hinge2setDamping',['../capi_8h.html#a740a482c1a90fb5a11b71c46bc5c4674',1,'capi.cpp']]], 8 | ['hinge2setlowerlimit',['hinge2setLowerLimit',['../capi_8h.html#abe3dfd9a1a25bc11ca9c759a58f27da4',1,'capi.cpp']]], 9 | ['hinge2setmaxmotorforce',['hinge2setMaxMotorForce',['../capi_8h.html#ac868368c35270efd0da8b08dfa8a4202',1,'capi.cpp']]], 10 | ['hinge2setstiffness',['hinge2setStiffness',['../capi_8h.html#a94901e579f87842894287d6f14145cf3',1,'capi.cpp']]], 11 | ['hinge2settargetvelocity',['hinge2setTargetVelocity',['../capi_8h.html#a80818a4101fef0143d542035b9d69ec7',1,'capi.cpp']]], 12 | ['hinge2setupperlimit',['hinge2setUpperLimit',['../capi_8h.html#a37cf3d071a984652751a14823547fc41',1,'capi.cpp']]], 13 | ['hingecreate',['hingeCreate',['../capi_8h.html#adcc28f50481071b4496a313057555f6e',1,'capi.cpp']]], 14 | ['hingeenableangularmotor',['hingeEnableAngularMotor',['../capi_8h.html#a72629030d4c4b058f0b2f95827ae4932',1,'capi.cpp']]], 15 | ['hingesetlimit',['hingeSetLimit',['../capi_8h.html#a0ac70731dd11a6f45ec9eb86e659aaea',1,'capi.cpp']]] 16 | ]; 17 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['shapecreatebox',['shapeCreateBox',['../capi_8h.html#a6f0ad2a659f3af39dab209a4bdf66db7',1,'capi.cpp']]], 4 | ['shapecreatecompound',['shapeCreateCompound',['../capi_8h.html#ad02b95087eb70b712f2f46e3cf049bf4',1,'capi.cpp']]], 5 | ['shapecreatecylinderx',['shapeCreateCylinderX',['../capi_8h.html#a6d3c1c9454b91534fd8ab6c1b23dc7e7',1,'capi.cpp']]], 6 | ['shapecreatecylindery',['shapeCreateCylinderY',['../capi_8h.html#a7f99dfc2a35fd0756a1d61fcb8bdb9b2',1,'capi.cpp']]], 7 | ['shapecreatecylinderz',['shapeCreateCylinderZ',['../capi_8h.html#a17cbd32d4b85b0c373905c8bb5499432',1,'capi.cpp']]], 8 | ['shapecreatesphere',['shapeCreateSphere',['../capi_8h.html#a83c8c65bcc92ca80953844299d15dfe2',1,'capi.cpp']]], 9 | ['shapedelete',['shapeDelete',['../capi_8h.html#a13c109bebdb45c4e54a224afabde4e0e',1,'capi.cpp']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['universecreate',['universeCreate',['../capi_8h.html#a0352c614d462f94bd4296227384c3e54',1,'capi.cpp']]], 4 | ['universedestroy',['universeDestroy',['../capi_8h.html#a36589f055ba6a9a9aef1f49c6f659c58',1,'capi.cpp']]], 5 | ['universesetgravity',['universeSetGravity',['../capi_8h.html#a6497a1ac64eccb6e281667fbf51d5fd8',1,'capi.cpp']]], 6 | ['universestep',['universeStep',['../capi_8h.html#a9d2bc7478eec8196f0f1c41169b02ebe',1,'capi.cpp']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/search/functions_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['setconstraintparam',['setConstraintParam',['../capi_8h.html#a88ef89b4805a4cec55abace835451e52',1,'capi.cpp']]], 4 | ['setgravity',['setGravity',['../capi_8h.html#a6003cacda9340216eeb49067b6d8808d',1,'capi.cpp']]], 5 | ['stepworld',['stepWorld',['../capi_8h.html#a470bfe1b792ff9ea4ad43413b315bda7',1,'capi.cpp']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /capi/doc/html/search/mag_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/search/mag_sel.png -------------------------------------------------------------------------------- /capi/doc/html/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
    9 |
    No Matches
    10 |
    11 | 12 | 13 | -------------------------------------------------------------------------------- /capi/doc/html/search/search.css: -------------------------------------------------------------------------------- 1 | /*---------------- Search Box */ 2 | 3 | #FSearchBox { 4 | float: left; 5 | } 6 | 7 | #MSearchBox { 8 | white-space : nowrap; 9 | float: none; 10 | margin-top: 8px; 11 | right: 0px; 12 | width: 170px; 13 | height: 24px; 14 | z-index: 102; 15 | } 16 | 17 | #MSearchBox .left 18 | { 19 | display:block; 20 | position:absolute; 21 | left:10px; 22 | width:20px; 23 | height:19px; 24 | background:url('search_l.png') no-repeat; 25 | background-position:right; 26 | } 27 | 28 | #MSearchSelect { 29 | display:block; 30 | position:absolute; 31 | width:20px; 32 | height:19px; 33 | } 34 | 35 | .left #MSearchSelect { 36 | left:4px; 37 | } 38 | 39 | .right #MSearchSelect { 40 | right:5px; 41 | } 42 | 43 | #MSearchField { 44 | display:block; 45 | position:absolute; 46 | height:19px; 47 | background:url('search_m.png') repeat-x; 48 | border:none; 49 | width:115px; 50 | margin-left:20px; 51 | padding-left:4px; 52 | color: #909090; 53 | outline: none; 54 | font: 9pt Arial, Verdana, sans-serif; 55 | -webkit-border-radius: 0px; 56 | } 57 | 58 | #FSearchBox #MSearchField { 59 | margin-left:15px; 60 | } 61 | 62 | #MSearchBox .right { 63 | display:block; 64 | position:absolute; 65 | right:10px; 66 | top:8px; 67 | width:20px; 68 | height:19px; 69 | background:url('search_r.png') no-repeat; 70 | background-position:left; 71 | } 72 | 73 | #MSearchClose { 74 | display: none; 75 | position: absolute; 76 | top: 4px; 77 | background : none; 78 | border: none; 79 | margin: 0px 4px 0px 0px; 80 | padding: 0px 0px; 81 | outline: none; 82 | } 83 | 84 | .left #MSearchClose { 85 | left: 6px; 86 | } 87 | 88 | .right #MSearchClose { 89 | right: 2px; 90 | } 91 | 92 | .MSearchBoxActive #MSearchField { 93 | color: #000000; 94 | } 95 | 96 | /*---------------- Search filter selection */ 97 | 98 | #MSearchSelectWindow { 99 | display: none; 100 | position: absolute; 101 | left: 0; top: 0; 102 | border: 1px solid #90A5CE; 103 | background-color: #F9FAFC; 104 | z-index: 10001; 105 | padding-top: 4px; 106 | padding-bottom: 4px; 107 | -moz-border-radius: 4px; 108 | -webkit-border-top-left-radius: 4px; 109 | -webkit-border-top-right-radius: 4px; 110 | -webkit-border-bottom-left-radius: 4px; 111 | -webkit-border-bottom-right-radius: 4px; 112 | -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); 113 | } 114 | 115 | .SelectItem { 116 | font: 8pt Arial, Verdana, sans-serif; 117 | padding-left: 2px; 118 | padding-right: 12px; 119 | border: 0px; 120 | } 121 | 122 | span.SelectionMark { 123 | margin-right: 4px; 124 | font-family: monospace; 125 | outline-style: none; 126 | text-decoration: none; 127 | } 128 | 129 | a.SelectItem { 130 | display: block; 131 | outline-style: none; 132 | color: #000000; 133 | text-decoration: none; 134 | padding-left: 6px; 135 | padding-right: 12px; 136 | } 137 | 138 | a.SelectItem:focus, 139 | a.SelectItem:active { 140 | color: #000000; 141 | outline-style: none; 142 | text-decoration: none; 143 | } 144 | 145 | a.SelectItem:hover { 146 | color: #FFFFFF; 147 | background-color: #3D578C; 148 | outline-style: none; 149 | text-decoration: none; 150 | cursor: pointer; 151 | display: block; 152 | } 153 | 154 | /*---------------- Search results window */ 155 | 156 | iframe#MSearchResults { 157 | width: 60ex; 158 | height: 15em; 159 | } 160 | 161 | #MSearchResultsWindow { 162 | display: none; 163 | position: absolute; 164 | left: 0; top: 0; 165 | border: 1px solid #000; 166 | background-color: #EEF1F7; 167 | z-index:10000; 168 | } 169 | 170 | /* ----------------------------------- */ 171 | 172 | 173 | #SRIndex { 174 | clear:both; 175 | padding-bottom: 15px; 176 | } 177 | 178 | .SREntry { 179 | font-size: 10pt; 180 | padding-left: 1ex; 181 | } 182 | 183 | .SRPage .SREntry { 184 | font-size: 8pt; 185 | padding: 1px 5px; 186 | } 187 | 188 | body.SRPage { 189 | margin: 5px 2px; 190 | } 191 | 192 | .SRChildren { 193 | padding-left: 3ex; padding-bottom: .5em 194 | } 195 | 196 | .SRPage .SRChildren { 197 | display: none; 198 | } 199 | 200 | .SRSymbol { 201 | font-weight: bold; 202 | color: #425E97; 203 | font-family: Arial, Verdana, sans-serif; 204 | text-decoration: none; 205 | outline: none; 206 | } 207 | 208 | a.SRScope { 209 | display: block; 210 | color: #425E97; 211 | font-family: Arial, Verdana, sans-serif; 212 | text-decoration: none; 213 | outline: none; 214 | } 215 | 216 | a.SRSymbol:focus, a.SRSymbol:active, 217 | a.SRScope:focus, a.SRScope:active { 218 | text-decoration: underline; 219 | } 220 | 221 | span.SRScope { 222 | padding-left: 4px; 223 | } 224 | 225 | .SRPage .SRStatus { 226 | padding: 2px 5px; 227 | font-size: 8pt; 228 | font-style: italic; 229 | } 230 | 231 | .SRResult { 232 | display: none; 233 | } 234 | 235 | DIV.searchresults { 236 | margin-left: 10px; 237 | margin-right: 10px; 238 | } 239 | 240 | /*---------------- External search page results */ 241 | 242 | .searchresult { 243 | background-color: #F0F3F8; 244 | } 245 | 246 | .pages b { 247 | color: white; 248 | padding: 5px 5px 3px 5px; 249 | background-image: url("../tab_a.png"); 250 | background-repeat: repeat-x; 251 | text-shadow: 0 1px 1px #000000; 252 | } 253 | 254 | .pages { 255 | line-height: 17px; 256 | margin-left: 4px; 257 | text-decoration: none; 258 | } 259 | 260 | .hl { 261 | font-weight: bold; 262 | } 263 | 264 | #searchresults { 265 | margin-bottom: 20px; 266 | } 267 | 268 | .searchpages { 269 | margin-top: 10px; 270 | } 271 | 272 | -------------------------------------------------------------------------------- /capi/doc/html/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/search/search_l.png -------------------------------------------------------------------------------- /capi/doc/html/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/search/search_m.png -------------------------------------------------------------------------------- /capi/doc/html/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/search/search_r.png -------------------------------------------------------------------------------- /capi/doc/html/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "bcdhsuv", 4 | 1: "v", 5 | 2: "c", 6 | 3: "bchsu", 7 | 4: "cs", 8 | 5: "d" 9 | }; 10 | 11 | var indexSectionNames = 12 | { 13 | 0: "all", 14 | 1: "classes", 15 | 2: "files", 16 | 3: "functions", 17 | 4: "enums", 18 | 5: "defines" 19 | }; 20 | 21 | var indexSectionLabels = 22 | { 23 | 0: "All", 24 | 1: "Data Structures", 25 | 2: "Files", 26 | 3: "Functions", 27 | 4: "Enumerations", 28 | 5: "Macros" 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /capi/doc/html/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/splitbar.png -------------------------------------------------------------------------------- /capi/doc/html/structVec.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | bulletCapi: Vec Struct Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
    19 |
    20 | 21 | 22 | 23 | 27 | 28 | 29 |
    24 |
    bulletCapi 25 |
    26 |
    30 |
    31 | 32 | 33 | 38 | 39 | 40 | 47 | 48 | 49 |
    53 |
    54 | 55 | 56 |
    57 | 60 |
    61 | 62 |
    63 |
    64 |
    65 |
    Vec Struct Reference
    66 |
    67 |
    68 | 69 |

    #include <capi.h>

    70 |

    Detailed Description

    71 |

    struct to hold vector or quaternions

    72 |

    The documentation for this struct was generated from the following file: 75 |
    76 | 77 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /capi/doc/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/sync_off.png -------------------------------------------------------------------------------- /capi/doc/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/sync_on.png -------------------------------------------------------------------------------- /capi/doc/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/tab_a.png -------------------------------------------------------------------------------- /capi/doc/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/tab_b.png -------------------------------------------------------------------------------- /capi/doc/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/tab_h.png -------------------------------------------------------------------------------- /capi/doc/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/doc/html/tab_s.png -------------------------------------------------------------------------------- /capi/doc/html/tabs.css: -------------------------------------------------------------------------------- 1 | .sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0 1px 1px rgba(255,255,255,0.9);color:#283a5d;outline:0}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283a5d transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0 !important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} -------------------------------------------------------------------------------- /capi/doc/latex/Makefile: -------------------------------------------------------------------------------- 1 | all: refman.pdf 2 | 3 | pdf: refman.pdf 4 | 5 | refman.pdf: clean refman.tex 6 | pdflatex refman 7 | makeindex refman.idx 8 | pdflatex refman 9 | latex_count=8 ; \ 10 | while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ 11 | do \ 12 | echo "Rerunning latex...." ;\ 13 | pdflatex refman ;\ 14 | latex_count=`expr $$latex_count - 1` ;\ 15 | done 16 | makeindex refman.idx 17 | pdflatex refman 18 | 19 | 20 | clean: 21 | rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf 22 | -------------------------------------------------------------------------------- /capi/doc/latex/annotated.tex: -------------------------------------------------------------------------------- 1 | \section{Data Structures} 2 | Here are the data structures with brief descriptions\+:\begin{DoxyCompactList} 3 | \item\contentsline{section}{\mbox{\hyperlink{structVec}{Vec}} }{\pageref{structVec}}{} 4 | \end{DoxyCompactList} 5 | -------------------------------------------------------------------------------- /capi/doc/latex/doxygen.sty: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e} 2 | \ProvidesPackage{doxygen} 3 | 4 | % Packages used by this style file 5 | \RequirePackage{alltt} 6 | \RequirePackage{array} 7 | \RequirePackage{calc} 8 | \RequirePackage{float} 9 | \RequirePackage{ifthen} 10 | \RequirePackage{verbatim} 11 | \RequirePackage[table]{xcolor} 12 | \RequirePackage{longtable} 13 | \RequirePackage{tabu} 14 | \RequirePackage{tabularx} 15 | \RequirePackage{multirow} 16 | 17 | %---------- Internal commands used in this style file ---------------- 18 | 19 | \newcommand{\ensurespace}[1]{% 20 | \begingroup% 21 | \setlength{\dimen@}{#1}% 22 | \vskip\z@\@plus\dimen@% 23 | \penalty -100\vskip\z@\@plus -\dimen@% 24 | \vskip\dimen@% 25 | \penalty 9999% 26 | \vskip -\dimen@% 27 | \vskip\z@skip% hide the previous |\vskip| from |\addvspace| 28 | \endgroup% 29 | } 30 | 31 | \newcommand{\DoxyLabelFont}{} 32 | \newcommand{\entrylabel}[1]{% 33 | {% 34 | \parbox[b]{\labelwidth-4pt}{% 35 | \makebox[0pt][l]{\DoxyLabelFont#1}% 36 | \vspace{1.5\baselineskip}% 37 | }% 38 | }% 39 | } 40 | 41 | \newenvironment{DoxyDesc}[1]{% 42 | \ensurespace{4\baselineskip}% 43 | \begin{list}{}{% 44 | \settowidth{\labelwidth}{20pt}% 45 | \setlength{\parsep}{0pt}% 46 | \setlength{\itemsep}{0pt}% 47 | \setlength{\leftmargin}{\labelwidth+\labelsep}% 48 | \renewcommand{\makelabel}{\entrylabel}% 49 | }% 50 | \item[#1]% 51 | }{% 52 | \end{list}% 53 | } 54 | 55 | \newsavebox{\xrefbox} 56 | \newlength{\xreflength} 57 | \newcommand{\xreflabel}[1]{% 58 | \sbox{\xrefbox}{#1}% 59 | \setlength{\xreflength}{\wd\xrefbox}% 60 | \ifthenelse{\xreflength>\labelwidth}{% 61 | \begin{minipage}{\textwidth}% 62 | \setlength{\parindent}{0pt}% 63 | \hangindent=15pt\bfseries #1\vspace{1.2\itemsep}% 64 | \end{minipage}% 65 | }{% 66 | \parbox[b]{\labelwidth}{\makebox[0pt][l]{\textbf{#1}}}% 67 | }% 68 | } 69 | 70 | %---------- Commands used by doxygen LaTeX output generator ---------- 71 | 72 | % Used by
     ... 
    73 | \newenvironment{DoxyPre}{% 74 | \small% 75 | \begin{alltt}% 76 | }{% 77 | \end{alltt}% 78 | \normalsize% 79 | } 80 | 81 | % Used by @code ... @endcode 82 | \newenvironment{DoxyCode}{% 83 | \par% 84 | \scriptsize% 85 | \begin{alltt}% 86 | }{% 87 | \end{alltt}% 88 | \normalsize% 89 | } 90 | 91 | % Used by @example, @include, @includelineno and @dontinclude 92 | \newenvironment{DoxyCodeInclude}{% 93 | \DoxyCode% 94 | }{% 95 | \endDoxyCode% 96 | } 97 | 98 | % Used by @verbatim ... @endverbatim 99 | \newenvironment{DoxyVerb}{% 100 | \footnotesize% 101 | \verbatim% 102 | }{% 103 | \endverbatim% 104 | \normalsize% 105 | } 106 | 107 | % Used by @verbinclude 108 | \newenvironment{DoxyVerbInclude}{% 109 | \DoxyVerb% 110 | }{% 111 | \endDoxyVerb% 112 | } 113 | 114 | % Used by numbered lists (using '-#' or
      ...
    ) 115 | \newenvironment{DoxyEnumerate}{% 116 | \enumerate% 117 | }{% 118 | \endenumerate% 119 | } 120 | 121 | % Used by bullet lists (using '-', @li, @arg, or
      ...
    ) 122 | \newenvironment{DoxyItemize}{% 123 | \itemize% 124 | }{% 125 | \enditemize% 126 | } 127 | 128 | % Used by description lists (using
    ...
    ) 129 | \newenvironment{DoxyDescription}{% 130 | \description% 131 | }{% 132 | \enddescription% 133 | } 134 | 135 | % Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc 136 | % (only if caption is specified) 137 | \newenvironment{DoxyImage}{% 138 | \begin{figure}[H]% 139 | \begin{center}% 140 | }{% 141 | \end{center}% 142 | \end{figure}% 143 | } 144 | 145 | % Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc 146 | % (only if no caption is specified) 147 | \newenvironment{DoxyImageNoCaption}{% 148 | \begin{center}% 149 | }{% 150 | \end{center}% 151 | } 152 | 153 | % Used by @attention 154 | \newenvironment{DoxyAttention}[1]{% 155 | \begin{DoxyDesc}{#1}% 156 | }{% 157 | \end{DoxyDesc}% 158 | } 159 | 160 | % Used by @author and @authors 161 | \newenvironment{DoxyAuthor}[1]{% 162 | \begin{DoxyDesc}{#1}% 163 | }{% 164 | \end{DoxyDesc}% 165 | } 166 | 167 | % Used by @date 168 | \newenvironment{DoxyDate}[1]{% 169 | \begin{DoxyDesc}{#1}% 170 | }{% 171 | \end{DoxyDesc}% 172 | } 173 | 174 | % Used by @invariant 175 | \newenvironment{DoxyInvariant}[1]{% 176 | \begin{DoxyDesc}{#1}% 177 | }{% 178 | \end{DoxyDesc}% 179 | } 180 | 181 | % Used by @note 182 | \newenvironment{DoxyNote}[1]{% 183 | \begin{DoxyDesc}{#1}% 184 | }{% 185 | \end{DoxyDesc}% 186 | } 187 | 188 | % Used by @post 189 | \newenvironment{DoxyPostcond}[1]{% 190 | \begin{DoxyDesc}{#1}% 191 | }{% 192 | \end{DoxyDesc}% 193 | } 194 | 195 | % Used by @pre 196 | \newenvironment{DoxyPrecond}[1]{% 197 | \begin{DoxyDesc}{#1}% 198 | }{% 199 | \end{DoxyDesc}% 200 | } 201 | 202 | % Used by @copyright 203 | \newenvironment{DoxyCopyright}[1]{% 204 | \begin{DoxyDesc}{#1}% 205 | }{% 206 | \end{DoxyDesc}% 207 | } 208 | 209 | % Used by @remark 210 | \newenvironment{DoxyRemark}[1]{% 211 | \begin{DoxyDesc}{#1}% 212 | }{% 213 | \end{DoxyDesc}% 214 | } 215 | 216 | % Used by @return and @returns 217 | \newenvironment{DoxyReturn}[1]{% 218 | \begin{DoxyDesc}{#1}% 219 | }{% 220 | \end{DoxyDesc}% 221 | } 222 | 223 | % Used by @since 224 | \newenvironment{DoxySince}[1]{% 225 | \begin{DoxyDesc}{#1}% 226 | }{% 227 | \end{DoxyDesc}% 228 | } 229 | 230 | % Used by @see 231 | \newenvironment{DoxySeeAlso}[1]{% 232 | \begin{DoxyDesc}{#1}% 233 | }{% 234 | \end{DoxyDesc}% 235 | } 236 | 237 | % Used by @version 238 | \newenvironment{DoxyVersion}[1]{% 239 | \begin{DoxyDesc}{#1}% 240 | }{% 241 | \end{DoxyDesc}% 242 | } 243 | 244 | % Used by @warning 245 | \newenvironment{DoxyWarning}[1]{% 246 | \begin{DoxyDesc}{#1}% 247 | }{% 248 | \end{DoxyDesc}% 249 | } 250 | 251 | % Used by @internal 252 | \newenvironment{DoxyInternal}[1]{% 253 | \paragraph*{#1}% 254 | }{% 255 | } 256 | 257 | % Used by @par and @paragraph 258 | \newenvironment{DoxyParagraph}[1]{% 259 | \begin{list}{}{% 260 | \settowidth{\labelwidth}{40pt}% 261 | \setlength{\leftmargin}{\labelwidth}% 262 | \setlength{\parsep}{0pt}% 263 | \setlength{\itemsep}{-4pt}% 264 | \renewcommand{\makelabel}{\entrylabel}% 265 | }% 266 | \item[#1]% 267 | }{% 268 | \end{list}% 269 | } 270 | 271 | % Used by parameter lists 272 | \newenvironment{DoxyParams}[2][]{% 273 | \tabulinesep=1mm% 274 | \par% 275 | \ifthenelse{\equal{#1}{}}% 276 | {\begin{longtabu} spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description 277 | {\ifthenelse{\equal{#1}{1}}% 278 | {\begin{longtabu} spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc 279 | {\begin{longtabu} spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + type + name + desc 280 | } 281 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]% 282 | \hline% 283 | \endfirsthead% 284 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]% 285 | \hline% 286 | \endhead% 287 | }{% 288 | \end{longtabu}% 289 | \vspace{6pt}% 290 | } 291 | 292 | % Used for fields of simple structs 293 | \newenvironment{DoxyFields}[1]{% 294 | \tabulinesep=1mm% 295 | \par% 296 | \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}% 297 | \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 298 | \hline% 299 | \endfirsthead% 300 | \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 301 | \hline% 302 | \endhead% 303 | }{% 304 | \end{longtabu}% 305 | \vspace{6pt}% 306 | } 307 | 308 | % Used for fields simple class style enums 309 | \newenvironment{DoxyEnumFields}[1]{% 310 | \tabulinesep=1mm% 311 | \par% 312 | \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% 313 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 314 | \hline% 315 | \endfirsthead% 316 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 317 | \hline% 318 | \endhead% 319 | }{% 320 | \end{longtabu}% 321 | \vspace{6pt}% 322 | } 323 | 324 | % Used for parameters within a detailed function description 325 | \newenvironment{DoxyParamCaption}{% 326 | \renewcommand{\item}[2][]{\\ \hspace*{2.0cm} ##1 {\em ##2}}% 327 | }{% 328 | } 329 | 330 | % Used by return value lists 331 | \newenvironment{DoxyRetVals}[1]{% 332 | \tabulinesep=1mm% 333 | \par% 334 | \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% 335 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 336 | \hline% 337 | \endfirsthead% 338 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 339 | \hline% 340 | \endhead% 341 | }{% 342 | \end{longtabu}% 343 | \vspace{6pt}% 344 | } 345 | 346 | % Used by exception lists 347 | \newenvironment{DoxyExceptions}[1]{% 348 | \tabulinesep=1mm% 349 | \par% 350 | \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% 351 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 352 | \hline% 353 | \endfirsthead% 354 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 355 | \hline% 356 | \endhead% 357 | }{% 358 | \end{longtabu}% 359 | \vspace{6pt}% 360 | } 361 | 362 | % Used by template parameter lists 363 | \newenvironment{DoxyTemplParams}[1]{% 364 | \tabulinesep=1mm% 365 | \par% 366 | \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% 367 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 368 | \hline% 369 | \endfirsthead% 370 | \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% 371 | \hline% 372 | \endhead% 373 | }{% 374 | \end{longtabu}% 375 | \vspace{6pt}% 376 | } 377 | 378 | % Used for member lists 379 | \newenvironment{DoxyCompactItemize}{% 380 | \begin{itemize}% 381 | \setlength{\itemsep}{-3pt}% 382 | \setlength{\parsep}{0pt}% 383 | \setlength{\topsep}{0pt}% 384 | \setlength{\partopsep}{0pt}% 385 | }{% 386 | \end{itemize}% 387 | } 388 | 389 | % Used for member descriptions 390 | \newenvironment{DoxyCompactList}{% 391 | \begin{list}{}{% 392 | \setlength{\leftmargin}{0.5cm}% 393 | \setlength{\itemsep}{0pt}% 394 | \setlength{\parsep}{0pt}% 395 | \setlength{\topsep}{0pt}% 396 | \renewcommand{\makelabel}{\hfill}% 397 | }% 398 | }{% 399 | \end{list}% 400 | } 401 | 402 | % Used for reference lists (@bug, @deprecated, @todo, etc.) 403 | \newenvironment{DoxyRefList}{% 404 | \begin{list}{}{% 405 | \setlength{\labelwidth}{10pt}% 406 | \setlength{\leftmargin}{\labelwidth}% 407 | \addtolength{\leftmargin}{\labelsep}% 408 | \renewcommand{\makelabel}{\xreflabel}% 409 | }% 410 | }{% 411 | \end{list}% 412 | } 413 | 414 | % Used by @bug, @deprecated, @todo, etc. 415 | \newenvironment{DoxyRefDesc}[1]{% 416 | \begin{list}{}{% 417 | \renewcommand\makelabel[1]{\textbf{##1}}% 418 | \settowidth\labelwidth{\makelabel{#1}}% 419 | \setlength\leftmargin{\labelwidth+\labelsep}% 420 | }% 421 | }{% 422 | \end{list}% 423 | } 424 | 425 | % Used by parameter lists and simple sections 426 | \newenvironment{Desc} 427 | {\begin{list}{}{% 428 | \settowidth{\labelwidth}{20pt}% 429 | \setlength{\parsep}{0pt}% 430 | \setlength{\itemsep}{0pt}% 431 | \setlength{\leftmargin}{\labelwidth+\labelsep}% 432 | \renewcommand{\makelabel}{\entrylabel}% 433 | } 434 | }{% 435 | \end{list}% 436 | } 437 | 438 | % Used by tables 439 | \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}% 440 | \newenvironment{TabularC}[1]% 441 | {\tabulinesep=1mm 442 | \begin{longtabu} spread 0pt [c]{*#1{|X[-1]}|}}% 443 | {\end{longtabu}\par}% 444 | 445 | \newenvironment{TabularNC}[1]% 446 | {\begin{tabu} spread 0pt [l]{*#1{|X[-1]}|}}% 447 | {\end{tabu}\par}% 448 | 449 | % Used for member group headers 450 | \newenvironment{Indent}{% 451 | \begin{list}{}{% 452 | \setlength{\leftmargin}{0.5cm}% 453 | }% 454 | \item[]\ignorespaces% 455 | }{% 456 | \unskip% 457 | \end{list}% 458 | } 459 | 460 | % Used when hyperlinks are turned off 461 | \newcommand{\doxyref}[3]{% 462 | \textbf{#1} (\textnormal{#2}\,\pageref{#3})% 463 | } 464 | 465 | % Used to link to a table when hyperlinks are turned on 466 | \newcommand{\doxytablelink}[2]{% 467 | \ref{#1}% 468 | } 469 | 470 | % Used to link to a table when hyperlinks are turned off 471 | \newcommand{\doxytableref}[3]{% 472 | \ref{#3}% 473 | } 474 | 475 | % Used by @addindex 476 | \newcommand{\lcurly}{\{} 477 | \newcommand{\rcurly}{\}} 478 | 479 | % Colors used for syntax highlighting 480 | \definecolor{comment}{rgb}{0.5,0.0,0.0} 481 | \definecolor{keyword}{rgb}{0.0,0.5,0.0} 482 | \definecolor{keywordtype}{rgb}{0.38,0.25,0.125} 483 | \definecolor{keywordflow}{rgb}{0.88,0.5,0.0} 484 | \definecolor{preprocessor}{rgb}{0.5,0.38,0.125} 485 | \definecolor{stringliteral}{rgb}{0.0,0.125,0.25} 486 | \definecolor{charliteral}{rgb}{0.0,0.5,0.5} 487 | \definecolor{vhdldigit}{rgb}{1.0,0.0,1.0} 488 | \definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43} 489 | \definecolor{vhdllogic}{rgb}{1.0,0.0,0.0} 490 | \definecolor{vhdlchar}{rgb}{0.0,0.0,0.0} 491 | 492 | % Color used for table heading 493 | \newcommand{\tableheadbgcolor}{lightgray}% 494 | 495 | % Version of hypertarget with correct landing location 496 | \newcommand{\Hypertarget}[1]{\Hy@raisedlink{\hypertarget{#1}{}}} 497 | 498 | % Define caption that is also suitable in a table 499 | \makeatletter 500 | \def\doxyfigcaption{% 501 | \refstepcounter{figure}% 502 | \@dblarg{\@caption{figure}}} 503 | \makeatother 504 | -------------------------------------------------------------------------------- /capi/doc/latex/files.tex: -------------------------------------------------------------------------------- 1 | \section{File List} 2 | Here is a list of all documented files with brief descriptions\+:\begin{DoxyCompactList} 3 | \item\contentsline{section}{\mbox{\hyperlink{capi_8h}{capi.\+h}} \\*C wrapper for the bullet physics engine }{\pageref{capi_8h}}{} 4 | \item\contentsline{section}{{\bfseries capi.\+hpp} }{\pageref{capi_8hpp}}{} 5 | \end{DoxyCompactList} 6 | -------------------------------------------------------------------------------- /capi/doc/latex/refman.tex: -------------------------------------------------------------------------------- 1 | \documentclass[twoside]{book} 2 | 3 | % Packages required by doxygen 4 | \usepackage{fixltx2e} 5 | \usepackage{calc} 6 | \usepackage{doxygen} 7 | \usepackage[export]{adjustbox} % also loads graphicx 8 | \usepackage{graphicx} 9 | \usepackage[utf8]{inputenc} 10 | \usepackage{makeidx} 11 | \usepackage{multicol} 12 | \usepackage{multirow} 13 | \PassOptionsToPackage{warn}{textcomp} 14 | \usepackage{textcomp} 15 | \usepackage[nointegrals]{wasysym} 16 | \usepackage[table]{xcolor} 17 | 18 | % Font selection 19 | \usepackage[T1]{fontenc} 20 | \usepackage[scaled=.90]{helvet} 21 | \usepackage{courier} 22 | \usepackage{amssymb} 23 | \usepackage{sectsty} 24 | \renewcommand{\familydefault}{\sfdefault} 25 | \allsectionsfont{% 26 | \fontseries{bc}\selectfont% 27 | \color{darkgray}% 28 | } 29 | \renewcommand{\DoxyLabelFont}{% 30 | \fontseries{bc}\selectfont% 31 | \color{darkgray}% 32 | } 33 | \newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} 34 | 35 | % Page & text layout 36 | \usepackage{geometry} 37 | \geometry{% 38 | a4paper,% 39 | top=2.5cm,% 40 | bottom=2.5cm,% 41 | left=2.5cm,% 42 | right=2.5cm% 43 | } 44 | \tolerance=750 45 | \hfuzz=15pt 46 | \hbadness=750 47 | \setlength{\emergencystretch}{15pt} 48 | \setlength{\parindent}{0cm} 49 | \setlength{\parskip}{3ex plus 2ex minus 2ex} 50 | \makeatletter 51 | \renewcommand{\paragraph}{% 52 | \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{% 53 | \normalfont\normalsize\bfseries\SS@parafont% 54 | }% 55 | } 56 | \renewcommand{\subparagraph}{% 57 | \@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{% 58 | \normalfont\normalsize\bfseries\SS@subparafont% 59 | }% 60 | } 61 | \makeatother 62 | 63 | % Headers & footers 64 | \usepackage{fancyhdr} 65 | \pagestyle{fancyplain} 66 | \fancyhead[LE]{\fancyplain{}{\bfseries\thepage}} 67 | \fancyhead[CE]{\fancyplain{}{}} 68 | \fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}} 69 | \fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}} 70 | \fancyhead[CO]{\fancyplain{}{}} 71 | \fancyhead[RO]{\fancyplain{}{\bfseries\thepage}} 72 | \fancyfoot[LE]{\fancyplain{}{}} 73 | \fancyfoot[CE]{\fancyplain{}{}} 74 | \fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} 75 | \fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} 76 | \fancyfoot[CO]{\fancyplain{}{}} 77 | \fancyfoot[RO]{\fancyplain{}{}} 78 | \renewcommand{\footrulewidth}{0.4pt} 79 | \renewcommand{\chaptermark}[1]{% 80 | \markboth{#1}{}% 81 | } 82 | \renewcommand{\sectionmark}[1]{% 83 | \markright{\thesection\ #1}% 84 | } 85 | 86 | % Indices & bibliography 87 | \usepackage{natbib} 88 | \usepackage[titles]{tocloft} 89 | \setcounter{tocdepth}{3} 90 | \setcounter{secnumdepth}{5} 91 | \makeindex 92 | 93 | % Hyperlinks (required, but should be loaded last) 94 | \usepackage{ifpdf} 95 | \ifpdf 96 | \usepackage[pdftex,pagebackref=true]{hyperref} 97 | \else 98 | \usepackage[ps2pdf,pagebackref=true]{hyperref} 99 | \fi 100 | \hypersetup{% 101 | colorlinks=true,% 102 | linkcolor=blue,% 103 | citecolor=blue,% 104 | unicode% 105 | } 106 | 107 | % Custom commands 108 | \newcommand{\clearemptydoublepage}{% 109 | \newpage{\pagestyle{empty}\cleardoublepage}% 110 | } 111 | 112 | \usepackage{caption} 113 | \captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top} 114 | 115 | %===== C O N T E N T S ===== 116 | 117 | \begin{document} 118 | 119 | % Titlepage & ToC 120 | \hypersetup{pageanchor=false, 121 | bookmarksnumbered=true, 122 | pdfencoding=unicode 123 | } 124 | \pagenumbering{alph} 125 | \begin{titlepage} 126 | \vspace*{7cm} 127 | \begin{center}% 128 | {\Large bullet\+Capi }\\ 129 | \vspace*{1cm} 130 | {\large Generated by Doxygen 1.8.14}\\ 131 | \end{center} 132 | \end{titlepage} 133 | \clearemptydoublepage 134 | \pagenumbering{roman} 135 | \tableofcontents 136 | \clearemptydoublepage 137 | \pagenumbering{arabic} 138 | \hypersetup{pageanchor=true} 139 | 140 | %--- Begin generated contents --- 141 | \chapter{Data Structure Index} 142 | \input{annotated} 143 | \chapter{File Index} 144 | \input{files} 145 | \chapter{Data Structure Documentation} 146 | \input{structVec} 147 | \chapter{File Documentation} 148 | \input{capi_8h} 149 | %--- End generated contents --- 150 | 151 | % Index 152 | \backmatter 153 | \newpage 154 | \phantomsection 155 | \clearemptydoublepage 156 | \addcontentsline{toc}{chapter}{Index} 157 | \printindex 158 | 159 | \end{document} 160 | -------------------------------------------------------------------------------- /capi/doc/latex/structVec.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{structVec}{}\section{Vec Struct Reference} 2 | \label{structVec}\index{Vec@{Vec}} 3 | 4 | 5 | {\ttfamily \#include $<$capi.\+h$>$} 6 | 7 | 8 | 9 | \subsection{Detailed Description} 10 | struct to hold vector or quaternions 11 | 12 | The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} 13 | \item 14 | \mbox{\hyperlink{capi_8h}{capi.\+h}}\end{DoxyCompactItemize} 15 | -------------------------------------------------------------------------------- /capi/lib/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/lib/.gitignore -------------------------------------------------------------------------------- /capi/obj/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/capi/obj/.gitignore -------------------------------------------------------------------------------- /capi/test.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "capi.h" 3 | 4 | void* groundBody; 5 | void* fallingBody; 6 | 7 | void contact(void* b1, void* b2, const Vec* ptA, const Vec* ptB, const Vec* norm) { 8 | printf("------\n"); 9 | if (b1==groundBody) printf("body1 == ground, "); 10 | if (b1==fallingBody) printf("body1 == falling body, "); 11 | if (b2==groundBody) printf("body2 == ground\n"); 12 | if (b2==fallingBody) printf("body2 == falling body\n"); 13 | printf("ptA %2.4lf %2.4lf %2.4lf ", ptA->x, ptA->y, ptA->z); 14 | printf("ptB %2.4lf %2.4lf %2.4lf ", ptB->x, ptB->y, ptB->z); 15 | printf("Nrm %2.4lf %2.4lf %2.4lf\n", norm->x, norm->y, norm->z); 16 | printf("------\n"); 17 | } 18 | 19 | int main(int argc, char* argv[]) { 20 | 21 | void* uni = universeCreate(); 22 | 23 | universeSetGravity(uni, 0, 0, -9.98); 24 | 25 | void* groundShape = shapeCreateBox(uni, 100, 100, 5); // size 100,100,5 26 | groundBody = bodyCreate(uni, groundShape, 0, 0, 0, -5); // 0 mass == static pos 0,0,-5 27 | bodySetRestitution(groundBody, .9); 28 | 29 | void* fallingShape = shapeCreateSphere(uni, 1.); 30 | //void* fallingShape = createBoxShape(uni, .5, .5, .5); 31 | //void* fallingShape = createCylinderShapeY(uni, .5, 1); 32 | 33 | fallingBody = bodyCreate(uni, fallingShape, 10, 0, 0, 1.01); 34 | printf("shape type = %i\n",bodyGetShapeType(fallingBody)); 35 | bodySetRestitution(fallingBody, .9); 36 | printf("ball friction was %lf\n",bodyGetFriction(fallingBody)); 37 | bodySetFriction(fallingBody, 2.0); // just testing.... 38 | printf("ball friction now %lf\n",bodyGetFriction(fallingBody)); 39 | 40 | // apply impulse to make it more interesting... 41 | Vec pos,imp; 42 | pos.x=0; pos.y=0; pos.z=0; 43 | imp.x=0.1; imp.y=0.12; imp.z=0; 44 | bodyApplyImpulse(fallingBody, &imp, &pos); 45 | 46 | for (int i = 0; i < 18; i++) { 47 | universeStep(uni, 1./120., 8); 48 | 49 | collisionCallback(uni, &contact ); 50 | 51 | /* 52 | bodyGetPosition(fallingBody, &pos); 53 | printf("step %i %2.4lf %2.4lf %2.4lf ", i, pos.x, pos.y, pos.z); 54 | bodyGetOrientation(fallingBody, &pos); 55 | printf(" r=%2.4lf %2.4lf %2.4lf %2.4lf ", pos.x, pos.y, pos.z, pos.w); 56 | */ 57 | 58 | bodyGetPositionAndOrientation(fallingBody, &pos, &imp); 59 | printf("step %i %2.4lf %2.4lf %2.4lf ", i, pos.x, pos.y, pos.z); 60 | printf(" r=%2.4lf %2.4lf %2.4lf %2.4lf\n", imp.x, imp.y, imp.z, imp.w); 61 | 62 | bodyGetLinearVelocity(fallingBody, &pos); 63 | printf(" v=%2.4lf %2.4lf %2.4lf \n", pos.x, pos.y, pos.z); 64 | } 65 | 66 | universeDestroy(uni); 67 | 68 | } 69 | -------------------------------------------------------------------------------- /cppHello/Makefile: -------------------------------------------------------------------------------- 1 | # root of bullet source code 2 | BULL=../../bullet3/src/ 3 | 4 | CFLAGS=-c -g -I$(BULL) -Wfatal-errors 5 | LIB= 6 | 7 | # sources required from each bullet component 8 | CollisionShapesSRC=$(BULL)BulletCollision/CollisionShapes/btConcaveShape.cpp \ 9 | $(BULL)BulletCollision/CollisionShapes/btOptimizedBvh.cpp \ 10 | $(BULL)BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \ 11 | $(BULL)BulletCollision/CollisionShapes/btConvexPolyhedron.cpp \ 12 | $(BULL)BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \ 13 | $(BULL)BulletCollision/CollisionShapes/btTriangleCallback.cpp \ 14 | $(BULL)BulletCollision/CollisionShapes/btCollisionShape.cpp \ 15 | $(BULL)BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \ 16 | $(BULL)BulletCollision/CollisionShapes/btSphereShape.cpp \ 17 | $(BULL)BulletCollision/CollisionShapes/btConvexShape.cpp \ 18 | $(BULL)BulletCollision/CollisionShapes/btConvexInternalShape.cpp \ 19 | $(BULL)BulletCollision/CollisionShapes/btBoxShape.cpp 20 | 21 | CollisionDispatchSRC=$(BULL)BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \ 22 | $(BULL)BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \ 23 | $(BULL)BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \ 24 | $(BULL)BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp \ 25 | $(BULL)BulletCollision/CollisionDispatch/btHashedSimplePairCache.cpp \ 26 | $(BULL)BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp \ 27 | $(BULL)BulletCollision/CollisionDispatch/btUnionFind.cpp \ 28 | $(BULL)BulletCollision/CollisionDispatch/btCollisionObject.cpp \ 29 | $(BULL)BulletCollision/CollisionDispatch/btCollisionWorld.cpp \ 30 | $(BULL)BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \ 31 | $(BULL)BulletCollision/CollisionDispatch/btManifoldResult.cpp \ 32 | $(BULL)BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \ 33 | $(BULL)BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp \ 34 | $(BULL)BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \ 35 | $(BULL)BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp \ 36 | $(BULL)BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp \ 37 | $(BULL)BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \ 38 | $(BULL)BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \ 39 | $(BULL)BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \ 40 | $(BULL)BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp 41 | 42 | BroadphaseCollisionSRC=$(BULL)BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp \ 43 | $(BULL)BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \ 44 | $(BULL)BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \ 45 | $(BULL)BulletCollision/BroadphaseCollision/btDbvt.cpp \ 46 | $(BULL)BulletCollision/BroadphaseCollision/btDispatcher.cpp \ 47 | $(BULL)BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp 48 | 49 | NarrowPhaseCollisionSRC=$(BULL)BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \ 50 | $(BULL)BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp \ 51 | $(BULL)BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \ 52 | $(BULL)BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \ 53 | $(BULL)BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \ 54 | $(BULL)BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \ 55 | $(BULL)BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp \ 56 | $(BULL)BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \ 57 | $(BULL)BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \ 58 | $(BULL)BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \ 59 | $(BULL)BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \ 60 | $(BULL)BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp 61 | 62 | DynamicsSRC=$(BULL)BulletDynamics/Dynamics/btRigidBody.cpp \ 63 | $(BULL)BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp 64 | 65 | ConstraintSolverSRC=$(BULL)BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \ 66 | $(BULL)BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \ 67 | $(BULL)BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \ 68 | $(BULL)BulletDynamics/ConstraintSolver/btTypedConstraint.cpp 69 | 70 | LinearMathSRC=$(BULL)LinearMath/btConvexHullComputer.cpp \ 71 | $(BULL)LinearMath/btGeometryUtil.cpp \ 72 | $(BULL)LinearMath/btQuickprof.cpp \ 73 | $(BULL)LinearMath/btAlignedAllocator.cpp 74 | 75 | # list .o files for each bullet component 76 | LinearMathOBJ=$(patsubst $(BULL)LinearMath/%.cpp,obj/%.o,$(LinearMathSRC)) 77 | ConstraintSolverOBJ=$(patsubst $(BULL)BulletDynamics/ConstraintSolver/%.cpp,obj/%.o,$(ConstraintSolverSRC)) 78 | DynamicsOBJ=$(patsubst $(BULL)BulletDynamics/Dynamics/%.cpp,obj/%.o,$(DynamicsSRC)) 79 | NarrowPhaseCollisionOBJ=$(patsubst $(BULL)BulletCollision/NarrowPhaseCollision/%.cpp,obj/%.o,$(NarrowPhaseCollisionSRC)) 80 | BroadphaseCollisionOBJ=$(patsubst $(BULL)BulletCollision/BroadphaseCollision/%.cpp,obj/%.o,$(BroadphaseCollisionSRC)) 81 | CollisionDispatchOBJ=$(patsubst $(BULL)BulletCollision/CollisionDispatch/%.cpp,obj/%.o,$(CollisionDispatchSRC)) 82 | CollisionShapesOBJ=$(patsubst $(BULL)BulletCollision/CollisionShapes/%.cpp,obj/%.o,$(CollisionShapesSRC)) 83 | 84 | # all the bullet components together (object files) 85 | BOBJ=$(LinearMathOBJ) $(ConstraintSolverOBJ) $(DynamicsOBJ) \ 86 | $(NarrowPhaseCollisionOBJ) $(BroadphaseCollisionOBJ) \ 87 | $(CollisionDispatchOBJ) $(CollisionShapesOBJ) 88 | 89 | all: hello 90 | 91 | 92 | # compile rule for each component of bullet 93 | $(LinearMathOBJ): obj/%.o: $(BULL)LinearMath/%.cpp 94 | g++ $(CFLAGS) -o $@ $^ 95 | 96 | $(ConstraintSolverOBJ): obj/%.o: $(BULL)BulletDynamics/ConstraintSolver/%.cpp 97 | g++ $(CFLAGS) -o $@ $^ 98 | 99 | $(DynamicsOBJ): obj/%.o: $(BULL)BulletDynamics/Dynamics/%.cpp 100 | g++ $(CFLAGS) -o $@ $^ 101 | 102 | $(NarrowPhaseCollisionOBJ): obj/%.o: $(BULL)BulletCollision/NarrowPhaseCollision/%.cpp 103 | g++ $(CFLAGS) -o $@ $^ 104 | 105 | $(BroadphaseCollisionOBJ): obj/%.o: $(BULL)BulletCollision/BroadphaseCollision/%.cpp 106 | g++ $(CFLAGS) -o $@ $^ 107 | 108 | $(CollisionDispatchOBJ): obj/%.o: $(BULL)BulletCollision/CollisionDispatch/%.cpp 109 | g++ $(CFLAGS) -o $@ $^ 110 | 111 | $(CollisionShapesOBJ): obj/%.o: $(BULL)BulletCollision/CollisionShapes/%.cpp 112 | g++ $(CFLAGS) -o $@ $^ 113 | 114 | 115 | hello: obj/hello.o $(BOBJ) 116 | g++ obj/hello.o $(BOBJ) $(LIB) -o hello 117 | 118 | obj/hello.o: hello.cpp 119 | g++ $(CFLAGS) hello.cpp -o obj/hello.o 120 | 121 | clean: 122 | rm -rf hello 123 | rm -rf obj/*.o 124 | -------------------------------------------------------------------------------- /cppHello/hello.cpp: -------------------------------------------------------------------------------- 1 | #include "btBulletDynamicsCommon.h" 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main(int argc, char** argv) 7 | { 8 | 9 | int i; 10 | btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration(); 11 | btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration); 12 | btBroadphaseInterface* overlappingPairCache = new btDbvtBroadphase(); 13 | btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver; 14 | btDiscreteDynamicsWorld* dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, overlappingPairCache, solver, collisionConfiguration); 15 | dynamicsWorld->setGravity(btVector3(0, -10, 0)); 16 | 17 | btAlignedObjectArray collisionShapes; 18 | 19 | 20 | { 21 | btCollisionShape* groundShape = new btBoxShape(btVector3(btScalar(50.), btScalar(50.), btScalar(50.))); 22 | collisionShapes.push_back(groundShape); 23 | 24 | btTransform groundTransform; 25 | groundTransform.setIdentity(); 26 | groundTransform.setOrigin(btVector3(0, -56, 0)); 27 | 28 | btScalar mass(0.); 29 | bool isDynamic = (mass != 0.f); 30 | 31 | btVector3 localInertia(0, 0, 0); 32 | if (isDynamic) 33 | groundShape->calculateLocalInertia(mass, localInertia); 34 | 35 | btDefaultMotionState* myMotionState = new btDefaultMotionState(groundTransform); 36 | btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, myMotionState, groundShape, localInertia); 37 | btRigidBody* body = new btRigidBody(rbInfo); 38 | 39 | dynamicsWorld->addRigidBody(body); 40 | } 41 | btRigidBody* body; 42 | { 43 | //btCollisionShape* colShape = new btBoxShape(btVector3(1,1,1)); 44 | btCollisionShape* colShape = new btSphereShape(btScalar(1.)); 45 | collisionShapes.push_back(colShape); 46 | 47 | btTransform startTransform; 48 | startTransform.setIdentity(); 49 | 50 | btScalar mass(1.f); 51 | bool isDynamic = (mass != 0.f); 52 | 53 | btVector3 localInertia(0, 0, 0); 54 | if (isDynamic) 55 | colShape->calculateLocalInertia(mass, localInertia); 56 | 57 | startTransform.setOrigin(btVector3(2, 10, 0)); 58 | 59 | btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform); 60 | btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, myMotionState, colShape, localInertia); 61 | body = new btRigidBody(rbInfo); 62 | 63 | dynamicsWorld->addRigidBody(body); 64 | } 65 | 66 | for (i = 0; i < 120; i++) 67 | { 68 | dynamicsWorld->stepSimulation(1.f / 60.f, 10); 69 | 70 | //for (int j = dynamicsWorld->getNumCollisionObjects() - 1; j >= 0; j--) 71 | //{ 72 | // btCollisionObject* obj = dynamicsWorld->getCollisionObjectArray()[j]; 73 | // btRigidBody* body = btRigidBody::upcast(obj); 74 | btTransform trans; 75 | if (body && body->getMotionState()) 76 | { 77 | body->getMotionState()->getWorldTransform(trans); 78 | } 79 | else 80 | { 81 | trans = body->getWorldTransform(); 82 | } 83 | printf("world pos object %f,%f,%f\n", float(trans.getOrigin().getX()), float(trans.getOrigin().getY()), float(trans.getOrigin().getZ())); 84 | //} 85 | } 86 | 87 | for (i = dynamicsWorld->getNumCollisionObjects() - 1; i >= 0; i--) 88 | { 89 | btCollisionObject* obj = dynamicsWorld->getCollisionObjectArray()[i]; 90 | btRigidBody* body = btRigidBody::upcast(obj); 91 | if (body && body->getMotionState()) 92 | { 93 | delete body->getMotionState(); 94 | } 95 | dynamicsWorld->removeCollisionObject(obj); 96 | delete obj; 97 | } 98 | 99 | for (int j = 0; j < collisionShapes.size(); j++) 100 | { 101 | btCollisionShape* shape = collisionShapes[j]; 102 | collisionShapes[j] = 0; 103 | delete shape; 104 | } 105 | 106 | delete dynamicsWorld; 107 | delete solver; 108 | delete overlappingPairCache; 109 | delete dispatcher; 110 | delete collisionConfiguration; 111 | 112 | collisionShapes.clear(); 113 | } 114 | -------------------------------------------------------------------------------- /gluTest/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | FLAGS=-c -g -I../capi/ -I../../bullet3/src/ 4 | #-Wfatal-errors 5 | 6 | LIB=../capi/lib/libbullet.a -lGL -lglut -lGLU 7 | 8 | 9 | all: main 10 | 11 | obj/capi.o: ../capi/capi.cpp 12 | g++ $(FLAGS) ../capi/capi.cpp -o obj/capi.o 13 | 14 | main: obj/main.o obj/capi.o 15 | g++ obj/capi.o obj/main.o $(LIB) -o main 16 | 17 | obj/main.o: main.c 18 | gcc -std=c11 $(FLAGS) main.c -o obj/main.o 19 | 20 | check: main 21 | valgrind --suppressions=valgind.suppression.txt --leak-check=full ./main 22 | clean: 23 | rm -rf main 24 | rm -rf obj/main.o 25 | rm -rf obj/capi.o 26 | 27 | 28 | -------------------------------------------------------------------------------- /gluTest/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | only used glew / glut for speed - really sucky example DONT DO THIS !!! 4 | that said it shows the basics of using bullet with your own graphics 5 | routines.... 6 | 7 | */ 8 | #include 9 | #include 10 | #include "stdio.h" 11 | 12 | #include "../capi/capi.h" 13 | 14 | int keys[256]; 15 | float mat[16]; 16 | int* keyStates = &keys[0]; 17 | int win; 18 | 19 | void* uni; 20 | void* fallingBodies[16]; 21 | 22 | 23 | void keyOperations (void) { 24 | if (keyStates[27]) { 25 | glutDestroyWindow(win); 26 | universeDestroy(uni); 27 | exit (0); 28 | } 29 | } 30 | 31 | void post(int i) { 32 | glutPostRedisplay(); 33 | } 34 | 35 | void display (void) { 36 | 37 | 38 | keyOperations(); 39 | 40 | universeStep(uni, 1./60., 8); 41 | 42 | glClearColor(.20f, .4f, .8f, 1.0f); 43 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 44 | glEnable(GL_DEPTH_TEST); 45 | 46 | for (int i=0; i<15; i++) { 47 | 48 | glLoadIdentity(); 49 | glTranslatef(0,-5,0); 50 | glRotatef(30,1,0,0); 51 | 52 | bodyGetOpenGLMatrix(fallingBodies[i], &mat[0]); 53 | glMultMatrixf((GLfloat*)mat); 54 | 55 | int s = bodyGetShapeType(fallingBodies[i]); 56 | if (s==T_BOX) { 57 | glColor3f(1,1,1); 58 | glutSolidCube(1.0f); 59 | glColor3f(0,0,0); 60 | glutWireCube(1.0f); 61 | } 62 | if (s==T_SPHERE) { 63 | glColor3f(1,1,1); 64 | glutSolidSphere(1.0f,16,8); 65 | glColor3f(0,0,0); 66 | glutWireSphere(1.0f,16,8); 67 | } 68 | 69 | } 70 | 71 | glFlush(); 72 | glutSwapBuffers(); 73 | 74 | glutTimerFunc(1000.0/60.0, post, 1); 75 | 76 | } 77 | 78 | void reshape (int width, int height) { 79 | glViewport(0, 0, (GLsizei)width, (GLsizei)height); 80 | glMatrixMode(GL_PROJECTION); 81 | glLoadIdentity(); 82 | gluPerspective(60, (GLfloat)width / (GLfloat)height, 1.0, 100.0); 83 | glMatrixMode(GL_MODELVIEW); 84 | 85 | } 86 | 87 | void keyPressed (unsigned char key, int x, int y) { 88 | //printf("%i\n",key); 89 | keyStates[key] = 1; 90 | } 91 | 92 | void keyUp (unsigned char key, int x, int y) { 93 | keyStates[key] = 0; 94 | } 95 | 96 | int main (int argc, char **argv) { 97 | 98 | uni = universeCreate(); 99 | universeSetGravity(uni, 0,-9.98,0); 100 | 101 | void* groundShape = shapeCreateBox(uni, 100, 5, 100); // size 100,100,5 102 | void* groundBody = bodyCreate(uni, groundShape, 0, 0, -5, 0); // 0 mass == static pos 0,0,-5 103 | bodySetRestitution(groundBody, .9); 104 | 105 | void* fallingShape = shapeCreateBox(uni, .5, .5, .5); 106 | fallingBodies[1] = bodyCreate(uni, fallingShape, 10, 0, 12, -7); 107 | 108 | void* fallingShape2 = shapeCreateSphere(uni, 1.); 109 | fallingBodies[0] = bodyCreate(uni, fallingShape2, 10, 0.2, 6, -6.75); 110 | 111 | Vec t; 112 | t.x=20;t.y=20;t.z=20; 113 | bodyApplyTorque(fallingBodies[0], &t); 114 | bodySetRestitution(fallingBodies[0], .8); 115 | bodySetRestitution(fallingBodies[1], .8); 116 | 117 | 118 | 119 | 120 | for (int i=2; i<15; i++) { 121 | void* fs = shapeCreateBox(uni, 0.5, .5,.5); 122 | fallingBodies[i] = bodyCreate(uni, fs, 1, -2,(i-2)*1.1, -9); 123 | bodySetRotationEular(fallingBodies[i], .7,0,0); 124 | bodySetFriction(fallingBodies[i], .8); 125 | } 126 | 127 | 128 | 129 | glutInit(&argc, argv); 130 | glutInitDisplayMode (GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); 131 | glutInitWindowSize (320, 240); 132 | glutInitWindowPosition (100, 100); 133 | win = glutCreateWindow ("yuk"); 134 | 135 | glutDisplayFunc(display); 136 | 137 | glutReshapeFunc(reshape); 138 | 139 | glutKeyboardFunc(keyPressed); 140 | glutKeyboardUpFunc(keyUp); 141 | 142 | glutMainLoop(); 143 | } 144 | -------------------------------------------------------------------------------- /gluTest/obj/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriscamacho/bulletCapi/01a8d448f73fc2bf60bb59ae3e5fac9e29311da5/gluTest/obj/.gitignore -------------------------------------------------------------------------------- /gluTest/valgind.suppression.txt: -------------------------------------------------------------------------------- 1 | { 2 | ignore video driver 3 | Memcheck:Addr8 4 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 5 | } 6 | 7 | { 8 | ignore video driver 9 | Memcheck:Addr4 10 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 11 | } 12 | 13 | { 14 | ignore video driver 15 | Memcheck:Addr1 16 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 17 | } 18 | 19 | { 20 | ignore video driver 21 | Memcheck:Addr8 22 | fun:memmove 23 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 24 | } 25 | 26 | { 27 | ignore video driver 28 | Memcheck:Addr8 29 | fun:bcmp 30 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 31 | } 32 | 33 | { 34 | ignore video driver 35 | Memcheck:Addr4 36 | fun:memmove 37 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 38 | } 39 | 40 | { 41 | ignore video driver 42 | Memcheck:Addr2 43 | fun:memmove 44 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 45 | } 46 | 47 | { 48 | ignore video driver 49 | Memcheck:Addr1 50 | fun:bcmp 51 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 52 | } 53 | 54 | { 55 | ignore video driver 56 | Memcheck:Addr1 57 | fun:memmove 58 | obj:/usr/lib/xorg/modules/drivers/i965_dri.so 59 | } 60 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ### Depricated not suggested for use 2 | 3 | Unfortunately over the years I have found the bullet API to be quite fragile often new versions of bullet have caused breaking changes. 4 | Contrast this with the much more straight forward and more importantly *stable* API of OpenDE for example... 5 | 6 | ### Why? 7 | 8 | I wanted to use bullet physics from C (not a C++ fan) 9 | 10 | 11 | ### But doesn't bullet already have a C API? 12 | 13 | 14 | Yes but alas its tightly enmeshed with the rest of the example code, 15 | like the exampleBrowser, I want to just use the core code of bullet I 16 | need and also provide my own graphics routines. 17 | 18 | ### So whats the point again? 19 | 20 | 21 | The primary goal of this C API is to provide the core functionallity of 22 | bullet without weighing it down with unrelated graphics or other utility 23 | code 24 | 25 | ## Instructions 26 | start off in the capi sub directory 27 | 28 | compiling this project will provide you with a textual demonstration 29 | and also a static library of the parts bullet the C API is currently 30 | using. In addition this is where the C header lives (capi.h) 31 | In order for the makefile to work you will have to locate where you 32 | have extracted the bullet sdk. Look inside bullet.mk 33 | 34 | # root of bullet source code 35 | BULL=../../bullet3/src/ 36 | 37 | adjust this path to point to the source directory of bullet, this part 38 | of the build system is possibly less than optimal but it does ensure 39 | complete independence from the bullet build system. 40 | 41 | Once you have verified that the CAPI example works you can move onto the 42 | simple graphical example. 43 | 44 | alternativly if you are not bothered about playing with the console test 45 | you can just do 46 | 47 | make lib/libbullet.a 48 | 49 | in addition to libbullet.a you will need capi.o (compiled from capi.cpp) 50 | 51 | ### gluTest 52 | This is a horror, no truly, its NOT an example of how you should produce 53 | graphics. That said its a minimum amount of code that can show some 54 | kind of 3d graphics, without there being the confusion of a mini 55 | graphics engine, with model loaders, shaders and lots of other things 56 | that could enmesh it into a very specific use case... 57 | This example does show using some basic modifications to a body such as 58 | changing basic properties like friction and restitution to make a 59 | pleasing demonstration 60 | 61 | external to this folder gluTest links in libbullet.a and compiles 62 | capi.cpp and links that to main.o the C frontend of this example. 63 | 64 | ### GL3v3 65 | while a better (though probably not ideal) example of producing 3d graphics 66 | this does add a bunch of extra clutter (theres way more OpenGL and support 67 | stuff than actual bullet use!) This example is where new features are introduced 68 | you will need to adjust the makefile for its dependancy (https://github.com/Kazade/kazmath) 69 | if you clone it to a location alongside bulletCapi you should be good to go 70 | 71 | 72 | ### cppHello 73 | This is a simple cpp reference example, building this with libraries 74 | compiled by bullets own build system lead to difficult to diagnose 75 | memory corruption (hence I decided to implement bullet.mk...) it was 76 | initially used to provide a reference design that I used to begin 77 | writing capi.cpp and capi.hpp which constitutes the C++ layer between 78 | the C front end and the C++ backend 79 | This will be removed before long as the "wrapper" is already more fully 80 | featured that this example. 81 | 82 | 83 | 84 | ## The API 85 | 86 | please see the doxygen docs 87 | 88 | 89 | 90 | 91 | ### Conclusion 92 | This is very early days, there is lots to do, any contributions 93 | especially examples most apreciated, if an example needs some missing 94 | functionallity please do post an issue. 95 | --------------------------------------------------------------------------------