├── include ├── glm │ ├── gtx │ │ ├── ocl_type.inl │ │ ├── vec1.inl │ │ ├── simd_vec4.hpp │ │ ├── std_based_type.inl │ │ ├── number_precision.inl │ │ ├── unsigned_int.inl │ │ ├── raw_data.inl │ │ ├── perpendicular.inl │ │ ├── projection.inl │ │ ├── int_10_10_10_2.inl │ │ ├── normal.inl │ │ ├── log_base.inl │ │ ├── mixed_product.inl │ │ ├── handed_coordinate_space.inl │ │ ├── orthonormalize.inl │ │ ├── matrix_cross_product.inl │ │ ├── vector_access.inl │ │ ├── closest_point.inl │ │ ├── reciprocal.hpp │ │ ├── unsigned_int.hpp │ │ ├── random.hpp │ │ ├── ulp.hpp │ │ ├── extend.inl │ │ ├── noise.hpp │ │ ├── epsilon.hpp │ │ ├── gradient_paint.inl │ │ ├── optimum_pow.inl │ │ ├── constants.hpp │ │ ├── polar_coordinates.inl │ │ ├── compatibility.inl │ │ ├── vector_angle.inl │ │ └── component_wise.inl │ ├── core │ │ ├── func_common.hpp │ │ ├── func_common.inl │ │ ├── type_half.inl │ │ ├── func_integer.hpp │ │ ├── type_mat.inl │ │ ├── type_vec.inl │ │ ├── intrinsic_exponential.inl │ │ ├── intrinsic_trigonometric.inl │ │ ├── type_vec.hpp │ │ ├── dummy.cpp │ │ ├── hint.hpp │ │ ├── type_size.hpp │ │ ├── intrinsic_trigonometric.hpp │ │ ├── _fixes.hpp │ │ └── intrinsic_vector_relational.hpp │ └── gtc │ │ └── type_precision.inl └── win32 │ └── bullet │ ├── BulletMultiThreaded │ ├── SpuSampleTask │ │ ├── readme.txt │ │ └── SpuSampleTask.h │ ├── SpuNarrowPhaseCollisionTask │ │ ├── readme.txt │ │ ├── boxBoxDistance.cpp │ │ ├── SpuLocalSupport.h │ │ ├── SpuConvexPenetrationDepthSolver.h │ │ └── SpuMinkowskiPenetrationDepthSolver.h │ ├── btParallelConstraintSolver.h │ ├── btParallelConstraintSolver.cpp │ ├── GpuSoftBodySolvers │ │ ├── OpenCL │ │ │ ├── OpenCLC10 │ │ │ │ ├── ApplyForces.cl │ │ │ │ ├── UpdateFixedVertexPositions.cl │ │ │ │ ├── UpdatePositionsFromVelocities.cl │ │ │ │ ├── Integrate.cl │ │ │ │ ├── PrepareLinks.cl │ │ │ │ ├── UpdatePositions.cl │ │ │ │ ├── UpdateNodes.cl │ │ │ │ ├── UpdateConstants.cl │ │ │ │ ├── VSolveLinks.cl │ │ │ │ ├── SolvePositions.cl │ │ │ │ └── OutputToVertexArray.cl │ │ │ ├── CMakeLists.txt │ │ │ ├── AMD │ │ │ │ └── premake4.lua │ │ │ ├── Intel │ │ │ │ └── premake4.lua │ │ │ └── NVidia │ │ │ │ └── premake4.lua │ │ ├── CMakeLists.txt │ │ └── DX11 │ │ │ ├── premake4.lua │ │ │ └── HLSL │ │ │ ├── UpdatePositionsFromVelocities.hlsl │ │ │ ├── Integrate.hlsl │ │ │ ├── PrepareLinks.hlsl │ │ │ ├── UpdatePositions.hlsl │ │ │ ├── UpdateConstants.hlsl │ │ │ ├── SolvePositions.hlsl │ │ │ ├── UpdateNodes.hlsl │ │ │ ├── VSolveLinks.hlsl │ │ │ └── OutputToVertexArray.hlsl │ ├── btThreadSupportInterface.cpp │ ├── PpuAddressSpace.h │ ├── SpuCollisionObjectWrapper.h │ ├── SpuCollisionObjectWrapper.cpp │ └── btGpuUtilsSharedDefs.h │ ├── BulletSoftBody │ ├── btSoftBody.cpp │ ├── premake4.lua │ └── CMakeLists.txt │ ├── BulletCollision │ ├── Gimpact │ │ ├── btGImpactShape.h │ │ ├── btGImpactCollisionAlgorithm.cpp │ │ ├── gim_geometry.h │ │ └── btGImpactMassUtil.h │ ├── premake4.lua │ ├── BroadphaseCollision │ │ ├── btBroadphaseProxy.cpp │ │ ├── btDispatcher.cpp │ │ ├── btCollisionAlgorithm.cpp │ │ ├── btOverlappingPairCallback.h │ │ └── btAxisSweep3.cpp │ ├── NarrowPhaseCollision │ │ ├── btConvexCast.cpp │ │ ├── btConvexPenetrationDepthSolver.h │ │ ├── btMinkowskiPenetrationDepthSolver.h │ │ ├── btGjkEpaPenetrationDepthSolver.h │ │ ├── btGjkConvexCast.h │ │ └── btPointCollector.h │ ├── CollisionShapes │ │ ├── btConcaveShape.cpp │ │ ├── btTriangleCallback.cpp │ │ ├── btTriangleBuffer.cpp │ │ ├── btCollisionMargin.h │ │ ├── btMaterial.h │ │ ├── btEmptyShape.cpp │ │ ├── btBox2dShape.cpp │ │ ├── btTriangleCallback.h │ │ ├── btBoxShape.cpp │ │ └── btConvexPolyhedron.h │ └── CollisionDispatch │ │ ├── btEmptyCollisionAlgorithm.cpp │ │ ├── btCollisionObjectWrapper.h │ │ ├── btActivatingCollisionAlgorithm.h │ │ ├── btCollisionCreateFunc.h │ │ ├── btCollisionConfiguration.h │ │ ├── btActivatingCollisionAlgorithm.cpp │ │ ├── btInternalEdgeUtility.h │ │ ├── btBoxBoxDetector.h │ │ └── SphereTriangleDetector.h │ ├── LinearMath │ ├── premake4.lua │ ├── btDefaultMotionState.h │ ├── btRandom.h │ ├── btMotionState.h │ ├── btMinMax.h │ ├── btGeometryUtil.h │ └── CMakeLists.txt │ ├── BulletDynamics │ ├── premake4.lua │ ├── Vehicle │ │ ├── btVehicleRaycaster.h │ │ └── btWheelInfo.cpp │ ├── Dynamics │ │ └── btActionInterface.h │ ├── Character │ │ └── btCharacterControllerInterface.h │ └── ConstraintSolver │ │ ├── btGearConstraint.cpp │ │ ├── btConstraintSolver.h │ │ └── btGearConstraint.h │ ├── vectormath │ └── vmInclude.h │ └── btBulletDynamicsCommon.h ├── palette.dat ├── editor ├── block_tool.png ├── bucket_tool.png ├── pencil_tool.png └── pointer_tool.png ├── lib └── win32 │ ├── LinearMath.lib │ ├── BulletCollision.lib │ ├── BulletDynamics.lib │ └── BulletSoftBody.lib ├── unity3d └── README.txt ├── tools ├── setup.py └── mesher.pyx ├── .gitignore ├── LICENSE.txt └── src ├── include_gl.h ├── run.cpp ├── random.h ├── modelproperties.h └── types.h /include/glm/gtx/ocl_type.inl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /include/glm/gtx/vec1.inl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /palette.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/palette.dat -------------------------------------------------------------------------------- /editor/block_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/editor/block_tool.png -------------------------------------------------------------------------------- /editor/bucket_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/editor/bucket_tool.png -------------------------------------------------------------------------------- /editor/pencil_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/editor/pencil_tool.png -------------------------------------------------------------------------------- /editor/pointer_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/editor/pointer_tool.png -------------------------------------------------------------------------------- /lib/win32/LinearMath.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/lib/win32/LinearMath.lib -------------------------------------------------------------------------------- /include/glm/gtx/simd_vec4.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/glm/gtx/simd_vec4.hpp -------------------------------------------------------------------------------- /lib/win32/BulletCollision.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/lib/win32/BulletCollision.lib -------------------------------------------------------------------------------- /lib/win32/BulletDynamics.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/lib/win32/BulletDynamics.lib -------------------------------------------------------------------------------- /lib/win32/BulletSoftBody.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/lib/win32/BulletSoftBody.lib -------------------------------------------------------------------------------- /include/glm/core/func_common.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/glm/core/func_common.hpp -------------------------------------------------------------------------------- /include/glm/core/func_common.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/glm/core/func_common.inl -------------------------------------------------------------------------------- /include/glm/core/type_half.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/glm/core/type_half.inl -------------------------------------------------------------------------------- /include/glm/core/func_integer.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/glm/core/func_integer.hpp -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/SpuSampleTask/readme.txt: -------------------------------------------------------------------------------- 1 | Empty placeholder for future Libspe2 SPU task 2 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/readme.txt: -------------------------------------------------------------------------------- 1 | Empty placeholder for future Libspe2 SPU task 2 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletSoftBody/btSoftBody.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/win32/bullet/BulletSoftBody/btSoftBody.cpp -------------------------------------------------------------------------------- /unity3d/README.txt: -------------------------------------------------------------------------------- 1 | These are runtime scripts for Unity3D, which allow for per-frame animation 2 | and the ability to load voxel data for creating e.g. explosion effects. -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/Gimpact/btGImpactShape.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/win32/bullet/BulletCollision/Gimpact/btGImpactShape.h -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/btParallelConstraintSolver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/win32/bullet/BulletMultiThreaded/btParallelConstraintSolver.h -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/btParallelConstraintSolver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/win32/bullet/BulletMultiThreaded/btParallelConstraintSolver.cpp -------------------------------------------------------------------------------- /tools/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | from Cython.Build import cythonize 3 | 4 | setup( 5 | name = "voxie tool modules", 6 | ext_modules = cythonize('mesher.pyx'), 7 | ) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/win32/bullet/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/win32/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp -------------------------------------------------------------------------------- /include/win32/bullet/LinearMath/premake4.lua: -------------------------------------------------------------------------------- 1 | project "LinearMath" 2 | 3 | kind "StaticLib" 4 | targetdir "../../lib" 5 | includedirs { 6 | "..", 7 | } 8 | files { 9 | "**.cpp", 10 | "**.h" 11 | } -------------------------------------------------------------------------------- /include/win32/bullet/BulletDynamics/premake4.lua: -------------------------------------------------------------------------------- 1 | project "BulletDynamics" 2 | 3 | kind "StaticLib" 4 | targetdir "../../lib" 5 | includedirs { 6 | "..", 7 | } 8 | files { 9 | "**.cpp", 10 | "**.h" 11 | } -------------------------------------------------------------------------------- /include/win32/bullet/BulletSoftBody/premake4.lua: -------------------------------------------------------------------------------- 1 | project "BulletSoftBody" 2 | 3 | kind "StaticLib" 4 | targetdir "../../lib" 5 | includedirs { 6 | "..", 7 | } 8 | files { 9 | "**.cpp", 10 | "**.h" 11 | } -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/premake4.lua: -------------------------------------------------------------------------------- 1 | project "BulletCollision" 2 | 3 | kind "StaticLib" 4 | targetdir "../../lib" 5 | includedirs { 6 | "..", 7 | } 8 | files { 9 | "**.cpp", 10 | "**.h" 11 | } -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/ApplyForces.cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matpow2/voxie/HEAD/include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/ApplyForces.cl -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE_DIRECTORIES( 3 | ${BULLET_PHYSICS_SOURCE_DIR}/src 4 | ) 5 | 6 | 7 | SUBDIRS ( 8 | OpenCL 9 | ) 10 | 11 | IF( USE_DX11 ) 12 | SUBDIRS( DX11 ) 13 | ENDIF( USE_DX11 ) 14 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SUBDIRS( MiniCL ) 2 | 3 | IF(BUILD_INTEL_OPENCL_DEMOS) 4 | SUBDIRS(Intel) 5 | ENDIF() 6 | 7 | IF(BUILD_AMD_OPENCL_DEMOS) 8 | SUBDIRS(AMD) 9 | ENDIF() 10 | 11 | IF(BUILD_NVIDIA_OPENCL_DEMOS) 12 | SUBDIRS(NVidia) 13 | ENDIF() 14 | 15 | IF(APPLE AND OPENCL_LIBRARY) 16 | SUBDIRS(Apple) 17 | ENDIF() 18 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/premake4.lua: -------------------------------------------------------------------------------- 1 | 2 | hasDX11 = findDirectX11() 3 | 4 | if (hasDX11) then 5 | 6 | project "BulletSoftBodyDX11Solvers" 7 | 8 | initDirectX11() 9 | 10 | kind "StaticLib" 11 | 12 | targetdir "../../../../lib" 13 | 14 | includedirs { 15 | ".", 16 | "../../.." 17 | } 18 | files { 19 | "**.cpp", 20 | "**.h" 21 | } 22 | 23 | end 24 | -------------------------------------------------------------------------------- /include/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-06-08 5 | // Updated : 2008-06-08 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/std_based_type.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /include/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-05-10 5 | // Updated : 2007-05-10 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/number_precision.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/premake4.lua: -------------------------------------------------------------------------------- 1 | 2 | hasCL = findOpenCL_AMD() 3 | 4 | if (hasCL) then 5 | 6 | project "BulletSoftBodySolvers_OpenCL_AMD" 7 | 8 | defines { "USE_AMD_OPENCL","CL_PLATFORM_AMD"} 9 | 10 | initOpenCL_AMD() 11 | 12 | kind "StaticLib" 13 | 14 | targetdir "../../../../../lib" 15 | 16 | includedirs { 17 | ".", 18 | "../../../..", 19 | "../../../../../Glut" 20 | } 21 | files { 22 | "../btSoftBodySolver_OpenCL.cpp", 23 | "../btSoftBodySolver_OpenCLSIMDAware.cpp", 24 | "../btSoftBodySolverOutputCLtoGL.cpp" 25 | } 26 | 27 | end 28 | -------------------------------------------------------------------------------- /include/glm/gtx/unsigned_int.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-24 5 | // Updated : 2008-10-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/unsigned_int.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | }//namespace glm 14 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/premake4.lua: -------------------------------------------------------------------------------- 1 | 2 | hasCL = findOpenCL_Intel() 3 | 4 | if (hasCL) then 5 | 6 | project "BulletSoftBodySolvers_OpenCL_Intel" 7 | 8 | defines { "USE_INTEL_OPENCL","CL_PLATFORM_INTEL"} 9 | 10 | initOpenCL_Intel() 11 | 12 | kind "StaticLib" 13 | 14 | targetdir "../../../../../lib" 15 | 16 | includedirs { 17 | ".", 18 | "../../../..", 19 | "../../../../../Glut" 20 | } 21 | files { 22 | "../btSoftBodySolver_OpenCL.cpp", 23 | "../btSoftBodySolver_OpenCLSIMDAware.cpp", 24 | "../btSoftBodySolverOutputCLtoGL.cpp" 25 | } 26 | 27 | end 28 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia/premake4.lua: -------------------------------------------------------------------------------- 1 | 2 | hasCL = findOpenCL_NVIDIA() 3 | 4 | if (hasCL) then 5 | 6 | project "BulletSoftBodySolvers_OpenCL_NVIDIA" 7 | 8 | defines { "USE_NVIDIA_OPENCL","CL_PLATFORM_NVIDIA"} 9 | 10 | initOpenCL_NVIDIA() 11 | 12 | kind "StaticLib" 13 | 14 | targetdir "../../../../../lib" 15 | 16 | includedirs { 17 | ".", 18 | "../../../..", 19 | "../../../../../Glut" 20 | } 21 | files { 22 | "../btSoftBodySolver_OpenCL.cpp", 23 | "../btSoftBodySolver_OpenCLSIMDAware.cpp", 24 | "../btSoftBodySolverOutputCLtoGL.cpp" 25 | } 26 | 27 | end 28 | -------------------------------------------------------------------------------- /include/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-11-19 5 | // Updated : 2008-11-19 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/raw_data.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | // Dependency: 10 | // - GLM core 11 | /////////////////////////////////////////////////////////////////////////////////////////////////// 12 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/UpdateFixedVertexPositions.cl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | __kernel void 4 | UpdateFixedVertexPositions( 5 | const uint numNodes, 6 | __global int * g_anchorIndex, 7 | __global float4 * g_vertexPositions, 8 | __global float4 * g_anchorPositions GUID_ARG) 9 | { 10 | unsigned int nodeID = get_global_id(0); 11 | 12 | if( nodeID < numNodes ) 13 | { 14 | int anchorIndex = g_anchorIndex[nodeID]; 15 | float4 position = g_vertexPositions[nodeID]; 16 | 17 | if ( anchorIndex >= 0 ) 18 | { 19 | float4 anchorPosition = g_anchorPositions[anchorIndex]; 20 | g_vertexPositions[nodeID] = anchorPosition; 21 | } 22 | } 23 | } 24 | 25 | ); 26 | -------------------------------------------------------------------------------- /include/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-03-06 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/perpendicular.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER vecType perp 14 | ( 15 | vecType const & x, 16 | vecType const & Normal 17 | ) 18 | { 19 | return x - proj(x, Normal); 20 | } 21 | }//namespace glm 22 | -------------------------------------------------------------------------------- /include/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-03-06 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/projection.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER vecType proj 14 | ( 15 | vecType const & x, 16 | vecType const & Normal 17 | ) 18 | { 19 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 20 | } 21 | }//namespace glm 22 | -------------------------------------------------------------------------------- /include/glm/gtx/int_10_10_10_2.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-07-07 5 | // Updated : 2010-07-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/int_10_10_10_2.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | GLM_FUNC_QUALIFIER dword uint10_10_10_2_cast 13 | ( 14 | glm::vec4 const & v 15 | ) 16 | { 17 | return dword(uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30); 18 | } 19 | }//namespace glm 20 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/UpdatePositionsFromVelocities.cl: -------------------------------------------------------------------------------- 1 | 2 | MSTRINGIFY( 3 | 4 | 5 | 6 | 7 | __kernel void 8 | UpdatePositionsFromVelocitiesKernel( 9 | const int numNodes, 10 | const float solverSDT, 11 | __global float4 * g_vertexVelocities, 12 | __global float4 * g_vertexPreviousPositions, 13 | __global float4 * g_vertexCurrentPosition GUID_ARG) 14 | { 15 | int vertexID = get_global_id(0); 16 | if( vertexID < numNodes ) 17 | { 18 | float4 previousPosition = g_vertexPreviousPositions[vertexID]; 19 | float4 velocity = g_vertexVelocities[vertexID]; 20 | 21 | float4 newPosition = previousPosition + velocity*solverSDT; 22 | 23 | g_vertexCurrentPosition[vertexID] = newPosition; 24 | g_vertexPreviousPositions[vertexID] = newPosition; 25 | } 26 | } 27 | 28 | ); -------------------------------------------------------------------------------- /include/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2011-06-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/normal.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tvec3 triangleNormal 14 | ( 15 | detail::tvec3 const & p1, 16 | detail::tvec3 const & p2, 17 | detail::tvec3 const & p3 18 | ) 19 | { 20 | return normalize(cross(p1 - p2, p1 - p3)); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /include/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-10-24 5 | // Updated : 2008-10-24 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/log_base.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER genType log( 14 | genType const & x, 15 | genType const & base) 16 | { 17 | assert(x != genType(0)); 18 | 19 | return glm::log(x) / glm::log(base); 20 | } 21 | 22 | VECTORIZE_VEC_SCA(log) 23 | VECTORIZE_VEC_VEC(log) 24 | }//namespace glm 25 | -------------------------------------------------------------------------------- /include/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-04-03 5 | // Updated : 2008-09-17 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/mixed_product.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER valType mixedProduct 14 | ( 15 | detail::tvec3 const & v1, 16 | detail::tvec3 const & v2, 17 | detail::tvec3 const & v3 18 | ) 19 | { 20 | return dot(cross(v1, v2), v3); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /include/win32/bullet/vectormath/vmInclude.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __VM_INCLUDE_H 3 | #define __VM_INCLUDE_H 4 | 5 | #include "LinearMath/btScalar.h" 6 | 7 | #if defined (USE_SYSTEM_VECTORMATH) || defined (__CELLOS_LV2__) 8 | #include 9 | #else //(USE_SYSTEM_VECTORMATH) 10 | #if defined (BT_USE_SSE) 11 | #include "sse/vectormath_aos.h" 12 | #else //all other platforms 13 | #if defined (BT_USE_NEON) 14 | #include "neon/vectormath_aos.h" 15 | #else 16 | #include "scalar/vectormath_aos.h" 17 | #endif 18 | #endif //(BT_USE_SSE) && defined (_WIN32) 19 | #endif //(USE_SYSTEM_VECTORMATH) 20 | 21 | 22 | 23 | typedef Vectormath::Aos::Vector3 vmVector3; 24 | typedef Vectormath::Aos::Quat vmQuat; 25 | typedef Vectormath::Aos::Matrix3 vmMatrix3; 26 | typedef Vectormath::Aos::Transform3 vmTransform3; 27 | typedef Vectormath::Aos::Point3 vmPoint3; 28 | 29 | #endif //__VM_INCLUDE_H 30 | 31 | 32 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btBroadphaseProxy.h" 17 | 18 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Mathias Kaerlev 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/Integrate.cl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | // Node indices for each link 4 | 5 | 6 | 7 | __kernel void 8 | IntegrateKernel( 9 | const int numNodes, 10 | const float solverdt, 11 | __global float * g_vertexInverseMasses, 12 | __global float4 * g_vertexPositions, 13 | __global float4 * g_vertexVelocity, 14 | __global float4 * g_vertexPreviousPositions, 15 | __global float4 * g_vertexForceAccumulator GUID_ARG) 16 | { 17 | int nodeID = get_global_id(0); 18 | if( nodeID < numNodes ) 19 | { 20 | float4 position = g_vertexPositions[nodeID]; 21 | float4 velocity = g_vertexVelocity[nodeID]; 22 | float4 force = g_vertexForceAccumulator[nodeID]; 23 | float inverseMass = g_vertexInverseMasses[nodeID]; 24 | 25 | g_vertexPreviousPositions[nodeID] = position; 26 | velocity += force * inverseMass * solverdt; 27 | position += velocity * solverdt; 28 | 29 | g_vertexForceAccumulator[nodeID] = (float4)(0.f, 0.f, 0.f, 0.0f); 30 | g_vertexPositions[nodeID] = position; 31 | g_vertexVelocity[nodeID] = velocity; 32 | } 33 | } 34 | 35 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btConvexCast.h" 17 | 18 | btConvexCast::~btConvexCast() 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/UpdatePositionsFromVelocities.hlsl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | cbuffer UpdatePositionsFromVelocitiesCB : register( b0 ) 4 | { 5 | int numNodes; 6 | float solverSDT; 7 | int padding1; 8 | int padding2; 9 | }; 10 | 11 | 12 | StructuredBuffer g_vertexVelocities : register( t0 ); 13 | 14 | RWStructuredBuffer g_vertexPreviousPositions : register( u0 ); 15 | RWStructuredBuffer g_vertexCurrentPosition : register( u1 ); 16 | 17 | 18 | [numthreads(128, 1, 1)] 19 | void 20 | UpdatePositionsFromVelocitiesKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 21 | { 22 | int vertexID = DTid.x; 23 | if( vertexID < numNodes ) 24 | { 25 | float3 previousPosition = g_vertexPreviousPositions[vertexID].xyz; 26 | float3 velocity = g_vertexVelocities[vertexID].xyz; 27 | 28 | float3 newPosition = previousPosition + velocity*solverSDT; 29 | 30 | g_vertexCurrentPosition[vertexID] = float4(newPosition, 0.f); 31 | g_vertexPreviousPositions[vertexID] = float4(newPosition, 0.f); 32 | } 33 | } 34 | 35 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/BroadphaseCollision/btDispatcher.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btDispatcher.h" 17 | 18 | btDispatcher::~btDispatcher() 19 | { 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/btThreadSupportInterface.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2007 Erwin Coumans http://bulletphysics.com 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btThreadSupportInterface.h" 17 | 18 | btThreadSupportInterface::~btThreadSupportInterface() 19 | { 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /include/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-02-19 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/handed_coordinate_space.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER bool rightHanded 14 | ( 15 | detail::tvec3 const & tangent, 16 | detail::tvec3 const & binormal, 17 | detail::tvec3 const & normal 18 | ) 19 | { 20 | return dot(cross(normal, tangent), binormal) > T(0); 21 | } 22 | 23 | template 24 | GLM_FUNC_QUALIFIER bool leftHanded 25 | ( 26 | detail::tvec3 const & tangent, 27 | detail::tvec3 const & binormal, 28 | detail::tvec3 const & normal 29 | ) 30 | { 31 | return dot(cross(normal, tangent), binormal) < T(0); 32 | } 33 | }//namespace glm 34 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/PrepareLinks.cl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | 4 | 5 | __kernel void 6 | PrepareLinksKernel( 7 | const int numLinks, 8 | __global int2 * g_linksVertexIndices, 9 | __global float * g_linksMassLSC, 10 | __global float4 * g_nodesPreviousPosition, 11 | __global float * g_linksLengthRatio, 12 | __global float4 * g_linksCurrentLength GUID_ARG) 13 | { 14 | int linkID = get_global_id(0); 15 | if( linkID < numLinks ) 16 | { 17 | 18 | int2 nodeIndices = g_linksVertexIndices[linkID]; 19 | int node0 = nodeIndices.x; 20 | int node1 = nodeIndices.y; 21 | 22 | float4 nodePreviousPosition0 = g_nodesPreviousPosition[node0]; 23 | float4 nodePreviousPosition1 = g_nodesPreviousPosition[node1]; 24 | 25 | float massLSC = g_linksMassLSC[linkID]; 26 | 27 | float4 linkCurrentLength = nodePreviousPosition1 - nodePreviousPosition0; 28 | linkCurrentLength.w = 0.f; 29 | 30 | float linkLengthRatio = dot(linkCurrentLength, linkCurrentLength)*massLSC; 31 | linkLengthRatio = 1.0f/linkLengthRatio; 32 | 33 | g_linksCurrentLength[linkID] = linkCurrentLength; 34 | g_linksLengthRatio[linkID] = linkLengthRatio; 35 | } 36 | } 37 | 38 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/UpdatePositions.cl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | __kernel void 4 | updateVelocitiesFromPositionsWithoutVelocitiesKernel( 5 | const int numNodes, 6 | const float isolverdt, 7 | __global float4 * g_vertexPositions, 8 | __global float4 * g_vertexPreviousPositions, 9 | __global int * g_vertexClothIndices, 10 | __global float * g_clothDampingFactor, 11 | __global float4 * g_vertexVelocities, 12 | __global float4 * g_vertexForces GUID_ARG) 13 | 14 | { 15 | int nodeID = get_global_id(0); 16 | if( nodeID < numNodes ) 17 | { 18 | float4 position = g_vertexPositions[nodeID]; 19 | float4 previousPosition = g_vertexPreviousPositions[nodeID]; 20 | float4 velocity = g_vertexVelocities[nodeID]; 21 | int clothIndex = g_vertexClothIndices[nodeID]; 22 | float dampingFactor = g_clothDampingFactor[clothIndex]; 23 | float velocityCoefficient = (1.f - dampingFactor); 24 | 25 | float4 difference = position - previousPosition; 26 | 27 | velocity = difference*velocityCoefficient*isolverdt; 28 | 29 | g_vertexVelocities[nodeID] = velocity; 30 | g_vertexForces[nodeID] = (float4)(0.f, 0.f, 0.f, 0.f); 31 | } 32 | } 33 | 34 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletDynamics/Vehicle/btVehicleRaycaster.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Erwin Coumans http://bulletphysics.org 3 | * 4 | * Permission to use, copy, modify, distribute and sell this software 5 | * and its documentation for any purpose is hereby granted without fee, 6 | * provided that the above copyright notice appear in all copies. 7 | * Erwin Coumans makes no representations about the suitability 8 | * of this software for any purpose. 9 | * It is provided "as is" without express or implied warranty. 10 | */ 11 | #ifndef BT_VEHICLE_RAYCASTER_H 12 | #define BT_VEHICLE_RAYCASTER_H 13 | 14 | #include "LinearMath/btVector3.h" 15 | 16 | /// btVehicleRaycaster is provides interface for between vehicle simulation and raycasting 17 | struct btVehicleRaycaster 18 | { 19 | virtual ~btVehicleRaycaster() 20 | { 21 | } 22 | struct btVehicleRaycasterResult 23 | { 24 | btVehicleRaycasterResult() :m_distFraction(btScalar(-1.)){}; 25 | btVector3 m_hitPointInWorld; 26 | btVector3 m_hitNormalInWorld; 27 | btScalar m_distFraction; 28 | }; 29 | 30 | virtual void* castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) = 0; 31 | 32 | }; 33 | 34 | #endif //BT_VEHICLE_RAYCASTER_H 35 | 36 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btConcaveShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | 17 | #include "btConcaveShape.h" 18 | 19 | btConcaveShape::btConcaveShape() : m_collisionMargin(btScalar(0.)) 20 | { 21 | 22 | } 23 | 24 | btConcaveShape::~btConcaveShape() 25 | { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btTriangleCallback.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btTriangleCallback.h" 17 | 18 | btTriangleCallback::~btTriangleCallback() 19 | { 20 | 21 | } 22 | 23 | 24 | btInternalTriangleIndexCallback::~btInternalTriangleIndexCallback() 25 | { 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/include_gl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013 Mathias Kaerlev 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef VOXIE_INCLUDE_GL_H 24 | #define VOXIE_INCLUDE_GL_H 25 | 26 | #include 27 | 28 | #endif // VOXIE_INCLUDE_GL_H 29 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btCollisionAlgorithm.h" 17 | #include "btDispatcher.h" 18 | 19 | btCollisionAlgorithm::btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci) 20 | { 21 | m_dispatcher = ci.m_dispatcher1; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tools/mesher.pyx: -------------------------------------------------------------------------------- 1 | # distutils: language = c++ 2 | 3 | from libcpp.vector cimport vector 4 | 5 | cdef extern from "mesher_c.cpp": 6 | cdef struct Vertex: 7 | int x, y, z 8 | int nx, ny, nz 9 | 10 | cdef cppclass MesherModel: 11 | MesherModel() 12 | void init(char * data, int x, int y, int z) 13 | 14 | cdef cppclass Mesher: 15 | void build_vertices(MesherModel * model, unsigned char p) 16 | vector[Vertex] vertices 17 | vector[int] indices 18 | 19 | def mesh(in_model): 20 | cdef Mesher mesher 21 | cdef MesherModel model 22 | model.init(in_model.data, in_model.x_size, in_model.y_size, 23 | in_model.z_size) 24 | cdef set colors = set(in_model.blocks.values()) 25 | 26 | cdef unsigned char v 27 | 28 | cdef dict sets = {} 29 | cdef Vertex * vertex 30 | cdef unsigned int i 31 | 32 | cdef list points 33 | 34 | for v in colors: 35 | points = [] 36 | mesher.build_vertices(&model, v) 37 | for i in range(mesher.indices.size()): 38 | vertex = &mesher.vertices[mesher.indices[i]] 39 | points.append((vertex.x, vertex.y, vertex.z, 40 | vertex.nx, vertex.ny, vertex.nz)) 41 | sets[v] = points 42 | return sets 43 | -------------------------------------------------------------------------------- /include/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-21 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/orthonormalize.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tmat3x3 orthonormalize 14 | ( 15 | const detail::tmat3x3& m 16 | ) 17 | { 18 | detail::tmat3x3 r = m; 19 | 20 | r[0] = normalize(r[0]); 21 | 22 | float d0 = dot(r[0], r[1]); 23 | r[1] -= r[0] * d0; 24 | r[1] = normalize(r[1]); 25 | 26 | float d1 = dot(r[1], r[2]); 27 | d0 = dot(r[0], r[2]); 28 | r[2] -= r[0] * d0 + r[1] * d1; 29 | r[2] = normalize(r[2]); 30 | 31 | return r; 32 | } 33 | 34 | template 35 | GLM_FUNC_QUALIFIER detail::tvec3 orthonormalize 36 | ( 37 | const detail::tvec3& x, 38 | const detail::tvec3& y 39 | ) 40 | { 41 | return normalize(x - y * dot(y, x)); 42 | } 43 | }//namespace glm 44 | -------------------------------------------------------------------------------- /include/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-21 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/matrix_cross_product.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tmat3x3 matrixCross3 14 | ( 15 | detail::tvec3 const & x 16 | ) 17 | { 18 | detail::tmat3x3 Result(T(0)); 19 | Result[0][1] = x.z; 20 | Result[1][0] = -x.z; 21 | Result[0][2] = -x.y; 22 | Result[2][0] = x.y; 23 | Result[1][2] = x.x; 24 | Result[2][1] = -x.x; 25 | return Result; 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER detail::tmat4x4 matrixCross4 30 | ( 31 | detail::tvec3 const & x 32 | ) 33 | { 34 | detail::tmat4x4 Result(T(0)); 35 | Result[0][1] = x.z; 36 | Result[1][0] = -x.z; 37 | Result[0][2] = -x.y; 38 | Result[2][0] = x.y; 39 | Result[1][2] = x.x; 40 | Result[2][1] = -x.x; 41 | return Result; 42 | } 43 | 44 | }//namespace glm 45 | -------------------------------------------------------------------------------- /include/glm/gtx/vector_access.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2006-01-16 5 | // Updated : 2008-10-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/vector_access.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER void set 14 | ( 15 | detail::tvec2& v, 16 | valType const & x, 17 | valType const & y 18 | ) 19 | { 20 | v.x = x; 21 | v.y = y; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER void set 26 | ( 27 | detail::tvec3& v, 28 | valType const & x, 29 | valType const & y, 30 | valType const & z 31 | ) 32 | { 33 | v.x = x; 34 | v.y = y; 35 | v.z = z; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER void set 40 | ( 41 | detail::tvec4& v, 42 | valType const & x, 43 | valType const & y, 44 | valType const & z, 45 | valType const & w 46 | ) 47 | { 48 | v.x = x; 49 | v.y = y; 50 | v.z = z; 51 | v.w = w; 52 | } 53 | }//namespace glm 54 | -------------------------------------------------------------------------------- /include/glm/gtx/closest_point.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-30 5 | // Updated : 2008-10-05 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/closest_point.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef glm_gtx_closest_point 11 | #define glm_gtx_closest_point 12 | 13 | namespace glm 14 | { 15 | template 16 | GLM_FUNC_QUALIFIER detail::tvec3 closestPointOnLine 17 | ( 18 | detail::tvec3 const & point, 19 | detail::tvec3 const & a, 20 | detail::tvec3 const & b 21 | ) 22 | { 23 | valType LineLength = distance(a, b); 24 | detail::tvec3 Vector = point - a; 25 | detail::tvec3 LineDirection = (b - a) / LineLength; 26 | 27 | // Project Vector to LineDirection to get the distance of point from a 28 | valType Distance = dot(Vector, LineDirection); 29 | 30 | if(Distance <= valType(0)) return a; 31 | if(Distance >= LineLength) return b; 32 | return a + LineDirection * Distance; 33 | } 34 | }//namespace glm 35 | 36 | #endif//glm_gtx_closest_point 37 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/UpdateNodes.cl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | 4 | __kernel void 5 | updateVelocitiesFromPositionsWithVelocitiesKernel( 6 | int numNodes, 7 | float isolverdt, 8 | __global float4 * g_vertexPositions, 9 | __global float4 * g_vertexPreviousPositions, 10 | __global int * g_vertexClothIndices, 11 | __global float *g_clothVelocityCorrectionCoefficients, 12 | __global float * g_clothDampingFactor, 13 | __global float4 * g_vertexVelocities, 14 | __global float4 * g_vertexForces GUID_ARG) 15 | { 16 | int nodeID = get_global_id(0); 17 | if( nodeID < numNodes ) 18 | { 19 | float4 position = g_vertexPositions[nodeID]; 20 | float4 previousPosition = g_vertexPreviousPositions[nodeID]; 21 | float4 velocity = g_vertexVelocities[nodeID]; 22 | int clothIndex = g_vertexClothIndices[nodeID]; 23 | float velocityCorrectionCoefficient = g_clothVelocityCorrectionCoefficients[clothIndex]; 24 | float dampingFactor = g_clothDampingFactor[clothIndex]; 25 | float velocityCoefficient = (1.f - dampingFactor); 26 | 27 | float4 difference = position - previousPosition; 28 | 29 | velocity += difference*velocityCorrectionCoefficient*isolverdt; 30 | 31 | // Damp the velocity 32 | velocity *= velocityCoefficient; 33 | 34 | g_vertexVelocities[nodeID] = velocity; 35 | g_vertexForces[nodeID] = (float4)(0.f, 0.f, 0.f, 0.f); 36 | } 37 | } 38 | 39 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/Integrate.hlsl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | cbuffer IntegrateCB : register( b0 ) 4 | { 5 | int numNodes; 6 | float solverdt; 7 | int padding1; 8 | int padding2; 9 | }; 10 | 11 | // Node indices for each link 12 | StructuredBuffer g_vertexInverseMasses : register( t0 ); 13 | 14 | RWStructuredBuffer g_vertexPositions : register( u0 ); 15 | RWStructuredBuffer g_vertexVelocity : register( u1 ); 16 | RWStructuredBuffer g_vertexPreviousPositions : register( u2 ); 17 | RWStructuredBuffer g_vertexForceAccumulator : register( u3 ); 18 | 19 | [numthreads(128, 1, 1)] 20 | void 21 | IntegrateKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 22 | { 23 | int nodeID = DTid.x; 24 | if( nodeID < numNodes ) 25 | { 26 | float3 position = g_vertexPositions[nodeID].xyz; 27 | float3 velocity = g_vertexVelocity[nodeID].xyz; 28 | float3 force = g_vertexForceAccumulator[nodeID].xyz; 29 | float inverseMass = g_vertexInverseMasses[nodeID]; 30 | 31 | g_vertexPreviousPositions[nodeID] = float4(position, 0.f); 32 | velocity += force * inverseMass * solverdt; 33 | position += velocity * solverdt; 34 | 35 | g_vertexForceAccumulator[nodeID] = float4(0.f, 0.f, 0.f, 0.0f); 36 | g_vertexPositions[nodeID] = float4(position, 0.f); 37 | g_vertexVelocity[nodeID] = float4(velocity, 0.f); 38 | } 39 | } 40 | 41 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/UpdateConstants.cl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | /*#define float3 float4 4 | 5 | float dot3(float3 a, float3 b) 6 | { 7 | return a.x*b.x + a.y*b.y + a.z*b.z; 8 | }*/ 9 | 10 | __kernel void 11 | UpdateConstantsKernel( 12 | const int numLinks, 13 | __global int2 * g_linksVertexIndices, 14 | __global float4 * g_vertexPositions, 15 | __global float * g_vertexInverseMasses, 16 | __global float * g_linksMaterialLSC, 17 | __global float * g_linksMassLSC, 18 | __global float * g_linksRestLengthSquared, 19 | __global float * g_linksRestLengths) 20 | { 21 | int linkID = get_global_id(0); 22 | if( linkID < numLinks ) 23 | { 24 | int2 nodeIndices = g_linksVertexIndices[linkID]; 25 | int node0 = nodeIndices.x; 26 | int node1 = nodeIndices.y; 27 | float linearStiffnessCoefficient = g_linksMaterialLSC[ linkID ]; 28 | 29 | float3 position0 = g_vertexPositions[node0].xyz; 30 | float3 position1 = g_vertexPositions[node1].xyz; 31 | float inverseMass0 = g_vertexInverseMasses[node0]; 32 | float inverseMass1 = g_vertexInverseMasses[node1]; 33 | 34 | float3 difference = position0 - position1; 35 | float length2 = dot(difference, difference); 36 | float length = sqrt(length2); 37 | 38 | g_linksRestLengths[linkID] = length; 39 | g_linksMassLSC[linkID] = (inverseMass0 + inverseMass1)/linearStiffnessCoefficient; 40 | g_linksRestLengthSquared[linkID] = length*length; 41 | } 42 | } 43 | 44 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btTriangleBuffer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btTriangleBuffer.h" 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | void btTriangleBuffer::processTriangle(btVector3* triangle,int partId,int triangleIndex) 25 | { 26 | btTriangle tri; 27 | tri.m_vertex0 = triangle[0]; 28 | tri.m_vertex1 = triangle[1]; 29 | tri.m_vertex2 = triangle[2]; 30 | tri.m_partId = partId; 31 | tri.m_triangleIndex = triangleIndex; 32 | 33 | m_triangleBuffer.push_back(tri); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /include/win32/bullet/LinearMath/btDefaultMotionState.h: -------------------------------------------------------------------------------- 1 | #ifndef BT_DEFAULT_MOTION_STATE_H 2 | #define BT_DEFAULT_MOTION_STATE_H 3 | 4 | #include "btMotionState.h" 5 | 6 | ///The btDefaultMotionState provides a common implementation to synchronize world transforms with offsets. 7 | ATTRIBUTE_ALIGNED16(struct) btDefaultMotionState : public btMotionState 8 | { 9 | btTransform m_graphicsWorldTrans; 10 | btTransform m_centerOfMassOffset; 11 | btTransform m_startWorldTrans; 12 | void* m_userPointer; 13 | 14 | BT_DECLARE_ALIGNED_ALLOCATOR(); 15 | 16 | btDefaultMotionState(const btTransform& startTrans = btTransform::getIdentity(),const btTransform& centerOfMassOffset = btTransform::getIdentity()) 17 | : m_graphicsWorldTrans(startTrans), 18 | m_centerOfMassOffset(centerOfMassOffset), 19 | m_startWorldTrans(startTrans), 20 | m_userPointer(0) 21 | 22 | { 23 | } 24 | 25 | ///synchronizes world transform from user to physics 26 | virtual void getWorldTransform(btTransform& centerOfMassWorldTrans ) const 27 | { 28 | centerOfMassWorldTrans = m_centerOfMassOffset.inverse() * m_graphicsWorldTrans ; 29 | } 30 | 31 | ///synchronizes world transform from physics to user 32 | ///Bullet only calls the update of worldtransform for active objects 33 | virtual void setWorldTransform(const btTransform& centerOfMassWorldTrans) 34 | { 35 | m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset ; 36 | } 37 | 38 | 39 | 40 | }; 41 | 42 | #endif //BT_DEFAULT_MOTION_STATE_H 43 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/PrepareLinks.hlsl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | cbuffer PrepareLinksCB : register( b0 ) 4 | { 5 | int numLinks; 6 | int padding0; 7 | int padding1; 8 | int padding2; 9 | }; 10 | 11 | // Node indices for each link 12 | StructuredBuffer g_linksVertexIndices : register( t0 ); 13 | StructuredBuffer g_linksMassLSC : register( t1 ); 14 | StructuredBuffer g_nodesPreviousPosition : register( t2 ); 15 | 16 | RWStructuredBuffer g_linksLengthRatio : register( u0 ); 17 | RWStructuredBuffer g_linksCurrentLength : register( u1 ); 18 | 19 | [numthreads(128, 1, 1)] 20 | void 21 | PrepareLinksKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 22 | { 23 | int linkID = DTid.x; 24 | if( linkID < numLinks ) 25 | { 26 | int2 nodeIndices = g_linksVertexIndices[linkID]; 27 | int node0 = nodeIndices.x; 28 | int node1 = nodeIndices.y; 29 | 30 | float4 nodePreviousPosition0 = g_nodesPreviousPosition[node0]; 31 | float4 nodePreviousPosition1 = g_nodesPreviousPosition[node1]; 32 | 33 | float massLSC = g_linksMassLSC[linkID]; 34 | 35 | float4 linkCurrentLength = nodePreviousPosition1 - nodePreviousPosition0; 36 | 37 | float linkLengthRatio = dot(linkCurrentLength, linkCurrentLength)*massLSC; 38 | linkLengthRatio = 1./linkLengthRatio; 39 | 40 | g_linksCurrentLength[linkID] = linkCurrentLength; 41 | g_linksLengthRatio[linkID] = linkLengthRatio; 42 | } 43 | } 44 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btCollisionMargin.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_COLLISION_MARGIN_H 17 | #define BT_COLLISION_MARGIN_H 18 | 19 | ///The CONVEX_DISTANCE_MARGIN is a default collision margin for convex collision shapes derived from btConvexInternalShape. 20 | ///This collision margin is used by Gjk and some other algorithms 21 | ///Note that when creating small objects, you need to make sure to set a smaller collision margin, using the 'setMargin' API 22 | #define CONVEX_DISTANCE_MARGIN btScalar(0.04)// btScalar(0.1)//;//btScalar(0.01) 23 | 24 | 25 | 26 | #endif //BT_COLLISION_MARGIN_H 27 | 28 | -------------------------------------------------------------------------------- /include/glm/core/type_mat.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_mat.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/glm/core/type_vec.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_vec.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/glm/gtx/reciprocal.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_reciprocal extension is deprecated, include GLM_GTC_reciprocal instead") 26 | #endif 27 | -------------------------------------------------------------------------------- /include/glm/gtx/unsigned_int.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_unsigned_int extension is deprecated, include GLM_GTX_integer instead") 26 | #endif 27 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btMaterial.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | /// This file was created by Alex Silverman 17 | 18 | #ifndef BT_MATERIAL_H 19 | #define BT_MATERIAL_H 20 | 21 | // Material class to be used by btMultimaterialTriangleMeshShape to store triangle properties 22 | class btMaterial 23 | { 24 | // public members so that materials can change due to world events 25 | public: 26 | btScalar m_friction; 27 | btScalar m_restitution; 28 | int pad[2]; 29 | 30 | btMaterial(){} 31 | btMaterial(btScalar fric, btScalar rest) { m_friction = fric; m_restitution = rest; } 32 | }; 33 | 34 | #endif // BT_MATERIAL_H 35 | 36 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/VSolveLinks.cl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | __kernel void 4 | VSolveLinksKernel( 5 | int startLink, 6 | int numLinks, 7 | float kst, 8 | __global int2 * g_linksVertexIndices, 9 | __global float * g_linksLengthRatio, 10 | __global float4 * g_linksCurrentLength, 11 | __global float * g_vertexInverseMass, 12 | __global float4 * g_vertexVelocity GUID_ARG) 13 | { 14 | int linkID = get_global_id(0) + startLink; 15 | if( get_global_id(0) < numLinks ) 16 | { 17 | int2 nodeIndices = g_linksVertexIndices[linkID]; 18 | int node0 = nodeIndices.x; 19 | int node1 = nodeIndices.y; 20 | 21 | float linkLengthRatio = g_linksLengthRatio[linkID]; 22 | float3 linkCurrentLength = g_linksCurrentLength[linkID].xyz; 23 | 24 | float3 vertexVelocity0 = g_vertexVelocity[node0].xyz; 25 | float3 vertexVelocity1 = g_vertexVelocity[node1].xyz; 26 | 27 | float vertexInverseMass0 = g_vertexInverseMass[node0]; 28 | float vertexInverseMass1 = g_vertexInverseMass[node1]; 29 | 30 | float3 nodeDifference = vertexVelocity0 - vertexVelocity1; 31 | float dotResult = dot(linkCurrentLength, nodeDifference); 32 | float j = -dotResult*linkLengthRatio*kst; 33 | 34 | float3 velocityChange0 = linkCurrentLength*(j*vertexInverseMass0); 35 | float3 velocityChange1 = linkCurrentLength*(j*vertexInverseMass1); 36 | 37 | vertexVelocity0 += velocityChange0; 38 | vertexVelocity1 -= velocityChange1; 39 | 40 | g_vertexVelocity[node0] = (float4)(vertexVelocity0, 0.f); 41 | g_vertexVelocity[node1] = (float4)(vertexVelocity1, 0.f); 42 | } 43 | } 44 | 45 | ); -------------------------------------------------------------------------------- /include/glm/core/intrinsic_exponential.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_exponential.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/UpdatePositions.hlsl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | cbuffer UpdateVelocitiesFromPositionsWithoutVelocitiesCB : register( b0 ) 4 | { 5 | int numNodes; 6 | float isolverdt; 7 | int padding1; 8 | int padding2; 9 | }; 10 | 11 | 12 | StructuredBuffer g_vertexPositions : register( t0 ); 13 | StructuredBuffer g_vertexPreviousPositions : register( t1 ); 14 | StructuredBuffer g_vertexClothIndices : register( t2 ); 15 | StructuredBuffer g_clothDampingFactor : register( t3 ); 16 | 17 | RWStructuredBuffer g_vertexVelocities : register( u0 ); 18 | RWStructuredBuffer g_vertexForces : register( u1 ); 19 | 20 | 21 | [numthreads(128, 1, 1)] 22 | void 23 | updateVelocitiesFromPositionsWithoutVelocitiesKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 24 | { 25 | int nodeID = DTid.x; 26 | if( nodeID < numNodes ) 27 | { 28 | float3 position = g_vertexPositions[nodeID].xyz; 29 | float3 previousPosition = g_vertexPreviousPositions[nodeID].xyz; 30 | float3 velocity = g_vertexVelocities[nodeID].xyz; 31 | int clothIndex = g_vertexClothIndices[nodeID]; 32 | float dampingFactor = g_clothDampingFactor[clothIndex]; 33 | float velocityCoefficient = (1.f - dampingFactor); 34 | 35 | float3 difference = position - previousPosition; 36 | 37 | velocity = difference*velocityCoefficient*isolverdt; 38 | 39 | g_vertexVelocities[nodeID] = float4(velocity, 0.f); 40 | g_vertexForces[nodeID] = float4(0.f, 0.f, 0.f, 0.f); 41 | } 42 | } 43 | 44 | ); -------------------------------------------------------------------------------- /include/glm/core/intrinsic_trigonometric.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_trigonometric.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btEmptyCollisionAlgorithm.h" 17 | 18 | 19 | 20 | btEmptyAlgorithm::btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& ci) 21 | : btCollisionAlgorithm(ci) 22 | { 23 | } 24 | 25 | void btEmptyAlgorithm::processCollision (const btCollisionObjectWrapper* ,const btCollisionObjectWrapper* ,const btDispatcherInfo& ,btManifoldResult* ) 26 | { 27 | } 28 | 29 | btScalar btEmptyAlgorithm::calculateTimeOfImpact(btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* ) 30 | { 31 | return btScalar(1.); 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/PpuAddressSpace.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2010 Erwin Coumans http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | 17 | #ifndef BT_PPU_ADDRESS_SPACE_H 18 | #define BT_PPU_ADDRESS_SPACE_H 19 | 20 | 21 | #ifdef _WIN32 22 | //stop those casting warnings until we have a better solution for ppu_address_t / void* / uint64 conversions 23 | #pragma warning (disable: 4311) 24 | #pragma warning (disable: 4312) 25 | #endif //_WIN32 26 | 27 | 28 | #if defined(_WIN64) 29 | typedef unsigned __int64 ppu_address_t; 30 | #elif defined(__LP64__) || defined(__x86_64__) 31 | typedef uint64_t ppu_address_t; 32 | #else 33 | typedef uint32_t ppu_address_t; 34 | #endif //defined(_WIN64) 35 | 36 | #endif //BT_PPU_ADDRESS_SPACE_H 37 | 38 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/SolvePositions.cl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MSTRINGIFY( 5 | 6 | 7 | float mydot3(float4 a, float4 b) 8 | { 9 | return a.x*b.x + a.y*b.y + a.z*b.z; 10 | } 11 | 12 | 13 | __kernel void 14 | SolvePositionsFromLinksKernel( 15 | const int startLink, 16 | const int numLinks, 17 | const float kst, 18 | const float ti, 19 | __global int2 * g_linksVertexIndices, 20 | __global float * g_linksMassLSC, 21 | __global float * g_linksRestLengthSquared, 22 | __global float * g_verticesInverseMass, 23 | __global float4 * g_vertexPositions GUID_ARG) 24 | 25 | { 26 | int linkID = get_global_id(0) + startLink; 27 | if( get_global_id(0) < numLinks ) 28 | { 29 | float massLSC = g_linksMassLSC[linkID]; 30 | float restLengthSquared = g_linksRestLengthSquared[linkID]; 31 | 32 | if( massLSC > 0.0f ) 33 | { 34 | int2 nodeIndices = g_linksVertexIndices[linkID]; 35 | int node0 = nodeIndices.x; 36 | int node1 = nodeIndices.y; 37 | 38 | float4 position0 = g_vertexPositions[node0]; 39 | float4 position1 = g_vertexPositions[node1]; 40 | 41 | float inverseMass0 = g_verticesInverseMass[node0]; 42 | float inverseMass1 = g_verticesInverseMass[node1]; 43 | 44 | float4 del = position1 - position0; 45 | float len = mydot3(del, del); 46 | float k = ((restLengthSquared - len)/(massLSC*(restLengthSquared+len)))*kst; 47 | position0 = position0 - del*(k*inverseMass0); 48 | position1 = position1 + del*(k*inverseMass1); 49 | 50 | g_vertexPositions[node0] = position0; 51 | g_vertexPositions[node1] = position1; 52 | 53 | } 54 | } 55 | } 56 | 57 | ); -------------------------------------------------------------------------------- /include/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref gtc_swizzle 24 | /// @file glm/gtc/swizzle.inl 25 | /// @date 2009-06-14 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | namespace glm 30 | { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /include/glm/gtx/random.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_random extension is deprecated, include GLM_GTC_random instead") 26 | #endif 27 | 28 | // Promoted: 29 | #include "../gtc/random.hpp" 30 | -------------------------------------------------------------------------------- /include/glm/gtx/ulp.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_ulp extension is deprecated, include GLM_GTC_ulp (glm/gtc/ulp.hpp) instead") 26 | #endif 27 | 28 | // Promoted: 29 | #include "../gtc/ulp.hpp" 30 | -------------------------------------------------------------------------------- /include/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2006-01-07 5 | // Updated : 2008-10-05 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/extend.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | genType extend 14 | ( 15 | genType const & Origin, 16 | genType const & Source, 17 | genType const & Distance 18 | ) 19 | { 20 | return Origin + (Source - Origin) * Distance; 21 | } 22 | 23 | template 24 | detail::tvec2 extend 25 | ( 26 | detail::tvec2 const & Origin, 27 | detail::tvec2 const & Source, 28 | valType const & Distance 29 | ) 30 | { 31 | return Origin + (Source - Origin) * Distance; 32 | } 33 | 34 | template 35 | detail::tvec3 extend 36 | ( 37 | detail::tvec3 const & Origin, 38 | detail::tvec3 const & Source, 39 | valType const & Distance 40 | ) 41 | { 42 | return Origin + (Source - Origin) * Distance; 43 | } 44 | 45 | template 46 | detail::tvec4 extend 47 | ( 48 | detail::tvec4 const & Origin, 49 | detail::tvec4 const & Source, 50 | valType const & Distance 51 | ) 52 | { 53 | return Origin + (Source - Origin) * Distance; 54 | } 55 | }//namespace glm 56 | -------------------------------------------------------------------------------- /include/glm/gtx/noise.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_random extension is deprecated, include GLM_GTC_random (glm/gtc/noise.hpp) instead") 26 | #endif 27 | 28 | // Promoted: 29 | #include "../gtc/noise.hpp" 30 | -------------------------------------------------------------------------------- /include/win32/bullet/LinearMath/btRandom.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ 3 | 4 | This software is provided 'as-is', without any express or implied warranty. 5 | In no event will the authors be held liable for any damages arising from the use of this software. 6 | Permission is granted to anyone to use this software for any purpose, 7 | including commercial applications, and to alter it and redistribute it freely, 8 | subject to the following restrictions: 9 | 10 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 11 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 12 | 3. This notice may not be removed or altered from any source distribution. 13 | */ 14 | 15 | 16 | 17 | #ifndef BT_GEN_RANDOM_H 18 | #define BT_GEN_RANDOM_H 19 | 20 | #ifdef MT19937 21 | 22 | #include 23 | #include 24 | 25 | #define GEN_RAND_MAX UINT_MAX 26 | 27 | SIMD_FORCE_INLINE void GEN_srand(unsigned int seed) { init_genrand(seed); } 28 | SIMD_FORCE_INLINE unsigned int GEN_rand() { return genrand_int32(); } 29 | 30 | #else 31 | 32 | #include 33 | 34 | #define GEN_RAND_MAX RAND_MAX 35 | 36 | SIMD_FORCE_INLINE void GEN_srand(unsigned int seed) { srand(seed); } 37 | SIMD_FORCE_INLINE unsigned int GEN_rand() { return rand(); } 38 | 39 | #endif 40 | 41 | #endif //BT_GEN_RANDOM_H 42 | 43 | -------------------------------------------------------------------------------- /include/glm/gtx/epsilon.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_epsilon extension is deprecated, include GLM_GTC_epsilon (glm/gtc/epsilon) instead") 26 | #endif 27 | 28 | // Promoted: 29 | #include "../gtc/epsilon.hpp" 30 | -------------------------------------------------------------------------------- /include/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2009-03-06 5 | // Updated : 2009-03-09 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/gradient_paint.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | valType radialGradient 14 | ( 15 | detail::tvec2 const & Center, 16 | valType const & Radius, 17 | detail::tvec2 const & Focal, 18 | detail::tvec2 const & Position 19 | ) 20 | { 21 | detail::tvec2 F = Focal - Center; 22 | detail::tvec2 D = Position - Focal; 23 | valType Radius2 = pow2(Radius); 24 | valType Fx2 = pow2(F.x); 25 | valType Fy2 = pow2(F.y); 26 | 27 | valType Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); 28 | valType Denominator = Radius2 - (Fx2 + Fy2); 29 | return Numerator / Denominator; 30 | } 31 | 32 | template 33 | valType linearGradient 34 | ( 35 | detail::tvec2 const & Point0, 36 | detail::tvec2 const & Point1, 37 | detail::tvec2 const & Position 38 | ) 39 | { 40 | detail::tvec2 Dist = Point1 - Point0; 41 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 42 | } 43 | }//namespace glm 44 | -------------------------------------------------------------------------------- /src/run.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013 Mathias Kaerlev 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include "mainwindow.h" 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | int main(int argc, char *argv[]) 32 | { 33 | QCoreApplication::addLibraryPath("plugins"); 34 | QCoreApplication::setApplicationName("Voxie"); 35 | QGuiApplication::setApplicationDisplayName("Voxie"); 36 | QApplication::setStyle("fusion"); 37 | QApplication app(argc, argv); 38 | MainWindow window; 39 | window.show(); 40 | return app.exec(); 41 | } -------------------------------------------------------------------------------- /include/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-27 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/optimum_pow.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER genType pow2(const genType& x) 14 | { 15 | return x * x; 16 | } 17 | 18 | template 19 | GLM_FUNC_QUALIFIER genType pow3(const genType& x) 20 | { 21 | return x * x * x; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER genType pow4(const genType& x) 26 | { 27 | return x * x * x * x; 28 | } 29 | 30 | GLM_FUNC_QUALIFIER bool powOfTwo(int x) 31 | { 32 | return !(x & (x - 1)); 33 | } 34 | 35 | GLM_FUNC_QUALIFIER detail::tvec2 powOfTwo(const detail::tvec2& x) 36 | { 37 | return detail::tvec2( 38 | powOfTwo(x.x), 39 | powOfTwo(x.y)); 40 | } 41 | 42 | GLM_FUNC_QUALIFIER detail::tvec3 powOfTwo(const detail::tvec3& x) 43 | { 44 | return detail::tvec3( 45 | powOfTwo(x.x), 46 | powOfTwo(x.y), 47 | powOfTwo(x.z)); 48 | } 49 | 50 | GLM_FUNC_QUALIFIER detail::tvec4 powOfTwo(const detail::tvec4& x) 51 | { 52 | return detail::tvec4( 53 | powOfTwo(x.x), 54 | powOfTwo(x.y), 55 | powOfTwo(x.z), 56 | powOfTwo(x.w)); 57 | } 58 | }//namespace glm 59 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionDispatch/btCollisionObjectWrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef BT_COLLISION_OBJECT_WRAPPER_H 2 | #define BT_COLLISION_OBJECT_WRAPPER_H 3 | 4 | ///btCollisionObjectWrapperis an internal data structure. 5 | ///Most users can ignore this and use btCollisionObject and btCollisionShape instead 6 | class btCollisionShape; 7 | class btCollisionObject; 8 | class btTransform; 9 | #include "LinearMath/btScalar.h" // for SIMD_FORCE_INLINE definition 10 | 11 | #define BT_DECLARE_STACK_ONLY_OBJECT \ 12 | private: \ 13 | void* operator new(size_t size); \ 14 | void operator delete(void*); 15 | 16 | struct btCollisionObjectWrapper; 17 | struct btCollisionObjectWrapper 18 | { 19 | BT_DECLARE_STACK_ONLY_OBJECT 20 | 21 | private: 22 | btCollisionObjectWrapper(const btCollisionObjectWrapper&); // not implemented. Not allowed. 23 | btCollisionObjectWrapper* operator=(const btCollisionObjectWrapper&); 24 | 25 | public: 26 | const btCollisionObjectWrapper* m_parent; 27 | const btCollisionShape* m_shape; 28 | const btCollisionObject* m_collisionObject; 29 | const btTransform& m_worldTransform; 30 | 31 | btCollisionObjectWrapper(const btCollisionObjectWrapper* parent, const btCollisionShape* shape, const btCollisionObject* collisionObject, const btTransform& worldTransform) 32 | : m_parent(parent), m_shape(shape), m_collisionObject(collisionObject), m_worldTransform(worldTransform) 33 | {} 34 | 35 | SIMD_FORCE_INLINE const btTransform& getWorldTransform() const { return m_worldTransform; } 36 | SIMD_FORCE_INLINE const btCollisionObject* getCollisionObject() const { return m_collisionObject; } 37 | SIMD_FORCE_INLINE const btCollisionShape* getCollisionShape() const { return m_shape; } 38 | }; 39 | 40 | #endif //BT_COLLISION_OBJECT_WRAPPER_H 41 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/SpuCollisionObjectWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2007 Erwin Coumans http://bulletphysics.com 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_SPU_COLLISION_OBJECT_WRAPPER_H 17 | #define BT_SPU_COLLISION_OBJECT_WRAPPER_H 18 | 19 | #include "PlatformDefinitions.h" 20 | #include "BulletCollision/CollisionDispatch/btCollisionObject.h" 21 | 22 | ATTRIBUTE_ALIGNED16(class) SpuCollisionObjectWrapper 23 | { 24 | protected: 25 | int m_shapeType; 26 | float m_margin; 27 | ppu_address_t m_collisionObjectPtr; 28 | 29 | public: 30 | SpuCollisionObjectWrapper (); 31 | 32 | SpuCollisionObjectWrapper (const btCollisionObject* collisionObject); 33 | 34 | int getShapeType () const; 35 | float getCollisionMargin () const; 36 | ppu_address_t getCollisionObjectPtr () const; 37 | }; 38 | 39 | 40 | #endif //BT_SPU_COLLISION_OBJECT_WRAPPER_H 41 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletDynamics/Dynamics/btActionInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef _BT_ACTION_INTERFACE_H 17 | #define _BT_ACTION_INTERFACE_H 18 | 19 | class btIDebugDraw; 20 | class btCollisionWorld; 21 | 22 | #include "LinearMath/btScalar.h" 23 | #include "btRigidBody.h" 24 | 25 | ///Basic interface to allow actions such as vehicles and characters to be updated inside a btDynamicsWorld 26 | class btActionInterface 27 | { 28 | protected: 29 | 30 | static btRigidBody& getFixedBody(); 31 | 32 | 33 | public: 34 | 35 | virtual ~btActionInterface() 36 | { 37 | } 38 | 39 | virtual void updateAction( btCollisionWorld* collisionWorld, btScalar deltaTimeStep)=0; 40 | 41 | virtual void debugDraw(btIDebugDraw* debugDrawer) = 0; 42 | 43 | }; 44 | 45 | #endif //_BT_ACTION_INTERFACE_H 46 | 47 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/UpdateConstants.hlsl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | cbuffer UpdateConstantsCB : register( b0 ) 4 | { 5 | int numLinks; 6 | int padding0; 7 | int padding1; 8 | int padding2; 9 | }; 10 | 11 | // Node indices for each link 12 | StructuredBuffer g_linksVertexIndices : register( t0 ); 13 | StructuredBuffer g_vertexPositions : register( t1 ); 14 | StructuredBuffer g_vertexInverseMasses : register( t2 ); 15 | StructuredBuffer g_linksMaterialLSC : register( t3 ); 16 | 17 | RWStructuredBuffer g_linksMassLSC : register( u0 ); 18 | RWStructuredBuffer g_linksRestLengthSquared : register( u1 ); 19 | RWStructuredBuffer g_linksRestLengths : register( u2 ); 20 | 21 | [numthreads(128, 1, 1)] 22 | void 23 | UpdateConstantsKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 24 | { 25 | int linkID = DTid.x; 26 | if( linkID < numLinks ) 27 | { 28 | int2 nodeIndices = g_linksVertexIndices[linkID]; 29 | int node0 = nodeIndices.x; 30 | int node1 = nodeIndices.y; 31 | float linearStiffnessCoefficient = g_linksMaterialLSC[ linkID ]; 32 | 33 | float3 position0 = g_vertexPositions[node0].xyz; 34 | float3 position1 = g_vertexPositions[node1].xyz; 35 | float inverseMass0 = g_vertexInverseMasses[node0]; 36 | float inverseMass1 = g_vertexInverseMasses[node1]; 37 | 38 | float3 difference = position0 - position1; 39 | float length2 = dot(difference, difference); 40 | float length = sqrt(length2); 41 | 42 | g_linksRestLengths[linkID] = length; 43 | g_linksMassLSC[linkID] = (inverseMass0 + inverseMass1)/linearStiffnessCoefficient; 44 | g_linksRestLengthSquared[linkID] = length*length; 45 | } 46 | } 47 | 48 | ); -------------------------------------------------------------------------------- /include/glm/gtx/constants.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #ifndef GLM_GTX_constants 25 | #define GLM_GTX_constants GLM_VERSION 26 | 27 | #include "../gtc/constants.hpp" 28 | 29 | #if(defined(GLM_MESSAGES)) 30 | # pragma message("GLM: GLM_GTX_constants extension is deprecated, include GLM_GTC_constants (glm/gtc/constants.hpp) instead") 31 | #endif 32 | 33 | #endif//GLM_GTX_constants 34 | -------------------------------------------------------------------------------- /include/win32/bullet/LinearMath/btMotionState.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_MOTIONSTATE_H 17 | #define BT_MOTIONSTATE_H 18 | 19 | #include "btTransform.h" 20 | 21 | ///The btMotionState interface class allows the dynamics world to synchronize and interpolate the updated world transforms with graphics 22 | ///For optimizations, potentially only moving objects get synchronized (using setWorldPosition/setWorldOrientation) 23 | class btMotionState 24 | { 25 | public: 26 | 27 | virtual ~btMotionState() 28 | { 29 | 30 | } 31 | 32 | virtual void getWorldTransform(btTransform& worldTrans ) const =0; 33 | 34 | //Bullet only calls the update of worldtransform for active objects 35 | virtual void setWorldTransform(const btTransform& worldTrans)=0; 36 | 37 | 38 | }; 39 | 40 | #endif //BT_MOTIONSTATE_H 41 | -------------------------------------------------------------------------------- /include/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-03-06 5 | // Updated : 2009-05-01 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/polar_coordinates.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tvec3 polar 14 | ( 15 | detail::tvec3 const & euclidean 16 | ) 17 | { 18 | T const Length(length(euclidean)); 19 | detail::tvec3 const tmp(euclidean / Length); 20 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 21 | 22 | #ifdef GLM_FORCE_RADIANS 23 | return detail::tvec3( 24 | atan(xz_dist, tmp.y), // latitude 25 | atan(tmp.x, tmp.z), // longitude 26 | xz_dist); // xz distance 27 | #else 28 | return detail::tvec3( 29 | degrees(atan(xz_dist, tmp.y)), // latitude 30 | degrees(atan(tmp.x, tmp.z)), // longitude 31 | xz_dist); // xz distance 32 | #endif 33 | } 34 | 35 | template 36 | GLM_FUNC_QUALIFIER detail::tvec3 euclidean 37 | ( 38 | detail::tvec3 const & polar 39 | ) 40 | { 41 | #ifdef GLM_FORCE_RADIANS 42 | T const latitude(polar.x); 43 | T const longitude(polar.y); 44 | #else 45 | T const latitude(radians(polar.x)); 46 | T const longitude(radians(polar.y)); 47 | #endif 48 | 49 | return detail::tvec3( 50 | cos(latitude) * sin(longitude), 51 | sin(latitude), 52 | cos(latitude) * cos(longitude)); 53 | } 54 | 55 | }//namespace glm 56 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btEmptyShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btEmptyShape.h" 17 | 18 | 19 | #include "btCollisionShape.h" 20 | 21 | 22 | btEmptyShape::btEmptyShape() : btConcaveShape () 23 | { 24 | m_shapeType = EMPTY_SHAPE_PROXYTYPE; 25 | } 26 | 27 | 28 | btEmptyShape::~btEmptyShape() 29 | { 30 | } 31 | 32 | 33 | ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version 34 | void btEmptyShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const 35 | { 36 | btVector3 margin(getMargin(),getMargin(),getMargin()); 37 | 38 | aabbMin = t.getOrigin() - margin; 39 | 40 | aabbMax = t.getOrigin() + margin; 41 | 42 | } 43 | 44 | void btEmptyShape::calculateLocalInertia(btScalar ,btVector3& ) const 45 | { 46 | btAssert(0); 47 | } 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/Gimpact/gim_geometry.h: -------------------------------------------------------------------------------- 1 | #ifndef GIM_GEOMETRY_H_INCLUDED 2 | #define GIM_GEOMETRY_H_INCLUDED 3 | 4 | /*! \file gim_geometry.h 5 | \author Francisco Leon Najera 6 | */ 7 | /* 8 | ----------------------------------------------------------------------------- 9 | This source file is part of GIMPACT Library. 10 | 11 | For the latest info, see http://gimpact.sourceforge.net/ 12 | 13 | Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371. 14 | email: projectileman@yahoo.com 15 | 16 | This library is free software; you can redistribute it and/or 17 | modify it under the terms of EITHER: 18 | (1) The GNU Lesser General Public License as published by the Free 19 | Software Foundation; either version 2.1 of the License, or (at 20 | your option) any later version. The text of the GNU Lesser 21 | General Public License is included with this library in the 22 | file GIMPACT-LICENSE-LGPL.TXT. 23 | (2) The BSD-style license that is included with this library in 24 | the file GIMPACT-LICENSE-BSD.TXT. 25 | (3) The zlib/libpng license that is included with this library in 26 | the file GIMPACT-LICENSE-ZLIB.TXT. 27 | 28 | This library is distributed in the hope that it will be useful, 29 | but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files 31 | GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details. 32 | 33 | ----------------------------------------------------------------------------- 34 | */ 35 | 36 | ///Additional Headers for Collision 37 | #include "gim_basic_geometry_operations.h" 38 | #include "gim_clip_polygon.h" 39 | #include "gim_box_collision.h" 40 | #include "gim_tri_collision.h" 41 | 42 | #endif // GIM_VECTOR_H_INCLUDED 43 | -------------------------------------------------------------------------------- /include/glm/gtx/compatibility.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-03-16 5 | // Updated : 2008-10-24 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/compatibility.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | // isfinite 13 | template 14 | GLM_FUNC_QUALIFIER bool isfinite( 15 | genType const & x) 16 | { 17 | # if(GLM_COMPILER & GLM_COMPILER_VC) 18 | return _finite(x); 19 | # elif(GLM_COMPILER & GLM_COMPILER_GCC) 20 | # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) 21 | return _isfinite(x) != 0; 22 | # else 23 | return std::isfinite(x) != 0; 24 | # endif 25 | # else 26 | return std::isfinite(x) != 0; 27 | # endif 28 | } 29 | 30 | template 31 | GLM_FUNC_QUALIFIER detail::tvec2 isfinite( 32 | detail::tvec2 const & x) 33 | { 34 | return detail::tvec2( 35 | isfinite(x.x), 36 | isfinite(x.y)); 37 | } 38 | 39 | template 40 | GLM_FUNC_QUALIFIER detail::tvec3 isfinite( 41 | detail::tvec3 const & x) 42 | { 43 | return detail::tvec3( 44 | isfinite(x.x), 45 | isfinite(x.y), 46 | isfinite(x.z)); 47 | } 48 | 49 | template 50 | GLM_FUNC_QUALIFIER detail::tvec4 isfinite( 51 | detail::tvec4 const & x) 52 | { 53 | return detail::tvec4( 54 | isfinite(x.x), 55 | isfinite(x.y), 56 | isfinite(x.z), 57 | isfinite(x.w)); 58 | } 59 | 60 | }//namespace glm 61 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library, Copyright (c) 2007 Erwin Coumans 3 | 4 | This software is provided 'as-is', without any express or implied warranty. 5 | In no event will the authors be held liable for any damages arising from the use of this software. 6 | Permission is granted to anyone to use this software for any purpose, 7 | including commercial applications, and to alter it and redistribute it freely, 8 | subject to the following restrictions: 9 | 10 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 11 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 12 | 3. This notice may not be removed or altered from any source distribution. 13 | 14 | */ 15 | 16 | #ifndef SPU_SAMPLE_TASK_H 17 | #define SPU_SAMPLE_TASK_H 18 | 19 | #include "../PlatformDefinitions.h" 20 | #include "LinearMath/btScalar.h" 21 | #include "LinearMath/btVector3.h" 22 | #include "LinearMath/btMatrix3x3.h" 23 | 24 | #include "LinearMath/btAlignedAllocator.h" 25 | 26 | 27 | enum 28 | { 29 | CMD_SAMPLE_INTEGRATE_BODIES = 1, 30 | CMD_SAMPLE_PREDICT_MOTION_BODIES 31 | }; 32 | 33 | 34 | 35 | ATTRIBUTE_ALIGNED16(struct) SpuSampleTaskDesc 36 | { 37 | BT_DECLARE_ALIGNED_ALLOCATOR(); 38 | 39 | uint32_t m_sampleCommand; 40 | uint32_t m_taskId; 41 | 42 | uint64_t m_mainMemoryPtr; 43 | int m_sampleValue; 44 | 45 | 46 | }; 47 | 48 | 49 | void processSampleTask(void* userPtr, void* lsMemory); 50 | void* createSampleLocalStoreMemory(); 51 | 52 | 53 | #endif //SPU_SAMPLE_TASK_H 54 | 55 | -------------------------------------------------------------------------------- /include/glm/core/type_vec.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_vec.hpp 25 | /// @date 2010-01-26 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type_vec 30 | #define glm_core_type_vec 31 | 32 | #include "type_gentype.hpp" 33 | 34 | namespace glm{ 35 | namespace detail 36 | { 37 | 38 | }//namespace detail 39 | }//namespace glm 40 | 41 | #endif//glm_core_type_vec 42 | -------------------------------------------------------------------------------- /include/glm/gtx/vector_angle.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-30 5 | // Updated : 2008-09-29 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/vector_angle.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER typename genType::value_type angle 14 | ( 15 | genType const & x, 16 | genType const & y 17 | ) 18 | { 19 | return degrees(acos(dot(x, y))); 20 | } 21 | 22 | //! \todo epsilon is hard coded to 0.01 23 | template 24 | GLM_FUNC_QUALIFIER valType orientedAngle 25 | ( 26 | detail::tvec2 const & x, 27 | detail::tvec2 const & y 28 | ) 29 | { 30 | #ifdef GLM_FORCE_RADIANS 31 | valType const Angle(acos(dot(x, y))); 32 | #else 33 | valType const Angle(glm::degrees(acos(dot(x, y)))); 34 | #endif 35 | detail::tvec2 const TransformedVector(glm::rotate(x, Angle)); 36 | if(all(epsilonEqual(y, TransformedVector, valType(0.01)))) 37 | return Angle; 38 | else 39 | return -Angle; 40 | } 41 | 42 | template 43 | GLM_FUNC_QUALIFIER valType orientedAngle 44 | ( 45 | detail::tvec3 const & x, 46 | detail::tvec3 const & y, 47 | detail::tvec3 const & ref 48 | ) 49 | { 50 | valType const Angle(glm::degrees(glm::acos(glm::dot(x, y)))); 51 | 52 | if(glm::dot(ref, glm::cross(x, y)) < valType(0)) 53 | return -Angle; 54 | else 55 | return Angle; 56 | } 57 | }//namespace glm 58 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btBox2dShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btBox2dShape.h" 17 | 18 | 19 | //{ 20 | 21 | 22 | void btBox2dShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const 23 | { 24 | btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax); 25 | } 26 | 27 | 28 | void btBox2dShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const 29 | { 30 | //btScalar margin = btScalar(0.); 31 | btVector3 halfExtents = getHalfExtentsWithMargin(); 32 | 33 | btScalar lx=btScalar(2.)*(halfExtents.x()); 34 | btScalar ly=btScalar(2.)*(halfExtents.y()); 35 | btScalar lz=btScalar(2.)*(halfExtents.z()); 36 | 37 | inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz), 38 | mass/(btScalar(12.0)) * (lx*lx + lz*lz), 39 | mass/(btScalar(12.0)) * (lx*lx + ly*ly)); 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/SolvePositions.hlsl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | cbuffer SolvePositionsFromLinksKernelCB : register( b0 ) 4 | { 5 | int startLink; 6 | int numLinks; 7 | float kst; 8 | float ti; 9 | }; 10 | 11 | // Node indices for each link 12 | StructuredBuffer g_linksVertexIndices : register( t0 ); 13 | 14 | StructuredBuffer g_linksMassLSC : register( t1 ); 15 | StructuredBuffer g_linksRestLengthSquared : register( t2 ); 16 | StructuredBuffer g_verticesInverseMass : register( t3 ); 17 | 18 | RWStructuredBuffer g_vertexPositions : register( u0 ); 19 | 20 | [numthreads(128, 1, 1)] 21 | void 22 | SolvePositionsFromLinksKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 23 | { 24 | int linkID = DTid.x + startLink; 25 | if( DTid.x < numLinks ) 26 | { 27 | float massLSC = g_linksMassLSC[linkID]; 28 | float restLengthSquared = g_linksRestLengthSquared[linkID]; 29 | 30 | if( massLSC > 0.0f ) 31 | { 32 | int2 nodeIndices = g_linksVertexIndices[linkID]; 33 | int node0 = nodeIndices.x; 34 | int node1 = nodeIndices.y; 35 | 36 | float3 position0 = g_vertexPositions[node0].xyz; 37 | float3 position1 = g_vertexPositions[node1].xyz; 38 | 39 | float inverseMass0 = g_verticesInverseMass[node0]; 40 | float inverseMass1 = g_verticesInverseMass[node1]; 41 | 42 | float3 del = position1 - position0; 43 | float len = dot(del, del); 44 | float k = ((restLengthSquared - len)/(massLSC*(restLengthSquared+len)))*kst; 45 | position0 = position0 - del*(k*inverseMass0); 46 | position1 = position1 + del*(k*inverseMass1); 47 | 48 | g_vertexPositions[node0] = float4(position0, 0.f); 49 | g_vertexPositions[node1] = float4(position1, 0.f); 50 | 51 | } 52 | } 53 | } 54 | 55 | ); -------------------------------------------------------------------------------- /include/glm/core/dummy.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/dummy.cpp 25 | /// @date 2011-01-19 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /// 28 | /// GLM is a header only library. There is nothing to compile. 29 | /// dummy.cpp exist only a wordaround for CMake file. 30 | /////////////////////////////////////////////////////////////////////////////////// 31 | 32 | #define GLM_MESSAGES 33 | #include "../glm.hpp" 34 | 35 | //#error "GLM is a header only library" 36 | 37 | int main() 38 | { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/UpdateNodes.hlsl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | cbuffer UpdateVelocitiesFromPositionsWithVelocitiesCB : register( b0 ) 4 | { 5 | int numNodes; 6 | float isolverdt; 7 | int padding1; 8 | int padding2; 9 | }; 10 | 11 | 12 | StructuredBuffer g_vertexPositions : register( t0 ); 13 | StructuredBuffer g_vertexPreviousPositions : register( t1 ); 14 | StructuredBuffer g_vertexClothIndices : register( t2 ); 15 | StructuredBuffer g_clothVelocityCorrectionCoefficients : register( t3 ); 16 | StructuredBuffer g_clothDampingFactor : register( t4 ); 17 | 18 | RWStructuredBuffer g_vertexVelocities : register( u0 ); 19 | RWStructuredBuffer g_vertexForces : register( u1 ); 20 | 21 | 22 | [numthreads(128, 1, 1)] 23 | void 24 | updateVelocitiesFromPositionsWithVelocitiesKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 25 | { 26 | int nodeID = DTid.x; 27 | if( nodeID < numNodes ) 28 | { 29 | float3 position = g_vertexPositions[nodeID].xyz; 30 | float3 previousPosition = g_vertexPreviousPositions[nodeID].xyz; 31 | float3 velocity = g_vertexVelocities[nodeID].xyz; 32 | int clothIndex = g_vertexClothIndices[nodeID]; 33 | float velocityCorrectionCoefficient = g_clothVelocityCorrectionCoefficients[clothIndex]; 34 | float dampingFactor = g_clothDampingFactor[clothIndex]; 35 | float velocityCoefficient = (1.f - dampingFactor); 36 | 37 | float3 difference = position - previousPosition; 38 | 39 | velocity += difference*velocityCorrectionCoefficient*isolverdt; 40 | 41 | // Damp the velocity 42 | velocity *= velocityCoefficient; 43 | 44 | g_vertexVelocities[nodeID] = float4(velocity, 0.f); 45 | g_vertexForces[nodeID] = float4(0.f, 0.f, 0.f, 0.f); 46 | } 47 | } 48 | 49 | ); -------------------------------------------------------------------------------- /include/glm/core/hint.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/hint.hpp 25 | /// @date 2008-08-14 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type 30 | #define glm_core_type 31 | 32 | namespace glm 33 | { 34 | // Use dont_care, nicest and fastest to optimize implementations. 35 | class dont_care {}; 36 | class nicest {}; 37 | class fastest {}; 38 | }//namespace glm 39 | 40 | #endif//glm_core_type 41 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2008 Erwin Coumans http://bulletphysics.com 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef __BT_ACTIVATING_COLLISION_ALGORITHM_H 17 | #define __BT_ACTIVATING_COLLISION_ALGORITHM_H 18 | 19 | #include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" 20 | 21 | ///This class is not enabled yet (work-in-progress) to more aggressively activate objects. 22 | class btActivatingCollisionAlgorithm : public btCollisionAlgorithm 23 | { 24 | // btCollisionObject* m_colObj0; 25 | // btCollisionObject* m_colObj1; 26 | 27 | public: 28 | 29 | btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci); 30 | 31 | btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci, const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap); 32 | 33 | virtual ~btActivatingCollisionAlgorithm(); 34 | 35 | }; 36 | #endif //__BT_ACTIVATING_COLLISION_ALGORITHM_H 37 | -------------------------------------------------------------------------------- /include/glm/core/type_size.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_size.hpp 25 | /// @date 2008-10-05 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type_size 30 | #define glm_core_type_size 31 | 32 | #include 33 | 34 | namespace glm{ 35 | namespace detail 36 | { 37 | //typedef std::size_t size_t; 38 | typedef int sizeType; 39 | 40 | }//namespace detail 41 | }//namespace glm 42 | 43 | #endif//glm_core_type_size 44 | -------------------------------------------------------------------------------- /include/glm/gtx/component_wise.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-05-21 5 | // Updated : 2010-02-12 6 | // Licence : This source is under MIT License 7 | // File : gtx_component_wise.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER typename genType::value_type compAdd(genType const & v) 14 | { 15 | typename genType::size_type result = typename genType::value_type(0); 16 | for(typename genType::size_type i = 0; i < v.length(); ++i) 17 | result += v[i]; 18 | return result; 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER typename genType::value_type compMul(genType const & v) 23 | { 24 | typename genType::value_type result = typename genType::value_type(1); 25 | for(typename genType::size_type i = 0; i < v.length(); ++i) 26 | result *= v[i]; 27 | return result; 28 | } 29 | 30 | template 31 | GLM_FUNC_QUALIFIER typename genType::value_type compMin(genType const & v) 32 | { 33 | typename genType::value_type result = typename genType::value_type(v[0]); 34 | for(typename genType::size_type i = 1; i < v.length(); ++i) 35 | result = min(result, v[i]); 36 | return result; 37 | } 38 | 39 | template 40 | GLM_FUNC_QUALIFIER typename genType::value_type compMax(genType const & v) 41 | { 42 | typename genType::value_type result = typename genType::value_type(v[0]); 43 | for(typename genType::size_type i = 1; i < v.length(); ++i) 44 | result = max(result, v[i]); 45 | return result; 46 | } 47 | }//namespace glm 48 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | 17 | #ifndef BT_CONVEX_PENETRATION_DEPTH_H 18 | #define BT_CONVEX_PENETRATION_DEPTH_H 19 | 20 | class btStackAlloc; 21 | class btVector3; 22 | #include "btSimplexSolverInterface.h" 23 | class btConvexShape; 24 | class btTransform; 25 | 26 | ///ConvexPenetrationDepthSolver provides an interface for penetration depth calculation. 27 | class btConvexPenetrationDepthSolver 28 | { 29 | public: 30 | 31 | virtual ~btConvexPenetrationDepthSolver() {}; 32 | virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver, 33 | const btConvexShape* convexA,const btConvexShape* convexB, 34 | const btTransform& transA,const btTransform& transB, 35 | btVector3& v, btVector3& pa, btVector3& pb, 36 | class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc 37 | ) = 0; 38 | 39 | 40 | }; 41 | #endif //BT_CONVEX_PENETRATION_DEPTH_H 42 | 43 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btTriangleCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_TRIANGLE_CALLBACK_H 17 | #define BT_TRIANGLE_CALLBACK_H 18 | 19 | #include "LinearMath/btVector3.h" 20 | 21 | 22 | ///The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTriangles. 23 | ///This callback is called by processAllTriangles for all btConcaveShape derived class, such as btBvhTriangleMeshShape, btStaticPlaneShape and btHeightfieldTerrainShape. 24 | class btTriangleCallback 25 | { 26 | public: 27 | 28 | virtual ~btTriangleCallback(); 29 | virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) = 0; 30 | }; 31 | 32 | class btInternalTriangleIndexCallback 33 | { 34 | public: 35 | 36 | virtual ~btInternalTriangleIndexCallback(); 37 | virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) = 0; 38 | }; 39 | 40 | 41 | 42 | #endif //BT_TRIANGLE_CALLBACK_H 43 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Bullet Continuous Collision Detection and Physics Library 4 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it freely, 10 | subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 13 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 14 | 3. This notice may not be removed or altered from any source distribution. 15 | */ 16 | 17 | #ifndef OVERLAPPING_PAIR_CALLBACK_H 18 | #define OVERLAPPING_PAIR_CALLBACK_H 19 | 20 | class btDispatcher; 21 | struct btBroadphasePair; 22 | 23 | ///The btOverlappingPairCallback class is an additional optional broadphase user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache. 24 | class btOverlappingPairCallback 25 | { 26 | public: 27 | virtual ~btOverlappingPairCallback() 28 | { 29 | 30 | } 31 | 32 | virtual btBroadphasePair* addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) = 0; 33 | 34 | virtual void* removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher) = 0; 35 | 36 | virtual void removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy0,btDispatcher* dispatcher) = 0; 37 | 38 | }; 39 | 40 | #endif //OVERLAPPING_PAIR_CALLBACK_H 41 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/SpuCollisionObjectWrapper.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2007 Erwin Coumans http://bulletphysics.com 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "SpuCollisionObjectWrapper.h" 17 | #include "BulletCollision/CollisionShapes/btCollisionShape.h" 18 | 19 | SpuCollisionObjectWrapper::SpuCollisionObjectWrapper () 20 | { 21 | } 22 | 23 | #ifndef __SPU__ 24 | SpuCollisionObjectWrapper::SpuCollisionObjectWrapper (const btCollisionObject* collisionObject) 25 | { 26 | m_shapeType = collisionObject->getCollisionShape()->getShapeType (); 27 | m_collisionObjectPtr = (ppu_address_t)collisionObject; 28 | m_margin = collisionObject->getCollisionShape()->getMargin (); 29 | } 30 | #endif 31 | 32 | int 33 | SpuCollisionObjectWrapper::getShapeType () const 34 | { 35 | return m_shapeType; 36 | } 37 | 38 | float 39 | SpuCollisionObjectWrapper::getCollisionMargin () const 40 | { 41 | return m_margin; 42 | } 43 | 44 | ppu_address_t 45 | SpuCollisionObjectWrapper::getCollisionObjectPtr () const 46 | { 47 | return m_collisionObjectPtr; 48 | } 49 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/OutputToVertexArray.cl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | __kernel void 4 | OutputToVertexArrayWithNormalsKernel( 5 | const int startNode, const int numNodes, __global float *g_vertexBuffer, 6 | const int positionOffset, const int positionStride, const __global float4* g_vertexPositions, 7 | const int normalOffset, const int normalStride, const __global float4* g_vertexNormals ) 8 | { 9 | int nodeID = get_global_id(0); 10 | if( nodeID < numNodes ) 11 | { 12 | float4 position = g_vertexPositions[nodeID + startNode]; 13 | float4 normal = g_vertexNormals[nodeID + startNode]; 14 | 15 | // Stride should account for the float->float4 conversion 16 | int positionDestination = nodeID * positionStride + positionOffset; 17 | g_vertexBuffer[positionDestination] = position.x; 18 | g_vertexBuffer[positionDestination+1] = position.y; 19 | g_vertexBuffer[positionDestination+2] = position.z; 20 | 21 | int normalDestination = nodeID * normalStride + normalOffset; 22 | g_vertexBuffer[normalDestination] = normal.x; 23 | g_vertexBuffer[normalDestination+1] = normal.y; 24 | g_vertexBuffer[normalDestination+2] = normal.z; 25 | } 26 | } 27 | 28 | __kernel void 29 | OutputToVertexArrayWithoutNormalsKernel( 30 | const int startNode, const int numNodes, __global float *g_vertexBuffer, 31 | const int positionOffset, const int positionStride, const __global float4* g_vertexPositions ) 32 | { 33 | int nodeID = get_global_id(0); 34 | if( nodeID < numNodes ) 35 | { 36 | float4 position = g_vertexPositions[nodeID + startNode]; 37 | 38 | // Stride should account for the float->float4 conversion 39 | int positionDestination = nodeID * positionStride + positionOffset; 40 | g_vertexBuffer[positionDestination] = position.x; 41 | g_vertexBuffer[positionDestination+1] = position.y; 42 | g_vertexBuffer[positionDestination+2] = position.z; 43 | } 44 | } 45 | 46 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/VSolveLinks.hlsl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | cbuffer VSolveLinksCB : register( b0 ) 4 | { 5 | int startLink; 6 | int numLinks; 7 | float kst; 8 | int padding; 9 | }; 10 | 11 | // Node indices for each link 12 | StructuredBuffer g_linksVertexIndices : register( t0 ); 13 | 14 | StructuredBuffer g_linksLengthRatio : register( t1 ); 15 | StructuredBuffer g_linksCurrentLength : register( t2 ); 16 | StructuredBuffer g_vertexInverseMass : register( t3 ); 17 | 18 | RWStructuredBuffer g_vertexVelocity : register( u0 ); 19 | 20 | [numthreads(128, 1, 1)] 21 | void 22 | VSolveLinksKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 23 | { 24 | int linkID = DTid.x + startLink; 25 | if( DTid.x < numLinks ) 26 | { 27 | int2 nodeIndices = g_linksVertexIndices[linkID]; 28 | int node0 = nodeIndices.x; 29 | int node1 = nodeIndices.y; 30 | 31 | float linkLengthRatio = g_linksLengthRatio[linkID]; 32 | float3 linkCurrentLength = g_linksCurrentLength[linkID].xyz; 33 | 34 | float3 vertexVelocity0 = g_vertexVelocity[node0].xyz; 35 | float3 vertexVelocity1 = g_vertexVelocity[node1].xyz; 36 | 37 | float vertexInverseMass0 = g_vertexInverseMass[node0]; 38 | float vertexInverseMass1 = g_vertexInverseMass[node1]; 39 | 40 | float3 nodeDifference = vertexVelocity0 - vertexVelocity1; 41 | float dotResult = dot(linkCurrentLength, nodeDifference); 42 | float j = -dotResult*linkLengthRatio*kst; 43 | 44 | float3 velocityChange0 = linkCurrentLength*(j*vertexInverseMass0); 45 | float3 velocityChange1 = linkCurrentLength*(j*vertexInverseMass1); 46 | 47 | vertexVelocity0 += velocityChange0; 48 | vertexVelocity1 -= velocityChange1; 49 | 50 | g_vertexVelocity[node0] = float4(vertexVelocity0, 0.f); 51 | g_vertexVelocity[node1] = float4(vertexVelocity1, 0.f); 52 | } 53 | } 54 | 55 | ); -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_COLLISION_CREATE_FUNC 17 | #define BT_COLLISION_CREATE_FUNC 18 | 19 | #include "LinearMath/btAlignedObjectArray.h" 20 | class btCollisionAlgorithm; 21 | class btCollisionObject; 22 | struct btCollisionObjectWrapper; 23 | struct btCollisionAlgorithmConstructionInfo; 24 | 25 | ///Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm 26 | struct btCollisionAlgorithmCreateFunc 27 | { 28 | bool m_swapped; 29 | 30 | btCollisionAlgorithmCreateFunc() 31 | :m_swapped(false) 32 | { 33 | } 34 | virtual ~btCollisionAlgorithmCreateFunc(){}; 35 | 36 | virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& , const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap) 37 | { 38 | 39 | (void)body0Wrap; 40 | (void)body1Wrap; 41 | return 0; 42 | } 43 | }; 44 | #endif //BT_COLLISION_CREATE_FUNC 45 | 46 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionDispatch/btCollisionConfiguration.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_COLLISION_CONFIGURATION 17 | #define BT_COLLISION_CONFIGURATION 18 | 19 | struct btCollisionAlgorithmCreateFunc; 20 | 21 | class btStackAlloc; 22 | class btPoolAllocator; 23 | 24 | ///btCollisionConfiguration allows to configure Bullet collision detection 25 | ///stack allocator size, default collision algorithms and persistent manifold pool size 26 | ///@todo: describe the meaning 27 | class btCollisionConfiguration 28 | { 29 | 30 | public: 31 | 32 | virtual ~btCollisionConfiguration() 33 | { 34 | } 35 | 36 | ///memory pools 37 | virtual btPoolAllocator* getPersistentManifoldPool() = 0; 38 | 39 | virtual btPoolAllocator* getCollisionAlgorithmPool() = 0; 40 | 41 | virtual btStackAlloc* getStackAllocator() = 0; 42 | 43 | virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1) =0; 44 | 45 | }; 46 | 47 | #endif //BT_COLLISION_CONFIGURATION 48 | 49 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H 17 | #define BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H 18 | 19 | #include "btConvexPenetrationDepthSolver.h" 20 | 21 | ///MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation. 22 | ///Implementation is based on sampling the depth using support mapping, and using GJK step to get the witness points. 23 | class btMinkowskiPenetrationDepthSolver : public btConvexPenetrationDepthSolver 24 | { 25 | protected: 26 | 27 | static btVector3* getPenetrationDirections(); 28 | 29 | public: 30 | 31 | virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver, 32 | const btConvexShape* convexA,const btConvexShape* convexB, 33 | const btTransform& transA,const btTransform& transB, 34 | btVector3& v, btVector3& pa, btVector3& pb, 35 | class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc 36 | ); 37 | }; 38 | 39 | #endif //BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H 40 | 41 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2008 Erwin Coumans http://bulletphysics.com 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #include "btActivatingCollisionAlgorithm.h" 17 | #include "btCollisionDispatcher.h" 18 | #include "btCollisionObject.h" 19 | 20 | btActivatingCollisionAlgorithm::btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci) 21 | :btCollisionAlgorithm(ci) 22 | //, 23 | //m_colObj0(0), 24 | //m_colObj1(0) 25 | { 26 | } 27 | btActivatingCollisionAlgorithm::btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci, const btCollisionObjectWrapper* ,const btCollisionObjectWrapper* ) 28 | :btCollisionAlgorithm(ci) 29 | //, 30 | //m_colObj0(0), 31 | //m_colObj1(0) 32 | { 33 | // if (ci.m_dispatcher1->needsCollision(colObj0,colObj1)) 34 | // { 35 | // m_colObj0 = colObj0; 36 | // m_colObj1 = colObj1; 37 | // 38 | // m_colObj0->activate(); 39 | // m_colObj1->activate(); 40 | // } 41 | } 42 | 43 | btActivatingCollisionAlgorithm::~btActivatingCollisionAlgorithm() 44 | { 45 | // m_colObj0->activate(); 46 | // m_colObj1->activate(); 47 | } 48 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | EPA Copyright (c) Ricardo Padrela 2006 6 | 7 | This software is provided 'as-is', without any express or implied warranty. 8 | In no event will the authors be held liable for any damages arising from the use of this software. 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it freely, 11 | subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 14 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 15 | 3. This notice may not be removed or altered from any source distribution. 16 | */ 17 | #ifndef BT_GJP_EPA_PENETRATION_DEPTH_H 18 | #define BT_GJP_EPA_PENETRATION_DEPTH_H 19 | 20 | #include "btConvexPenetrationDepthSolver.h" 21 | 22 | ///EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to 23 | ///calculate the penetration depth between two convex shapes. 24 | class btGjkEpaPenetrationDepthSolver : public btConvexPenetrationDepthSolver 25 | { 26 | public : 27 | 28 | btGjkEpaPenetrationDepthSolver() 29 | { 30 | } 31 | 32 | bool calcPenDepth( btSimplexSolverInterface& simplexSolver, 33 | const btConvexShape* pConvexA, const btConvexShape* pConvexB, 34 | const btTransform& transformA, const btTransform& transformB, 35 | btVector3& v, btVector3& wWitnessOnA, btVector3& wWitnessOnB, 36 | class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc ); 37 | 38 | private : 39 | 40 | }; 41 | 42 | #endif // BT_GJP_EPA_PENETRATION_DEPTH_H 43 | 44 | -------------------------------------------------------------------------------- /include/win32/bullet/LinearMath/btMinMax.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ 3 | 4 | This software is provided 'as-is', without any express or implied warranty. 5 | In no event will the authors be held liable for any damages arising from the use of this software. 6 | Permission is granted to anyone to use this software for any purpose, 7 | including commercial applications, and to alter it and redistribute it freely, 8 | subject to the following restrictions: 9 | 10 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 11 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 12 | 3. This notice may not be removed or altered from any source distribution. 13 | */ 14 | 15 | 16 | 17 | #ifndef BT_GEN_MINMAX_H 18 | #define BT_GEN_MINMAX_H 19 | 20 | #include "btScalar.h" 21 | 22 | template 23 | SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b) 24 | { 25 | return a < b ? a : b ; 26 | } 27 | 28 | template 29 | SIMD_FORCE_INLINE const T& btMax(const T& a, const T& b) 30 | { 31 | return a > b ? a : b; 32 | } 33 | 34 | template 35 | SIMD_FORCE_INLINE const T& btClamped(const T& a, const T& lb, const T& ub) 36 | { 37 | return a < lb ? lb : (ub < a ? ub : a); 38 | } 39 | 40 | template 41 | SIMD_FORCE_INLINE void btSetMin(T& a, const T& b) 42 | { 43 | if (b < a) 44 | { 45 | a = b; 46 | } 47 | } 48 | 49 | template 50 | SIMD_FORCE_INLINE void btSetMax(T& a, const T& b) 51 | { 52 | if (a < b) 53 | { 54 | a = b; 55 | } 56 | } 57 | 58 | template 59 | SIMD_FORCE_INLINE void btClamp(T& a, const T& lb, const T& ub) 60 | { 61 | if (a < lb) 62 | { 63 | a = lb; 64 | } 65 | else if (ub < a) 66 | { 67 | a = ub; 68 | } 69 | } 70 | 71 | #endif //BT_GEN_MINMAX_H 72 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp: -------------------------------------------------------------------------------- 1 | 2 | //Bullet Continuous Collision Detection and Physics Library 3 | //Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | 6 | // 7 | // btAxisSweep3 8 | // 9 | // Copyright (c) 2006 Simon Hobbs 10 | // 11 | // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. 12 | // 13 | // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 16 | // 17 | // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 18 | // 19 | // 3. This notice may not be removed or altered from any source distribution. 20 | #include "btAxisSweep3.h" 21 | 22 | 23 | btAxisSweep3::btAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned short int maxHandles, btOverlappingPairCache* pairCache, bool disableRaycastAccelerator) 24 | :btAxisSweep3Internal(worldAabbMin,worldAabbMax,0xfffe,0xffff,maxHandles,pairCache,disableRaycastAccelerator) 25 | { 26 | // 1 handle is reserved as sentinel 27 | btAssert(maxHandles > 1 && maxHandles < 32767); 28 | 29 | } 30 | 31 | 32 | bt32BitAxisSweep3::bt32BitAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned int maxHandles , btOverlappingPairCache* pairCache , bool disableRaycastAccelerator) 33 | :btAxisSweep3Internal(worldAabbMin,worldAabbMax,0xfffffffe,0x7fffffff,maxHandles,pairCache,disableRaycastAccelerator) 34 | { 35 | // 1 handle is reserved as sentinel 36 | btAssert(maxHandles > 1 && maxHandles < 2147483647); 37 | } 38 | -------------------------------------------------------------------------------- /include/win32/bullet/LinearMath/btGeometryUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/ 3 | 4 | This software is provided 'as-is', without any express or implied warranty. 5 | In no event will the authors be held liable for any damages arising from the use of this software. 6 | Permission is granted to anyone to use this software for any purpose, 7 | including commercial applications, and to alter it and redistribute it freely, 8 | subject to the following restrictions: 9 | 10 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 11 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 12 | 3. This notice may not be removed or altered from any source distribution. 13 | */ 14 | 15 | 16 | #ifndef BT_GEOMETRY_UTIL_H 17 | #define BT_GEOMETRY_UTIL_H 18 | 19 | #include "btVector3.h" 20 | #include "btAlignedObjectArray.h" 21 | 22 | ///The btGeometryUtil helper class provides a few methods to convert between plane equations and vertices. 23 | class btGeometryUtil 24 | { 25 | public: 26 | 27 | 28 | static void getPlaneEquationsFromVertices(btAlignedObjectArray& vertices, btAlignedObjectArray& planeEquationsOut ); 29 | 30 | static void getVerticesFromPlaneEquations(const btAlignedObjectArray& planeEquations , btAlignedObjectArray& verticesOut ); 31 | 32 | static bool isInside(const btAlignedObjectArray& vertices, const btVector3& planeNormal, btScalar margin); 33 | 34 | static bool isPointInsidePlanes(const btAlignedObjectArray& planeEquations, const btVector3& point, btScalar margin); 35 | 36 | static bool areVerticesBehindPlane(const btVector3& planeNormal, const btAlignedObjectArray& vertices, btScalar margin); 37 | 38 | }; 39 | 40 | 41 | #endif //BT_GEOMETRY_UTIL_H 42 | 43 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BT_INTERNAL_EDGE_UTILITY_H 3 | #define BT_INTERNAL_EDGE_UTILITY_H 4 | 5 | #include "LinearMath/btHashMap.h" 6 | #include "LinearMath/btVector3.h" 7 | 8 | #include "BulletCollision/CollisionShapes/btTriangleInfoMap.h" 9 | 10 | ///The btInternalEdgeUtility helps to avoid or reduce artifacts due to wrong collision normals caused by internal edges. 11 | ///See also http://code.google.com/p/bullet/issues/detail?id=27 12 | 13 | class btBvhTriangleMeshShape; 14 | class btCollisionObject; 15 | struct btCollisionObjectWrapper; 16 | class btManifoldPoint; 17 | class btIDebugDraw; 18 | 19 | 20 | 21 | enum btInternalEdgeAdjustFlags 22 | { 23 | BT_TRIANGLE_CONVEX_BACKFACE_MODE = 1, 24 | BT_TRIANGLE_CONCAVE_DOUBLE_SIDED = 2, //double sided options are experimental, single sided is recommended 25 | BT_TRIANGLE_CONVEX_DOUBLE_SIDED = 4 26 | }; 27 | 28 | 29 | ///Call btGenerateInternalEdgeInfo to create triangle info, store in the shape 'userInfo' 30 | void btGenerateInternalEdgeInfo (btBvhTriangleMeshShape*trimeshShape, btTriangleInfoMap* triangleInfoMap); 31 | 32 | 33 | ///Call the btFixMeshNormal to adjust the collision normal, using the triangle info map (generated using btGenerateInternalEdgeInfo) 34 | ///If this info map is missing, or the triangle is not store in this map, nothing will be done 35 | void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWrapper* trimeshColObj0Wrap,const btCollisionObjectWrapper* otherColObj1Wrap, int partId0, int index0, int normalAdjustFlags = 0); 36 | 37 | ///Enable the BT_INTERNAL_EDGE_DEBUG_DRAW define and call btSetDebugDrawer, to get visual info to see if the internal edge utility works properly. 38 | ///If the utility doesn't work properly, you might have to adjust the threshold values in btTriangleInfoMap 39 | //#define BT_INTERNAL_EDGE_DEBUG_DRAW 40 | 41 | #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW 42 | void btSetDebugDrawer(btIDebugDraw* debugDrawer); 43 | #endif //BT_INTERNAL_EDGE_DEBUG_DRAW 44 | 45 | 46 | #endif //BT_INTERNAL_EDGE_UTILITY_H 47 | 48 | -------------------------------------------------------------------------------- /include/glm/core/intrinsic_trigonometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_trigonometric.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_detail_intrinsic_trigonometric 30 | #define glm_detail_intrinsic_trigonometric 31 | 32 | #include "setup.hpp" 33 | 34 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 35 | # error "SSE2 instructions not supported or enabled" 36 | #else 37 | 38 | namespace glm{ 39 | namespace detail 40 | { 41 | 42 | }//namespace detail 43 | }//namespace glm 44 | 45 | #include "intrinsic_trigonometric.inl" 46 | 47 | #endif//GLM_ARCH 48 | #endif//glm_detail_intrinsic_trigonometric 49 | -------------------------------------------------------------------------------- /include/glm/core/_fixes.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/_fixes.hpp 25 | /// @date 2011-02-21 / 2011-11-22 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #include 30 | 31 | //! Workaround for compatibility with other libraries 32 | #ifdef max 33 | #undef max 34 | #endif 35 | 36 | //! Workaround for compatibility with other libraries 37 | #ifdef min 38 | #undef min 39 | #endif 40 | 41 | //! Workaround for Android 42 | #ifdef isnan 43 | #undef isnan 44 | #endif 45 | 46 | //! Workaround for Android 47 | #ifdef isinf 48 | #undef isinf 49 | #endif 50 | 51 | //! Workaround for Chrone Native Client 52 | #ifdef log2 53 | #undef log2 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | 17 | 18 | #ifndef BT_GJK_CONVEX_CAST_H 19 | #define BT_GJK_CONVEX_CAST_H 20 | 21 | #include "BulletCollision/CollisionShapes/btCollisionMargin.h" 22 | 23 | #include "LinearMath/btVector3.h" 24 | #include "btConvexCast.h" 25 | class btConvexShape; 26 | class btMinkowskiSumShape; 27 | #include "btSimplexSolverInterface.h" 28 | 29 | ///GjkConvexCast performs a raycast on a convex object using support mapping. 30 | class btGjkConvexCast : public btConvexCast 31 | { 32 | btSimplexSolverInterface* m_simplexSolver; 33 | const btConvexShape* m_convexA; 34 | const btConvexShape* m_convexB; 35 | 36 | public: 37 | 38 | btGjkConvexCast(const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver); 39 | 40 | /// cast a convex against another convex object 41 | virtual bool calcTimeOfImpact( 42 | const btTransform& fromA, 43 | const btTransform& toA, 44 | const btTransform& fromB, 45 | const btTransform& toB, 46 | CastResult& result); 47 | 48 | }; 49 | 50 | #endif //BT_GJK_CONVEX_CAST_H 51 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletDynamics/Vehicle/btWheelInfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/ 3 | * 4 | * Permission to use, copy, modify, distribute and sell this software 5 | * and its documentation for any purpose is hereby granted without fee, 6 | * provided that the above copyright notice appear in all copies. 7 | * Erwin Coumans makes no representations about the suitability 8 | * of this software for any purpose. 9 | * It is provided "as is" without express or implied warranty. 10 | */ 11 | #include "btWheelInfo.h" 12 | #include "BulletDynamics/Dynamics/btRigidBody.h" // for pointvelocity 13 | 14 | 15 | btScalar btWheelInfo::getSuspensionRestLength() const 16 | { 17 | 18 | return m_suspensionRestLength1; 19 | 20 | } 21 | 22 | void btWheelInfo::updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo) 23 | { 24 | (void)raycastInfo; 25 | 26 | 27 | if (m_raycastInfo.m_isInContact) 28 | 29 | { 30 | btScalar project= m_raycastInfo.m_contactNormalWS.dot( m_raycastInfo.m_wheelDirectionWS ); 31 | btVector3 chassis_velocity_at_contactPoint; 32 | btVector3 relpos = m_raycastInfo.m_contactPointWS - chassis.getCenterOfMassPosition(); 33 | chassis_velocity_at_contactPoint = chassis.getVelocityInLocalPoint( relpos ); 34 | btScalar projVel = m_raycastInfo.m_contactNormalWS.dot( chassis_velocity_at_contactPoint ); 35 | if ( project >= btScalar(-0.1)) 36 | { 37 | m_suspensionRelativeVelocity = btScalar(0.0); 38 | m_clippedInvContactDotSuspension = btScalar(1.0) / btScalar(0.1); 39 | } 40 | else 41 | { 42 | btScalar inv = btScalar(-1.) / project; 43 | m_suspensionRelativeVelocity = projVel * inv; 44 | m_clippedInvContactDotSuspension = inv; 45 | } 46 | 47 | } 48 | 49 | else // Not in contact : position wheel in a nice (rest length) position 50 | { 51 | m_raycastInfo.m_suspensionLength = this->getSuspensionRestLength(); 52 | m_suspensionRelativeVelocity = btScalar(0.0); 53 | m_raycastInfo.m_contactNormalWS = -m_raycastInfo.m_wheelDirectionWS; 54 | m_clippedInvContactDotSuspension = btScalar(1.0); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /include/glm/core/intrinsic_vector_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_vector_relational.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_detail_intrinsic_vector_relational 30 | #define glm_detail_intrinsic_vector_relational 31 | 32 | #include "setup.hpp" 33 | 34 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 35 | # error "SSE2 instructions not supported or enabled" 36 | #else 37 | 38 | namespace glm{ 39 | namespace detail 40 | { 41 | 42 | }//namespace detail 43 | }//namespace glm 44 | 45 | #include "intrinsic_vector_relational.inl" 46 | 47 | #endif//GLM_ARCH 48 | #endif//glm_detail_intrinsic_vector_relational 49 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletDynamics/Character/btCharacterControllerInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2008 Erwin Coumans http://bulletphysics.com 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_CHARACTER_CONTROLLER_INTERFACE_H 17 | #define BT_CHARACTER_CONTROLLER_INTERFACE_H 18 | 19 | #include "LinearMath/btVector3.h" 20 | #include "BulletDynamics/Dynamics/btActionInterface.h" 21 | 22 | class btCollisionShape; 23 | class btRigidBody; 24 | class btCollisionWorld; 25 | 26 | class btCharacterControllerInterface : public btActionInterface 27 | { 28 | public: 29 | btCharacterControllerInterface () {}; 30 | virtual ~btCharacterControllerInterface () {}; 31 | 32 | virtual void setWalkDirection(const btVector3& walkDirection) = 0; 33 | virtual void setVelocityForTimeInterval(const btVector3& velocity, btScalar timeInterval) = 0; 34 | virtual void reset () = 0; 35 | virtual void warp (const btVector3& origin) = 0; 36 | 37 | virtual void preStep ( btCollisionWorld* collisionWorld) = 0; 38 | virtual void playerStep (btCollisionWorld* collisionWorld, btScalar dt) = 0; 39 | virtual bool canJump () const = 0; 40 | virtual void jump () = 0; 41 | 42 | virtual bool onGround () const = 0; 43 | }; 44 | 45 | #endif //BT_CHARACTER_CONTROLLER_INTERFACE_H 46 | 47 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btBoxShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | #include "btBoxShape.h" 16 | 17 | btBoxShape::btBoxShape( const btVector3& boxHalfExtents) 18 | : btPolyhedralConvexShape() 19 | { 20 | m_shapeType = BOX_SHAPE_PROXYTYPE; 21 | 22 | setSafeMargin(boxHalfExtents); 23 | 24 | btVector3 margin(getMargin(),getMargin(),getMargin()); 25 | m_implicitShapeDimensions = (boxHalfExtents * m_localScaling) - margin; 26 | }; 27 | 28 | 29 | 30 | 31 | void btBoxShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const 32 | { 33 | btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax); 34 | } 35 | 36 | 37 | void btBoxShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const 38 | { 39 | //btScalar margin = btScalar(0.); 40 | btVector3 halfExtents = getHalfExtentsWithMargin(); 41 | 42 | btScalar lx=btScalar(2.)*(halfExtents.x()); 43 | btScalar ly=btScalar(2.)*(halfExtents.y()); 44 | btScalar lz=btScalar(2.)*(halfExtents.z()); 45 | 46 | inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz), 47 | mass/(btScalar(12.0)) * (lx*lx + lz*lz), 48 | mass/(btScalar(12.0)) * (lx*lx + ly*ly)); 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionDispatch/btBoxBoxDetector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Box-Box collision detection re-distributed under the ZLib license with permission from Russell L. Smith 3 | * Original version is from Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org 5 | 6 | Bullet Continuous Collision Detection and Physics Library 7 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 8 | 9 | This software is provided 'as-is', without any express or implied warranty. 10 | In no event will the authors be held liable for any damages arising from the use of this software. 11 | Permission is granted to anyone to use this software for any purpose, 12 | including commercial applications, and to alter it and redistribute it freely, 13 | subject to the following restrictions: 14 | 15 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 16 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | */ 19 | #ifndef BT_BOX_BOX_DETECTOR_H 20 | #define BT_BOX_BOX_DETECTOR_H 21 | 22 | 23 | class btBoxShape; 24 | #include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h" 25 | 26 | 27 | /// btBoxBoxDetector wraps the ODE box-box collision detector 28 | /// re-distributed under the Zlib license with permission from Russell L. Smith 29 | struct btBoxBoxDetector : public btDiscreteCollisionDetectorInterface 30 | { 31 | const btBoxShape* m_box1; 32 | const btBoxShape* m_box2; 33 | 34 | public: 35 | 36 | btBoxBoxDetector(const btBoxShape* box1,const btBoxShape* box2); 37 | 38 | virtual ~btBoxBoxDetector() {}; 39 | 40 | virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false); 41 | 42 | }; 43 | 44 | #endif //BT_BOX_BOX_DETECTOR_H 45 | -------------------------------------------------------------------------------- /src/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013 Mathias Kaerlev 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef VOXIE_RANDOM_H 24 | #define VOXIE_RANDOM_H 25 | 26 | #define _USE_MATH_DEFINES 27 | #include 28 | #include 29 | 30 | #include "glm.h" 31 | 32 | inline float randf() 33 | { 34 | return float(rand()) / float(RAND_MAX); 35 | } 36 | 37 | inline float randrange(float a, float b) 38 | { 39 | return a + (b - a) * randf(); 40 | } 41 | 42 | inline float randrange(float a) 43 | { 44 | return a * randf(); 45 | } 46 | 47 | inline int randint(int a) 48 | { 49 | return int(randrange(float(a))); 50 | } 51 | 52 | inline int randint(int a, int b) 53 | { 54 | return int(randrange(float(a), float(b))); 55 | } 56 | 57 | inline void vecrand(vec3 & a) 58 | { 59 | // uniform spherical randomization 60 | float f; 61 | a.z = -(float)rand()/(float)(RAND_MAX>>1) + 1.0f; 62 | float rad = rand()*(float(M_PI)*2.0f/float(RAND_MAX)); 63 | a.x = cos(rad); 64 | a.y = sin(rad); 65 | f = sqrtf(1.0f - a.z*a.z); 66 | a.x *= f; 67 | a.y *= f; 68 | } 69 | 70 | #endif // VOXIE_RANDOM_H 71 | -------------------------------------------------------------------------------- /src/modelproperties.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013 Mathias Kaerlev 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | class MainWindow; 26 | class QSpinBox; 27 | class QComboBox; 28 | class QPushButton; 29 | class ReferencePoint; 30 | 31 | class ModelProperties : public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | bool ignore_changes; 37 | 38 | QComboBox * ref_list; 39 | QPushButton * new_ref; 40 | QPushButton * del_ref; 41 | 42 | QSpinBox * off_x; 43 | QSpinBox * off_y; 44 | QSpinBox * off_z; 45 | 46 | QSpinBox * size_x; 47 | QSpinBox * size_y; 48 | QSpinBox * size_z; 49 | 50 | QSpinBox * ref_x; 51 | QSpinBox * ref_y; 52 | QSpinBox * ref_z; 53 | 54 | MainWindow * window; 55 | 56 | ModelProperties(MainWindow * parent); 57 | QSpinBox * create_spinbox(); 58 | void update_refs(); 59 | void update_controls(); 60 | ReferencePoint * get_point(); 61 | QSize sizeHint() const; 62 | 63 | public slots: 64 | void on_change(); 65 | void on_new_ref(); 66 | void on_del_ref(); 67 | void on_ref_name(const QString & text); 68 | void on_ref_change(); 69 | }; -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Bullet Continuous Collision Detection and Physics Library 4 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it freely, 10 | subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 13 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 14 | 3. This notice may not be removed or altered from any source distribution. 15 | */ 16 | 17 | 18 | #ifndef SPU_CONVEX_PENETRATION_DEPTH_H 19 | #define SPU_CONVEX_PENETRATION_DEPTH_H 20 | 21 | 22 | 23 | class btStackAlloc; 24 | class btIDebugDraw; 25 | #include "BulletCollision/NarrowphaseCollision/btConvexPenetrationDepthSolver.h" 26 | 27 | #include "LinearMath/btTransform.h" 28 | 29 | 30 | ///ConvexPenetrationDepthSolver provides an interface for penetration depth calculation. 31 | class SpuConvexPenetrationDepthSolver : public btConvexPenetrationDepthSolver 32 | { 33 | public: 34 | 35 | virtual ~SpuConvexPenetrationDepthSolver() {}; 36 | virtual bool calcPenDepth( SpuVoronoiSimplexSolver& simplexSolver, 37 | void* convexA,void* convexB,int shapeTypeA, int shapeTypeB, float marginA, float marginB, 38 | btTransform& transA,const btTransform& transB, 39 | btVector3& v, btVector3& pa, btVector3& pb, 40 | class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc, 41 | struct SpuConvexPolyhedronVertexData* convexVertexDataA, 42 | struct SpuConvexPolyhedronVertexData* convexVertexDataB 43 | ) const = 0; 44 | 45 | 46 | }; 47 | 48 | 49 | 50 | #endif //SPU_CONVEX_PENETRATION_DEPTH_H 51 | 52 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/NarrowPhaseCollision/btPointCollector.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_POINT_COLLECTOR_H 17 | #define BT_POINT_COLLECTOR_H 18 | 19 | #include "btDiscreteCollisionDetectorInterface.h" 20 | 21 | 22 | 23 | struct btPointCollector : public btDiscreteCollisionDetectorInterface::Result 24 | { 25 | 26 | 27 | btVector3 m_normalOnBInWorld; 28 | btVector3 m_pointInWorld; 29 | btScalar m_distance;//negative means penetration 30 | 31 | bool m_hasResult; 32 | 33 | btPointCollector () 34 | : m_distance(btScalar(BT_LARGE_FLOAT)),m_hasResult(false) 35 | { 36 | } 37 | 38 | virtual void setShapeIdentifiersA(int partId0,int index0) 39 | { 40 | (void)partId0; 41 | (void)index0; 42 | 43 | } 44 | virtual void setShapeIdentifiersB(int partId1,int index1) 45 | { 46 | (void)partId1; 47 | (void)index1; 48 | } 49 | 50 | virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth) 51 | { 52 | if (depth< m_distance) 53 | { 54 | m_hasResult = true; 55 | m_normalOnBInWorld = normalOnBInWorld; 56 | m_pointInWorld = pointInWorld; 57 | //negative means penetration 58 | m_distance = depth; 59 | } 60 | } 61 | }; 62 | 63 | #endif //BT_POINT_COLLECTOR_H 64 | 65 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Bullet Continuous Collision Detection and Physics Library 4 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising from the use of this software. 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it freely, 10 | subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 13 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 14 | 3. This notice may not be removed or altered from any source distribution. 15 | */ 16 | 17 | #ifndef MINKOWSKI_PENETRATION_DEPTH_SOLVER_H 18 | #define MINKOWSKI_PENETRATION_DEPTH_SOLVER_H 19 | 20 | 21 | #include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h" 22 | 23 | class btStackAlloc; 24 | class btIDebugDraw; 25 | class btVoronoiSimplexSolver; 26 | class btConvexShape; 27 | 28 | ///MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation. 29 | ///Implementation is based on sampling the depth using support mapping, and using GJK step to get the witness points. 30 | class SpuMinkowskiPenetrationDepthSolver : public btConvexPenetrationDepthSolver 31 | { 32 | public: 33 | SpuMinkowskiPenetrationDepthSolver() {} 34 | virtual ~SpuMinkowskiPenetrationDepthSolver() {}; 35 | 36 | virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver, 37 | const btConvexShape* convexA,const btConvexShape* convexB, 38 | const btTransform& transA,const btTransform& transB, 39 | btVector3& v, btVector3& pa, btVector3& pb, 40 | class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc 41 | ); 42 | 43 | 44 | }; 45 | 46 | 47 | #endif //MINKOWSKI_PENETRATION_DEPTH_SOLVER_H 48 | 49 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/OutputToVertexArray.hlsl: -------------------------------------------------------------------------------- 1 | MSTRINGIFY( 2 | 3 | cbuffer OutputToVertexArrayCB : register( b0 ) 4 | { 5 | int startNode; 6 | int numNodes; 7 | int positionOffset; 8 | int positionStride; 9 | 10 | int normalOffset; 11 | int normalStride; 12 | int padding1; 13 | int padding2; 14 | }; 15 | 16 | 17 | StructuredBuffer g_vertexPositions : register( t0 ); 18 | StructuredBuffer g_vertexNormals : register( t1 ); 19 | 20 | RWBuffer g_vertexBuffer : register( u0 ); 21 | 22 | 23 | [numthreads(128, 1, 1)] 24 | void 25 | OutputToVertexArrayWithNormalsKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 26 | { 27 | int nodeID = DTid.x; 28 | if( nodeID < numNodes ) 29 | { 30 | float4 position = g_vertexPositions[nodeID + startNode]; 31 | float4 normal = g_vertexNormals[nodeID + startNode]; 32 | 33 | // Stride should account for the float->float4 conversion 34 | int positionDestination = nodeID * positionStride + positionOffset; 35 | g_vertexBuffer[positionDestination] = position.x; 36 | g_vertexBuffer[positionDestination+1] = position.y; 37 | g_vertexBuffer[positionDestination+2] = position.z; 38 | 39 | int normalDestination = nodeID * normalStride + normalOffset; 40 | g_vertexBuffer[normalDestination] = normal.x; 41 | g_vertexBuffer[normalDestination+1] = normal.y; 42 | g_vertexBuffer[normalDestination+2] = normal.z; 43 | } 44 | } 45 | 46 | [numthreads(128, 1, 1)] 47 | void 48 | OutputToVertexArrayWithoutNormalsKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex ) 49 | { 50 | int nodeID = DTid.x; 51 | if( nodeID < numNodes ) 52 | { 53 | float4 position = g_vertexPositions[nodeID + startNode]; 54 | float4 normal = g_vertexNormals[nodeID + startNode]; 55 | 56 | // Stride should account for the float->float4 conversion 57 | int positionDestination = nodeID * positionStride + positionOffset; 58 | g_vertexBuffer[positionDestination] = position.x; 59 | g_vertexBuffer[positionDestination+1] = position.y; 60 | g_vertexBuffer[positionDestination+2] = position.z; 61 | } 62 | } 63 | ); -------------------------------------------------------------------------------- /include/win32/bullet/LinearMath/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE_DIRECTORIES( 3 | ${BULLET_PHYSICS_SOURCE_DIR}/src 4 | ) 5 | 6 | SET(LinearMath_SRCS 7 | btAlignedAllocator.cpp 8 | btConvexHull.cpp 9 | btConvexHullComputer.cpp 10 | btGeometryUtil.cpp 11 | btPolarDecomposition.cpp 12 | btQuickprof.cpp 13 | btSerializer.cpp 14 | btVector3.cpp 15 | ) 16 | 17 | SET(LinearMath_HDRS 18 | btAabbUtil2.h 19 | btAlignedAllocator.h 20 | btAlignedObjectArray.h 21 | btConvexHull.h 22 | btConvexHullComputer.h 23 | btDefaultMotionState.h 24 | btGeometryUtil.h 25 | btGrahamScan2dConvexHull.h 26 | btHashMap.h 27 | btIDebugDraw.h 28 | btList.h 29 | btMatrix3x3.h 30 | btMinMax.h 31 | btMotionState.h 32 | btPolarDecomposition.h 33 | btPoolAllocator.h 34 | btQuadWord.h 35 | btQuaternion.h 36 | btQuickprof.h 37 | btRandom.h 38 | btScalar.h 39 | btSerializer.h 40 | btStackAlloc.h 41 | btTransform.h 42 | btTransformUtil.h 43 | btVector3.h 44 | ) 45 | 46 | ADD_LIBRARY(LinearMath ${LinearMath_SRCS} ${LinearMath_HDRS}) 47 | SET_TARGET_PROPERTIES(LinearMath PROPERTIES VERSION ${BULLET_VERSION}) 48 | SET_TARGET_PROPERTIES(LinearMath PROPERTIES SOVERSION ${BULLET_VERSION}) 49 | 50 | IF (INSTALL_LIBS) 51 | IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) 52 | #FILES_MATCHING requires CMake 2.6 53 | IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) 54 | IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 55 | INSTALL(TARGETS LinearMath DESTINATION .) 56 | ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 57 | INSTALL(TARGETS LinearMath DESTINATION lib${LIB_SUFFIX}) 58 | INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 59 | DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN 60 | ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) 61 | ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 62 | ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) 63 | 64 | IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 65 | SET_TARGET_PROPERTIES(LinearMath PROPERTIES FRAMEWORK true) 66 | SET_TARGET_PROPERTIES(LinearMath PROPERTIES PUBLIC_HEADER "${LinearMath_HDRS}") 67 | ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 68 | ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) 69 | ENDIF (INSTALL_LIBS) 70 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionShapes/btConvexPolyhedron.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2011 Advanced Micro Devices, Inc. http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | 17 | ///This file was written by Erwin Coumans 18 | 19 | 20 | #ifndef _BT_POLYHEDRAL_FEATURES_H 21 | #define _BT_POLYHEDRAL_FEATURES_H 22 | 23 | #include "LinearMath/btTransform.h" 24 | #include "LinearMath/btAlignedObjectArray.h" 25 | 26 | #define TEST_INTERNAL_OBJECTS 1 27 | 28 | 29 | struct btFace 30 | { 31 | btAlignedObjectArray m_indices; 32 | // btAlignedObjectArray m_connectedFaces; 33 | btScalar m_plane[4]; 34 | }; 35 | 36 | 37 | ATTRIBUTE_ALIGNED16(class) btConvexPolyhedron 38 | { 39 | public: 40 | 41 | BT_DECLARE_ALIGNED_ALLOCATOR(); 42 | 43 | btConvexPolyhedron(); 44 | virtual ~btConvexPolyhedron(); 45 | 46 | btAlignedObjectArray m_vertices; 47 | btAlignedObjectArray m_faces; 48 | btAlignedObjectArray m_uniqueEdges; 49 | 50 | btVector3 m_localCenter; 51 | btVector3 m_extents; 52 | btScalar m_radius; 53 | btVector3 mC; 54 | btVector3 mE; 55 | 56 | void initialize(); 57 | bool testContainment() const; 58 | 59 | void project(const btTransform& trans, const btVector3& dir, btScalar& minProj, btScalar& maxProj, btVector3& witnesPtMin,btVector3& witnesPtMax) const; 60 | }; 61 | 62 | 63 | #endif //_BT_POLYHEDRAL_FEATURES_H 64 | 65 | 66 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletDynamics/ConstraintSolver/btGearConstraint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2012 Advanced Micro Devices, Inc. http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | /// Implemented by Erwin Coumans. The idea for the constraint comes from Dimitris Papavasiliou. 17 | 18 | #include "btGearConstraint.h" 19 | 20 | btGearConstraint::btGearConstraint(btRigidBody& rbA, btRigidBody& rbB, const btVector3& axisInA,const btVector3& axisInB, btScalar ratio) 21 | :btTypedConstraint(GEAR_CONSTRAINT_TYPE,rbA,rbB), 22 | m_axisInA(axisInA), 23 | m_axisInB(axisInB), 24 | m_ratio(ratio) 25 | { 26 | } 27 | 28 | btGearConstraint::~btGearConstraint () 29 | { 30 | } 31 | 32 | void btGearConstraint::getInfo1 (btConstraintInfo1* info) 33 | { 34 | info->m_numConstraintRows = 1; 35 | info->nub = 1; 36 | } 37 | 38 | void btGearConstraint::getInfo2 (btConstraintInfo2* info) 39 | { 40 | btVector3 globalAxisA, globalAxisB; 41 | 42 | globalAxisA = m_rbA.getWorldTransform().getBasis()*this->m_axisInA; 43 | globalAxisB = m_rbB.getWorldTransform().getBasis()*this->m_axisInB; 44 | 45 | info->m_J1angularAxis[0] = globalAxisA[0]; 46 | info->m_J1angularAxis[1] = globalAxisA[1]; 47 | info->m_J1angularAxis[2] = globalAxisA[2]; 48 | 49 | info->m_J2angularAxis[0] = m_ratio*globalAxisB[0]; 50 | info->m_J2angularAxis[1] = m_ratio*globalAxisB[1]; 51 | info->m_J2angularAxis[2] = m_ratio*globalAxisB[2]; 52 | 53 | } 54 | 55 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletDynamics/ConstraintSolver/btConstraintSolver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_CONSTRAINT_SOLVER_H 17 | #define BT_CONSTRAINT_SOLVER_H 18 | 19 | #include "LinearMath/btScalar.h" 20 | 21 | class btPersistentManifold; 22 | class btRigidBody; 23 | class btCollisionObject; 24 | class btTypedConstraint; 25 | struct btContactSolverInfo; 26 | struct btBroadphaseProxy; 27 | class btIDebugDraw; 28 | class btStackAlloc; 29 | class btDispatcher; 30 | /// btConstraintSolver provides solver interface 31 | class btConstraintSolver 32 | { 33 | 34 | public: 35 | 36 | virtual ~btConstraintSolver() {} 37 | 38 | virtual void prepareSolve (int /* numBodies */, int /* numManifolds */) {;} 39 | 40 | ///solve a group of constraints 41 | virtual btScalar solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifold,int numManifolds,btTypedConstraint** constraints,int numConstraints, const btContactSolverInfo& info,class btIDebugDraw* debugDrawer, btStackAlloc* stackAlloc,btDispatcher* dispatcher) = 0; 42 | 43 | virtual void allSolved (const btContactSolverInfo& /* info */,class btIDebugDraw* /* debugDrawer */, btStackAlloc* /* stackAlloc */) {;} 44 | 45 | ///clear internal cached data and reset random seed 46 | virtual void reset() = 0; 47 | }; 48 | 49 | 50 | 51 | 52 | #endif //BT_CONSTRAINT_SOLVER_H 53 | -------------------------------------------------------------------------------- /src/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013 Mathias Kaerlev 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef VOXIE_TYPES_H 24 | #define VOXIE_TYPES_H 25 | 26 | #include 27 | #include 28 | 29 | #if defined(_MSC_VER) 30 | 31 | // Define _W64 macros to mark types changing their size, like intptr_t. 32 | #ifndef _W64 33 | #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 34 | #define _W64 __w64 35 | #else 36 | #define _W64 37 | #endif 38 | #endif 39 | 40 | #ifdef _WIN64 41 | typedef signed __int64 intptr_t; 42 | typedef unsigned __int64 uintptr_t; 43 | #else 44 | typedef _W64 signed int intptr_t; 45 | typedef _W64 unsigned int uintptr_t; 46 | #endif // _WIN64 47 | 48 | typedef signed __int64 int64_t; 49 | typedef unsigned __int64 uint64_t; 50 | 51 | #include 52 | #include 53 | #define fast_map std::tr1::unordered_map 54 | #define fast_set std::tr1::unordered_set 55 | 56 | #else 57 | 58 | #include 59 | #include 60 | #include 61 | #define fast_map std::tr1::unordered_map 62 | #define fast_set std::tr1::unordered_set 63 | 64 | #endif // _MSC_VER 65 | 66 | typedef std::vector StringList; 67 | 68 | #endif // VOXIE_TYPES_H 69 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletMultiThreaded/btGpuUtilsSharedDefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org 3 | Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | // Shared definitions for GPU-based utilities 17 | 18 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 19 | // Keep this file free from Bullet headers 20 | // it is included into both CUDA and CPU code 21 | // file with definitions of BT_GPU_xxx should be included first 22 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 23 | 24 | 25 | #ifndef BTGPUUTILSDHAREDDEFS_H 26 | #define BTGPUUTILSDHAREDDEFS_H 27 | 28 | 29 | extern "C" 30 | { 31 | 32 | 33 | //Round a / b to nearest higher integer value 34 | int BT_GPU_PREF(iDivUp)(int a, int b); 35 | 36 | // compute grid and thread block size for a given number of elements 37 | void BT_GPU_PREF(computeGridSize)(int n, int blockSize, int &numBlocks, int &numThreads); 38 | 39 | void BT_GPU_PREF(allocateArray)(void** devPtr, unsigned int size); 40 | void BT_GPU_PREF(freeArray)(void* devPtr); 41 | void BT_GPU_PREF(copyArrayFromDevice)(void* host, const void* device, unsigned int size); 42 | void BT_GPU_PREF(copyArrayToDevice)(void* device, const void* host, unsigned int size); 43 | void BT_GPU_PREF(registerGLBufferObject(unsigned int vbo)); 44 | void* BT_GPU_PREF(mapGLBufferObject(unsigned int vbo)); 45 | void BT_GPU_PREF(unmapGLBufferObject(unsigned int vbo)); 46 | 47 | 48 | } // extern "C" 49 | 50 | 51 | #endif // BTGPUUTILSDHAREDDEFS_H 52 | 53 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletDynamics/ConstraintSolver/btGearConstraint.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2012 Advanced Micro Devices, Inc. http://bulletphysics.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | 17 | 18 | #ifndef BT_GEAR_CONSTRAINT_H 19 | #define BT_GEAR_CONSTRAINT_H 20 | 21 | #include "BulletDynamics/ConstraintSolver/btTypedConstraint.h" 22 | ///The btGeatConstraint will couple the angular velocity for two bodies around given local axis and ratio. 23 | ///See Bullet/Demos/ConstraintDemo for an example use. 24 | class btGearConstraint : public btTypedConstraint 25 | { 26 | protected: 27 | btVector3 m_axisInA; 28 | btVector3 m_axisInB; 29 | bool m_useFrameA; 30 | btScalar m_ratio; 31 | 32 | public: 33 | btGearConstraint(btRigidBody& rbA, btRigidBody& rbB, const btVector3& axisInA,const btVector3& axisInB, btScalar ratio=1.f); 34 | virtual ~btGearConstraint (); 35 | 36 | ///internal method used by the constraint solver, don't use them directly 37 | virtual void getInfo1 (btConstraintInfo1* info); 38 | 39 | ///internal method used by the constraint solver, don't use them directly 40 | virtual void getInfo2 (btConstraintInfo2* info); 41 | 42 | virtual void setParam(int num, btScalar value, int axis = -1) 43 | { 44 | btAssert(0); 45 | }; 46 | 47 | ///return the local value of parameter 48 | virtual btScalar getParam(int num, int axis = -1) const 49 | { 50 | btAssert(0); 51 | return 0.f; 52 | } 53 | 54 | }; 55 | 56 | #endif //BT_GEAR_CONSTRAINT_H 57 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletSoftBody/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE_DIRECTORIES( 3 | ${BULLET_PHYSICS_SOURCE_DIR}/src 4 | 5 | ) 6 | 7 | #SUBDIRS( Solvers ) 8 | 9 | SET(BulletSoftBody_SRCS 10 | btSoftBody.cpp 11 | btSoftBodyConcaveCollisionAlgorithm.cpp 12 | btSoftBodyHelpers.cpp 13 | btSoftBodyRigidBodyCollisionConfiguration.cpp 14 | btSoftRigidCollisionAlgorithm.cpp 15 | btSoftRigidDynamicsWorld.cpp 16 | btSoftSoftCollisionAlgorithm.cpp 17 | btDefaultSoftBodySolver.cpp 18 | 19 | ) 20 | 21 | SET(BulletSoftBody_HDRS 22 | btSoftBody.h 23 | btSoftBodyData.h 24 | btSoftBodyConcaveCollisionAlgorithm.h 25 | btSoftBodyHelpers.h 26 | btSoftBodyRigidBodyCollisionConfiguration.h 27 | btSoftRigidCollisionAlgorithm.h 28 | btSoftRigidDynamicsWorld.h 29 | btSoftSoftCollisionAlgorithm.h 30 | btSparseSDF.h 31 | 32 | btSoftBodySolvers.h 33 | btDefaultSoftBodySolver.h 34 | 35 | btSoftBodySolverVertexBuffer.h 36 | ) 37 | 38 | 39 | 40 | ADD_LIBRARY(BulletSoftBody ${BulletSoftBody_SRCS} ${BulletSoftBody_HDRS}) 41 | SET_TARGET_PROPERTIES(BulletSoftBody PROPERTIES VERSION ${BULLET_VERSION}) 42 | SET_TARGET_PROPERTIES(BulletSoftBody PROPERTIES SOVERSION ${BULLET_VERSION}) 43 | IF (BUILD_SHARED_LIBS) 44 | TARGET_LINK_LIBRARIES(BulletSoftBody BulletDynamics) 45 | ENDIF (BUILD_SHARED_LIBS) 46 | 47 | IF (INSTALL_LIBS) 48 | IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) 49 | IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) 50 | IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 51 | INSTALL(TARGETS BulletSoftBody DESTINATION .) 52 | ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 53 | INSTALL(TARGETS BulletSoftBody DESTINATION lib${LIB_SUFFIX}) 54 | INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 55 | DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN 56 | ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) 57 | ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 58 | ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) 59 | 60 | IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 61 | SET_TARGET_PROPERTIES(BulletSoftBody PROPERTIES FRAMEWORK true) 62 | SET_TARGET_PROPERTIES(BulletSoftBody PROPERTIES PUBLIC_HEADER "${BulletSoftBody_HDRS}") 63 | ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) 64 | ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) 65 | ENDIF (INSTALL_LIBS) 66 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BT_SPHERE_TRIANGLE_DETECTOR_H 17 | #define BT_SPHERE_TRIANGLE_DETECTOR_H 18 | 19 | #include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h" 20 | 21 | 22 | 23 | class btSphereShape; 24 | class btTriangleShape; 25 | 26 | 27 | 28 | /// sphere-triangle to match the btDiscreteCollisionDetectorInterface 29 | struct SphereTriangleDetector : public btDiscreteCollisionDetectorInterface 30 | { 31 | virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false); 32 | 33 | SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle, btScalar contactBreakingThreshold); 34 | 35 | virtual ~SphereTriangleDetector() {}; 36 | 37 | bool collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar contactBreakingThreshold); 38 | 39 | private: 40 | 41 | 42 | bool pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p ); 43 | bool facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal); 44 | 45 | btSphereShape* m_sphere; 46 | btTriangleShape* m_triangle; 47 | btScalar m_contactBreakingThreshold; 48 | 49 | }; 50 | #endif //BT_SPHERE_TRIANGLE_DETECTOR_H 51 | 52 | -------------------------------------------------------------------------------- /include/win32/bullet/btBulletDynamicsCommon.h: -------------------------------------------------------------------------------- 1 | /* 2 | Bullet Continuous Collision Detection and Physics Library 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the use of this software. 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it freely, 9 | subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 | 3. This notice may not be removed or altered from any source distribution. 14 | */ 15 | 16 | #ifndef BULLET_DYNAMICS_COMMON_H 17 | #define BULLET_DYNAMICS_COMMON_H 18 | 19 | ///Common headerfile includes for Bullet Dynamics, including Collision Detection 20 | #include "btBulletCollisionCommon.h" 21 | 22 | #include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h" 23 | 24 | #include "BulletDynamics/Dynamics/btSimpleDynamicsWorld.h" 25 | #include "BulletDynamics/Dynamics/btRigidBody.h" 26 | 27 | #include "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h" 28 | #include "BulletDynamics/ConstraintSolver/btHingeConstraint.h" 29 | #include "BulletDynamics/ConstraintSolver/btConeTwistConstraint.h" 30 | #include "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h" 31 | #include "BulletDynamics/ConstraintSolver/btSliderConstraint.h" 32 | #include "BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h" 33 | #include "BulletDynamics/ConstraintSolver/btUniversalConstraint.h" 34 | #include "BulletDynamics/ConstraintSolver/btHinge2Constraint.h" 35 | #include "BulletDynamics/ConstraintSolver/btGearConstraint.h" 36 | 37 | #include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h" 38 | 39 | 40 | ///Vehicle simulation, with wheel contact simulated by raycasts 41 | #include "BulletDynamics/Vehicle/btRaycastVehicle.h" 42 | 43 | 44 | 45 | 46 | 47 | 48 | #endif //BULLET_DYNAMICS_COMMON_H 49 | 50 | -------------------------------------------------------------------------------- /include/win32/bullet/BulletCollision/Gimpact/btGImpactMassUtil.h: -------------------------------------------------------------------------------- 1 | /*! \file btGImpactMassUtil.h 2 | \author Francisco Leon Najera 3 | */ 4 | /* 5 | This source file is part of GIMPACT Library. 6 | 7 | For the latest info, see http://gimpact.sourceforge.net/ 8 | 9 | Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371. 10 | email: projectileman@yahoo.com 11 | 12 | 13 | This software is provided 'as-is', without any express or implied warranty. 14 | In no event will the authors be held liable for any damages arising from the use of this software. 15 | Permission is granted to anyone to use this software for any purpose, 16 | including commercial applications, and to alter it and redistribute it freely, 17 | subject to the following restrictions: 18 | 19 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 20 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 21 | 3. This notice may not be removed or altered from any source distribution. 22 | */ 23 | 24 | 25 | #ifndef GIMPACT_MASS_UTIL_H 26 | #define GIMPACT_MASS_UTIL_H 27 | 28 | #include "LinearMath/btTransform.h" 29 | 30 | 31 | 32 | SIMD_FORCE_INLINE btVector3 gim_inertia_add_transformed( 33 | const btVector3 & source_inertia, const btVector3 & added_inertia, const btTransform & transform) 34 | { 35 | btMatrix3x3 rotatedTensor = transform.getBasis().scaled(added_inertia) * transform.getBasis().transpose(); 36 | 37 | btScalar x2 = transform.getOrigin()[0]; 38 | x2*= x2; 39 | btScalar y2 = transform.getOrigin()[1]; 40 | y2*= y2; 41 | btScalar z2 = transform.getOrigin()[2]; 42 | z2*= z2; 43 | 44 | btScalar ix = rotatedTensor[0][0]*(y2+z2); 45 | btScalar iy = rotatedTensor[1][1]*(x2+z2); 46 | btScalar iz = rotatedTensor[2][2]*(x2+y2); 47 | 48 | return btVector3(source_inertia[0]+ix,source_inertia[1]+iy,source_inertia[2] + iz); 49 | } 50 | 51 | SIMD_FORCE_INLINE btVector3 gim_get_point_inertia(const btVector3 & point, btScalar mass) 52 | { 53 | btScalar x2 = point[0]*point[0]; 54 | btScalar y2 = point[1]*point[1]; 55 | btScalar z2 = point[2]*point[2]; 56 | return btVector3(mass*(y2+z2),mass*(x2+z2),mass*(x2+y2)); 57 | } 58 | 59 | 60 | #endif //GIMPACT_MESH_SHAPE_H 61 | --------------------------------------------------------------------------------