b2Settings.h
Go to the documentation of this file.
00001 /*
00002 * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
00003 *
00004 * This software is provided 'as-is', without any express or implied
00005 * warranty.  In no event will the authors be held liable for any damages
00006 * arising from the use of this software.
00007 * Permission is granted to anyone to use this software for any purpose,
00008 * including commercial applications, and to alter it and redistribute it
00009 * freely, subject to the following restrictions:
00010 * 1. The origin of this software must not be misrepresented; you must not
00011 * claim that you wrote the original software. If you use this software
00012 * in a product, an acknowledgment in the product documentation would be
00013 * appreciated but is not required.
00014 * 2. Altered source versions must be plainly marked as such, and must not be
00015 * misrepresented as being the original software.
00016 * 3. This notice may not be removed or altered from any source distribution.
00017 */
00018 
00019 #ifndef B2_SETTINGS_H
00020 #define B2_SETTINGS_H
00021 
00022 #include <stddef.h>
00023 #include <assert.h>
00024 #include <float.h>
00025 
00026 #define B2_NOT_USED(x) ((void)(x))
00027 #define b2Assert(A) assert(A)
00028 
00029 typedef signed char     int8;
00030 typedef signed short int16;
00031 typedef signed int int32;
00032 typedef unsigned char uint8;
00033 typedef unsigned short uint16;
00034 typedef unsigned int uint32;
00035 typedef float float32;
00036 typedef double float64;
00037 
00038 #define b2_maxFloat             FLT_MAX
00039 #define b2_epsilon              FLT_EPSILON
00040 #define b2_pi                   3.14159265359f
00041 
00045 
00046 // Collision
00047 
00050 #define b2_maxManifoldPoints    2
00051 
00054 #define b2_maxPolygonVertices   8
00055 
00059 #define b2_aabbExtension                0.1f
00060 
00064 #define b2_aabbMultiplier               2.0f
00065 
00068 #define b2_linearSlop                   0.005f
00069 
00072 #define b2_angularSlop                  (2.0f / 180.0f * b2_pi)
00073 
00077 #define b2_polygonRadius                (2.0f * b2_linearSlop)
00078 
00080 #define b2_maxSubSteps                  8
00081 
00082 
00083 // Dynamics
00084 
00086 #define b2_maxTOIContacts                       32
00087 
00090 #define b2_velocityThreshold            1.0f
00091 
00094 #define b2_maxLinearCorrection          0.2f
00095 
00098 #define b2_maxAngularCorrection         (8.0f / 180.0f * b2_pi)
00099 
00102 #define b2_maxTranslation                       2.0f
00103 #define b2_maxTranslationSquared        (b2_maxTranslation * b2_maxTranslation)
00104 
00107 #define b2_maxRotation                          (0.5f * b2_pi)
00108 #define b2_maxRotationSquared           (b2_maxRotation * b2_maxRotation)
00109 
00113 #define b2_baumgarte                            0.2f
00114 #define b2_toiBaugarte                          0.75f
00115 
00116 
00117 // Sleep
00118 
00120 #define b2_timeToSleep                          0.5f
00121 
00123 #define b2_linearSleepTolerance         0.01f
00124 
00126 #define b2_angularSleepTolerance        (2.0f / 180.0f * b2_pi)
00127 
00128 // Memory Allocation
00129 
00131 void* b2Alloc(int32 size);
00132 
00134 void b2Free(void* mem);
00135 
00137 void b2Log(const char* string, ...);
00138 
00141 struct b2Version
00142 {
00143         int32 major;            
00144         int32 minor;            
00145         int32 revision;         
00146 };
00147 
00149 extern b2Version b2_version;
00150 
00151 #endif


mvsim
Author(s):
autogenerated on Thu Sep 7 2017 09:27:48