├── .github └── workflows │ ├── build-linux.yml │ └── build-windows.yml ├── .gitignore ├── .readthedocs.yaml ├── CMake ├── Common.cmake ├── DataCopyTargets.cmake ├── FindEigen3.cmake ├── GetGitRevisionDescription.cmake └── GetGitRevisionDescription.cmake.in ├── CMakeLists.txt ├── Changelog.txt ├── Common └── Common.h ├── Demos ├── BarDemo │ ├── CMakeLists.txt │ └── main.cpp ├── CMakeLists.txt ├── ClothDemo │ ├── CMakeLists.txt │ └── main.cpp ├── Common │ ├── DemoBase.cpp │ ├── DemoBase.h │ ├── LogWindow.cpp │ ├── LogWindow.h │ ├── Simulator_GUI_imgui.cpp │ ├── Simulator_GUI_imgui.h │ ├── imguiParameters.cpp │ └── imguiParameters.h ├── CosseratRodsDemo │ ├── CMakeLists.txt │ └── main.cpp ├── CouplingDemos │ ├── CMakeLists.txt │ └── RigidBodyClothCouplingDemo.cpp ├── DistanceFieldDemos │ ├── CMakeLists.txt │ ├── ClothCollisionDemo.cpp │ ├── DeformableCollisionDemo.cpp │ └── RigidBodyCollisionDemo.cpp ├── FluidDemo │ ├── CMakeLists.txt │ ├── FluidModel.cpp │ ├── FluidModel.h │ ├── TimeStepFluidModel.cpp │ ├── TimeStepFluidModel.h │ └── main.cpp ├── GenericConstraintsDemos │ ├── CMakeLists.txt │ ├── GenericConstraints.cpp │ ├── GenericConstraints.h │ ├── GenericConstraintsModel.cpp │ ├── GenericConstraintsModel.h │ ├── GenericParticleConstraintsDemo.cpp │ └── GenericRigidBodyConstraintsDemo.cpp ├── PositionBasedElasticRodsDemo │ ├── CMakeLists.txt │ ├── PositionBasedElasticRodsConstraints.cpp │ ├── PositionBasedElasticRodsConstraints.h │ ├── PositionBasedElasticRodsDemo.cpp │ ├── PositionBasedElasticRodsModel.cpp │ ├── PositionBasedElasticRodsModel.h │ ├── PositionBasedElasticRodsTSC.cpp │ ├── PositionBasedElasticRodsTSC.h │ └── ReadMe.txt ├── RigidBodyDemos │ ├── CMakeLists.txt │ ├── ChainDemo.cpp │ └── JointDemo.cpp ├── SceneLoaderDemo │ ├── CMakeLists.txt │ └── SceneLoaderDemo.cpp ├── StiffRodsDemos │ ├── CMakeLists.txt │ ├── DirectPositionBasedSolverForStiffRodsDemo.cpp │ ├── StiffRodsSceneLoader.cpp │ ├── StiffRodsSceneLoader.h │ └── StretchBendingTwistingDemo.cpp └── Visualization │ ├── CMakeLists.txt │ ├── MiniGL.cpp │ ├── MiniGL.h │ ├── Selection.h │ ├── Shader.cpp │ ├── Shader.h │ └── Visualization.h ├── LICENSE ├── MANIFEST.in ├── PositionBasedDynamics ├── CMakeLists.txt ├── DirectPositionBasedSolverForStiffRodsInterface.h ├── MathFunctions.cpp ├── MathFunctions.h ├── PositionBasedDynamics.cpp ├── PositionBasedDynamics.h ├── PositionBasedElasticRods.cpp ├── PositionBasedElasticRods.h ├── PositionBasedFluids.cpp ├── PositionBasedFluids.h ├── PositionBasedGenericConstraints.h ├── PositionBasedRigidBodyDynamics.cpp ├── PositionBasedRigidBodyDynamics.h ├── SPHKernels.cpp ├── SPHKernels.h ├── TimeIntegration.cpp ├── TimeIntegration.h ├── XPBD.cpp └── XPBD.h ├── README.md ├── Simulation ├── AABB.h ├── BoundingSphere.h ├── BoundingSphereHierarchy.cpp ├── BoundingSphereHierarchy.h ├── CMakeLists.txt ├── CollisionDetection.cpp ├── CollisionDetection.h ├── Constraints.cpp ├── Constraints.h ├── CubicSDFCollisionDetection.cpp ├── CubicSDFCollisionDetection.h ├── DistanceFieldCollisionDetection.cpp ├── DistanceFieldCollisionDetection.h ├── IDFactory.cpp ├── IDFactory.h ├── LineModel.cpp ├── LineModel.h ├── NeighborhoodSearchSpatialHashing.cpp ├── NeighborhoodSearchSpatialHashing.h ├── ParticleData.h ├── RigidBody.h ├── RigidBodyGeometry.cpp ├── RigidBodyGeometry.h ├── Simulation.cpp ├── Simulation.h ├── SimulationModel.cpp ├── SimulationModel.h ├── TetModel.cpp ├── TetModel.h ├── TimeManager.cpp ├── TimeManager.h ├── TimeStep.cpp ├── TimeStep.h ├── TimeStepController.cpp ├── TimeStepController.h ├── TriangleModel.cpp ├── TriangleModel.h ├── kdTree.h └── kdTree.inl ├── Utils ├── CMakeLists.txt ├── FileSystem.h ├── Hashmap.h ├── IndexedFaceMesh.cpp ├── IndexedFaceMesh.h ├── IndexedTetMesh.cpp ├── IndexedTetMesh.h ├── Logger.h ├── OBJLoader.h ├── ObjectArray.h ├── PLYLoader.h ├── SceneLoader.cpp ├── SceneLoader.h ├── StringTools.h ├── SystemInfo.h ├── TetGenLoader.cpp ├── TetGenLoader.h ├── Timing.h ├── Version.h.in ├── VolumeIntegration.cpp └── VolumeIntegration.h ├── bin ├── ArmadilloCollisionScene.bat ├── CarScene.bat ├── ClothCollisionScene.bat ├── DeformableSolidCollisionScene.bat └── PileScene.bat ├── data ├── models │ ├── armadillo.obj │ ├── armadillo_4k.ele │ ├── armadillo_4k.node │ ├── bunny_10k.obj │ ├── cube.obj │ ├── cube_5.obj │ ├── cylinder.obj │ ├── cylinder_unit_box.obj │ ├── plane_30x30.obj │ ├── plane_50x50.obj │ ├── sphere.obj │ └── torus.obj ├── scenes │ ├── ArmadilloCollisionScene.json │ ├── CarScene.json │ ├── CarScene.py │ ├── ClothCollisionScene.json │ ├── ClothOnBunny.json │ ├── ClothScene.py │ ├── DeformableSolidCollisionScene.json │ ├── PileScene.json │ ├── PileScene.py │ ├── SceneGenerator.py │ └── Wilberforce_scene.json ├── sdf │ └── bunny_10k.csdf └── shaders │ ├── fs_flat.glsl │ ├── fs_flatTex.glsl │ ├── fs_smooth.glsl │ ├── fs_smoothTex.glsl │ ├── gs_flat.glsl │ ├── gs_flatTex.glsl │ ├── vs_flat.glsl │ ├── vs_flatTex.glsl │ ├── vs_smooth.glsl │ └── vs_smoothTex.glsl ├── doc ├── Doxyfile ├── GenericConstraints.dox ├── Makefile ├── about.md ├── bibliography.bib ├── bibliography.rst ├── build_from_source.md ├── cmake_options.md ├── conf.py ├── file_format.md ├── getting_started.md ├── images │ ├── PBD1.jpg │ ├── PBD2.jpg │ ├── balljoint.jpg │ ├── ballonlinejoint.jpg │ ├── hingejoint.jpg │ ├── motorhingejoint.jpg │ ├── motorsliderjoint.jpg │ ├── sliderjoint.jpg │ └── universaljoint.jpg ├── index.rst ├── mainpage.dox ├── make.bat ├── py_getting_started.md └── requirements.txt ├── extern ├── eigen │ ├── CMakeLists.txt │ ├── COPYING.APACHE │ ├── COPYING.BSD │ ├── COPYING.GPL │ ├── COPYING.LGPL │ ├── COPYING.MINPACK │ ├── COPYING.MPL2 │ ├── COPYING.README │ ├── Eigen │ │ ├── CMakeLists.txt │ │ ├── Cholesky │ │ ├── CholmodSupport │ │ ├── Core │ │ ├── Dense │ │ ├── Eigen │ │ ├── Eigenvalues │ │ ├── Geometry │ │ ├── Householder │ │ ├── IterativeLinearSolvers │ │ ├── Jacobi │ │ ├── KLUSupport │ │ ├── LU │ │ ├── MetisSupport │ │ ├── OrderingMethods │ │ ├── PaStiXSupport │ │ ├── PardisoSupport │ │ ├── QR │ │ ├── QtAlignedMalloc │ │ ├── SPQRSupport │ │ ├── SVD │ │ ├── Sparse │ │ ├── SparseCholesky │ │ ├── SparseCore │ │ ├── SparseLU │ │ ├── SparseQR │ │ ├── StdDeque │ │ ├── StdList │ │ ├── StdVector │ │ ├── SuperLUSupport │ │ ├── UmfPackSupport │ │ └── src │ │ │ ├── Cholesky │ │ │ ├── LDLT.h │ │ │ ├── LLT.h │ │ │ └── LLT_LAPACKE.h │ │ │ ├── CholmodSupport │ │ │ └── CholmodSupport.h │ │ │ ├── Core │ │ │ ├── ArithmeticSequence.h │ │ │ ├── Array.h │ │ │ ├── ArrayBase.h │ │ │ ├── ArrayWrapper.h │ │ │ ├── Assign.h │ │ │ ├── AssignEvaluator.h │ │ │ ├── Assign_MKL.h │ │ │ ├── BandMatrix.h │ │ │ ├── Block.h │ │ │ ├── BooleanRedux.h │ │ │ ├── CommaInitializer.h │ │ │ ├── ConditionEstimator.h │ │ │ ├── CoreEvaluators.h │ │ │ ├── CoreIterators.h │ │ │ ├── CwiseBinaryOp.h │ │ │ ├── CwiseNullaryOp.h │ │ │ ├── CwiseTernaryOp.h │ │ │ ├── CwiseUnaryOp.h │ │ │ ├── CwiseUnaryView.h │ │ │ ├── DenseBase.h │ │ │ ├── DenseCoeffsBase.h │ │ │ ├── DenseStorage.h │ │ │ ├── Diagonal.h │ │ │ ├── DiagonalMatrix.h │ │ │ ├── DiagonalProduct.h │ │ │ ├── Dot.h │ │ │ ├── EigenBase.h │ │ │ ├── ForceAlignedAccess.h │ │ │ ├── Fuzzy.h │ │ │ ├── GeneralProduct.h │ │ │ ├── GenericPacketMath.h │ │ │ ├── GlobalFunctions.h │ │ │ ├── IO.h │ │ │ ├── IndexedView.h │ │ │ ├── Inverse.h │ │ │ ├── Map.h │ │ │ ├── MapBase.h │ │ │ ├── MathFunctions.h │ │ │ ├── MathFunctionsImpl.h │ │ │ ├── Matrix.h │ │ │ ├── MatrixBase.h │ │ │ ├── NestByValue.h │ │ │ ├── NoAlias.h │ │ │ ├── NumTraits.h │ │ │ ├── PartialReduxEvaluator.h │ │ │ ├── PermutationMatrix.h │ │ │ ├── PlainObjectBase.h │ │ │ ├── Product.h │ │ │ ├── ProductEvaluators.h │ │ │ ├── Random.h │ │ │ ├── Redux.h │ │ │ ├── Ref.h │ │ │ ├── Replicate.h │ │ │ ├── Reshaped.h │ │ │ ├── ReturnByValue.h │ │ │ ├── Reverse.h │ │ │ ├── Select.h │ │ │ ├── SelfAdjointView.h │ │ │ ├── SelfCwiseBinaryOp.h │ │ │ ├── Solve.h │ │ │ ├── SolveTriangular.h │ │ │ ├── SolverBase.h │ │ │ ├── StableNorm.h │ │ │ ├── StlIterators.h │ │ │ ├── Stride.h │ │ │ ├── Swap.h │ │ │ ├── Transpose.h │ │ │ ├── Transpositions.h │ │ │ ├── TriangularMatrix.h │ │ │ ├── VectorBlock.h │ │ │ ├── VectorwiseOp.h │ │ │ ├── Visitor.h │ │ │ ├── arch │ │ │ │ ├── AVX │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── AVX512 │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── AltiVec │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── MatrixProduct.h │ │ │ │ │ ├── MatrixProductCommon.h │ │ │ │ │ ├── MatrixProductMMA.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── CUDA │ │ │ │ │ └── Complex.h │ │ │ │ ├── Default │ │ │ │ │ ├── BFloat16.h │ │ │ │ │ ├── ConjHelper.h │ │ │ │ │ ├── GenericPacketMathFunctions.h │ │ │ │ │ ├── GenericPacketMathFunctionsFwd.h │ │ │ │ │ ├── Half.h │ │ │ │ │ ├── Settings.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── GPU │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── HIP │ │ │ │ │ └── hcc │ │ │ │ │ │ └── math_constants.h │ │ │ │ ├── MSA │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── NEON │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SSE │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SVE │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SYCL │ │ │ │ │ ├── InteropHeaders.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ ├── SyclMemoryModel.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ └── ZVector │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ ├── functors │ │ │ │ ├── AssignmentFunctors.h │ │ │ │ ├── BinaryFunctors.h │ │ │ │ ├── NullaryFunctors.h │ │ │ │ ├── StlFunctors.h │ │ │ │ ├── TernaryFunctors.h │ │ │ │ └── UnaryFunctors.h │ │ │ ├── products │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ ├── GeneralMatrixMatrix.h │ │ │ │ ├── GeneralMatrixMatrixTriangular.h │ │ │ │ ├── GeneralMatrixMatrixTriangular_BLAS.h │ │ │ │ ├── GeneralMatrixMatrix_BLAS.h │ │ │ │ ├── GeneralMatrixVector.h │ │ │ │ ├── GeneralMatrixVector_BLAS.h │ │ │ │ ├── Parallelizer.h │ │ │ │ ├── SelfadjointMatrixMatrix.h │ │ │ │ ├── SelfadjointMatrixMatrix_BLAS.h │ │ │ │ ├── SelfadjointMatrixVector.h │ │ │ │ ├── SelfadjointMatrixVector_BLAS.h │ │ │ │ ├── SelfadjointProduct.h │ │ │ │ ├── SelfadjointRank2Update.h │ │ │ │ ├── TriangularMatrixMatrix.h │ │ │ │ ├── TriangularMatrixMatrix_BLAS.h │ │ │ │ ├── TriangularMatrixVector.h │ │ │ │ ├── TriangularMatrixVector_BLAS.h │ │ │ │ ├── TriangularSolverMatrix.h │ │ │ │ ├── TriangularSolverMatrix_BLAS.h │ │ │ │ └── TriangularSolverVector.h │ │ │ └── util │ │ │ │ ├── BlasUtil.h │ │ │ │ ├── ConfigureVectorization.h │ │ │ │ ├── Constants.h │ │ │ │ ├── DisableStupidWarnings.h │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ ├── IndexedViewHelper.h │ │ │ │ ├── IntegralConstant.h │ │ │ │ ├── MKL_support.h │ │ │ │ ├── Macros.h │ │ │ │ ├── Memory.h │ │ │ │ ├── Meta.h │ │ │ │ ├── NonMPL2.h │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ ├── ReshapedHelper.h │ │ │ │ ├── StaticAssert.h │ │ │ │ ├── SymbolicIndex.h │ │ │ │ └── XprHelper.h │ │ │ ├── Eigenvalues │ │ │ ├── ComplexEigenSolver.h │ │ │ ├── ComplexSchur.h │ │ │ ├── ComplexSchur_LAPACKE.h │ │ │ ├── EigenSolver.h │ │ │ ├── GeneralizedEigenSolver.h │ │ │ ├── GeneralizedSelfAdjointEigenSolver.h │ │ │ ├── HessenbergDecomposition.h │ │ │ ├── MatrixBaseEigenvalues.h │ │ │ ├── RealQZ.h │ │ │ ├── RealSchur.h │ │ │ ├── RealSchur_LAPACKE.h │ │ │ ├── SelfAdjointEigenSolver.h │ │ │ ├── SelfAdjointEigenSolver_LAPACKE.h │ │ │ └── Tridiagonalization.h │ │ │ ├── Geometry │ │ │ ├── AlignedBox.h │ │ │ ├── AngleAxis.h │ │ │ ├── EulerAngles.h │ │ │ ├── Homogeneous.h │ │ │ ├── Hyperplane.h │ │ │ ├── OrthoMethods.h │ │ │ ├── ParametrizedLine.h │ │ │ ├── Quaternion.h │ │ │ ├── Rotation2D.h │ │ │ ├── RotationBase.h │ │ │ ├── Scaling.h │ │ │ ├── Transform.h │ │ │ ├── Translation.h │ │ │ ├── Umeyama.h │ │ │ └── arch │ │ │ │ └── Geometry_SIMD.h │ │ │ ├── Householder │ │ │ ├── BlockHouseholder.h │ │ │ ├── Householder.h │ │ │ └── HouseholderSequence.h │ │ │ ├── IterativeLinearSolvers │ │ │ ├── BasicPreconditioners.h │ │ │ ├── BiCGSTAB.h │ │ │ ├── ConjugateGradient.h │ │ │ ├── IncompleteCholesky.h │ │ │ ├── IncompleteLUT.h │ │ │ ├── IterativeSolverBase.h │ │ │ ├── LeastSquareConjugateGradient.h │ │ │ └── SolveWithGuess.h │ │ │ ├── Jacobi │ │ │ └── Jacobi.h │ │ │ ├── KLUSupport │ │ │ └── KLUSupport.h │ │ │ ├── LU │ │ │ ├── Determinant.h │ │ │ ├── FullPivLU.h │ │ │ ├── InverseImpl.h │ │ │ ├── PartialPivLU.h │ │ │ ├── PartialPivLU_LAPACKE.h │ │ │ └── arch │ │ │ │ └── InverseSize4.h │ │ │ ├── MetisSupport │ │ │ └── MetisSupport.h │ │ │ ├── OrderingMethods │ │ │ ├── Amd.h │ │ │ ├── Eigen_Colamd.h │ │ │ └── Ordering.h │ │ │ ├── PaStiXSupport │ │ │ └── PaStiXSupport.h │ │ │ ├── PardisoSupport │ │ │ └── PardisoSupport.h │ │ │ ├── QR │ │ │ ├── ColPivHouseholderQR.h │ │ │ ├── ColPivHouseholderQR_LAPACKE.h │ │ │ ├── CompleteOrthogonalDecomposition.h │ │ │ ├── FullPivHouseholderQR.h │ │ │ ├── HouseholderQR.h │ │ │ └── HouseholderQR_LAPACKE.h │ │ │ ├── SPQRSupport │ │ │ └── SuiteSparseQRSupport.h │ │ │ ├── SVD │ │ │ ├── BDCSVD.h │ │ │ ├── JacobiSVD.h │ │ │ ├── JacobiSVD_LAPACKE.h │ │ │ ├── SVDBase.h │ │ │ └── UpperBidiagonalization.h │ │ │ ├── SparseCholesky │ │ │ ├── SimplicialCholesky.h │ │ │ └── SimplicialCholesky_impl.h │ │ │ ├── SparseCore │ │ │ ├── AmbiVector.h │ │ │ ├── CompressedStorage.h │ │ │ ├── ConservativeSparseSparseProduct.h │ │ │ ├── MappedSparseMatrix.h │ │ │ ├── SparseAssign.h │ │ │ ├── SparseBlock.h │ │ │ ├── SparseColEtree.h │ │ │ ├── SparseCompressedBase.h │ │ │ ├── SparseCwiseBinaryOp.h │ │ │ ├── SparseCwiseUnaryOp.h │ │ │ ├── SparseDenseProduct.h │ │ │ ├── SparseDiagonalProduct.h │ │ │ ├── SparseDot.h │ │ │ ├── SparseFuzzy.h │ │ │ ├── SparseMap.h │ │ │ ├── SparseMatrix.h │ │ │ ├── SparseMatrixBase.h │ │ │ ├── SparsePermutation.h │ │ │ ├── SparseProduct.h │ │ │ ├── SparseRedux.h │ │ │ ├── SparseRef.h │ │ │ ├── SparseSelfAdjointView.h │ │ │ ├── SparseSolverBase.h │ │ │ ├── SparseSparseProductWithPruning.h │ │ │ ├── SparseTranspose.h │ │ │ ├── SparseTriangularView.h │ │ │ ├── SparseUtil.h │ │ │ ├── SparseVector.h │ │ │ ├── SparseView.h │ │ │ └── TriangularSolver.h │ │ │ ├── SparseLU │ │ │ ├── SparseLU.h │ │ │ ├── SparseLUImpl.h │ │ │ ├── SparseLU_Memory.h │ │ │ ├── SparseLU_Structs.h │ │ │ ├── SparseLU_SupernodalMatrix.h │ │ │ ├── SparseLU_Utils.h │ │ │ ├── SparseLU_column_bmod.h │ │ │ ├── SparseLU_column_dfs.h │ │ │ ├── SparseLU_copy_to_ucol.h │ │ │ ├── SparseLU_gemm_kernel.h │ │ │ ├── SparseLU_heap_relax_snode.h │ │ │ ├── SparseLU_kernel_bmod.h │ │ │ ├── SparseLU_panel_bmod.h │ │ │ ├── SparseLU_panel_dfs.h │ │ │ ├── SparseLU_pivotL.h │ │ │ ├── SparseLU_pruneL.h │ │ │ └── SparseLU_relax_snode.h │ │ │ ├── SparseQR │ │ │ └── SparseQR.h │ │ │ ├── StlSupport │ │ │ ├── StdDeque.h │ │ │ ├── StdList.h │ │ │ ├── StdVector.h │ │ │ └── details.h │ │ │ ├── SuperLUSupport │ │ │ └── SuperLUSupport.h │ │ │ ├── UmfPackSupport │ │ │ └── UmfPackSupport.h │ │ │ ├── misc │ │ │ ├── Image.h │ │ │ ├── Kernel.h │ │ │ ├── RealSvd2x2.h │ │ │ ├── blas.h │ │ │ ├── lapack.h │ │ │ ├── lapacke.h │ │ │ └── lapacke_mangling.h │ │ │ └── plugins │ │ │ ├── ArrayCwiseBinaryOps.h │ │ │ ├── ArrayCwiseUnaryOps.h │ │ │ ├── BlockMethods.h │ │ │ ├── CommonCwiseBinaryOps.h │ │ │ ├── CommonCwiseUnaryOps.h │ │ │ ├── IndexedViewMethods.h │ │ │ ├── MatrixCwiseBinaryOps.h │ │ │ ├── MatrixCwiseUnaryOps.h │ │ │ └── ReshapedMethods.h │ ├── signature_of_eigen3_matrix_library │ └── version.txt ├── glfw │ ├── CMake │ │ ├── GenerateMappings.cmake │ │ ├── MacOSXBundleInfo.plist.in │ │ ├── i686-w64-mingw32-clang.cmake │ │ ├── i686-w64-mingw32.cmake │ │ ├── modules │ │ │ ├── FindEpollShim.cmake │ │ │ ├── FindOSMesa.cmake │ │ │ ├── FindWaylandProtocols.cmake │ │ │ └── FindXKBCommon.cmake │ │ ├── x86_64-w64-mingw32-clang.cmake │ │ └── x86_64-w64-mingw32.cmake │ ├── CMakeLists.txt │ ├── LICENSE.md │ ├── README.md │ ├── cmake_uninstall.cmake.in │ ├── deps │ │ ├── getopt.c │ │ ├── getopt.h │ │ ├── glad │ │ │ ├── gl.h │ │ │ ├── khrplatform.h │ │ │ ├── vk_platform.h │ │ │ └── vulkan.h │ │ ├── glad_gl.c │ │ ├── glad_vulkan.c │ │ ├── linmath.h │ │ ├── mingw │ │ │ ├── _mingw_dxhelper.h │ │ │ ├── dinput.h │ │ │ └── xinput.h │ │ ├── nuklear.h │ │ ├── nuklear_glfw_gl2.h │ │ ├── stb_image_write.h │ │ ├── tinycthread.c │ │ ├── tinycthread.h │ │ └── vs2008 │ │ │ └── stdint.h │ ├── include │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ ├── src │ │ ├── CMakeLists.txt │ │ ├── cocoa_init.m │ │ ├── cocoa_joystick.h │ │ ├── cocoa_joystick.m │ │ ├── cocoa_monitor.m │ │ ├── cocoa_platform.h │ │ ├── cocoa_time.c │ │ ├── cocoa_window.m │ │ ├── context.c │ │ ├── egl_context.c │ │ ├── egl_context.h │ │ ├── glfw3.pc.in │ │ ├── glfw3Config.cmake.in │ │ ├── glfw_config.h.in │ │ ├── glx_context.c │ │ ├── glx_context.h │ │ ├── init.c │ │ ├── input.c │ │ ├── internal.h │ │ ├── linux_joystick.c │ │ ├── linux_joystick.h │ │ ├── mappings.h │ │ ├── mappings.h.in │ │ ├── monitor.c │ │ ├── nsgl_context.h │ │ ├── nsgl_context.m │ │ ├── null_init.c │ │ ├── null_joystick.c │ │ ├── null_joystick.h │ │ ├── null_monitor.c │ │ ├── null_platform.h │ │ ├── null_window.c │ │ ├── osmesa_context.c │ │ ├── osmesa_context.h │ │ ├── posix_thread.c │ │ ├── posix_thread.h │ │ ├── posix_time.c │ │ ├── posix_time.h │ │ ├── vulkan.c │ │ ├── wgl_context.c │ │ ├── wgl_context.h │ │ ├── win32_init.c │ │ ├── win32_joystick.c │ │ ├── win32_joystick.h │ │ ├── win32_monitor.c │ │ ├── win32_platform.h │ │ ├── win32_thread.c │ │ ├── win32_time.c │ │ ├── win32_window.c │ │ ├── window.c │ │ ├── wl_init.c │ │ ├── wl_monitor.c │ │ ├── wl_platform.h │ │ ├── wl_window.c │ │ ├── x11_init.c │ │ ├── x11_monitor.c │ │ ├── x11_platform.h │ │ ├── x11_window.c │ │ ├── xkb_unicode.c │ │ └── xkb_unicode.h │ └── version.txt ├── happly │ ├── LICENSE │ ├── README.md │ └── happly.h ├── imgui │ ├── CMakeLists.txt │ ├── LICENSE.txt │ ├── backends │ │ ├── imgui_impl_glfw.cpp │ │ ├── imgui_impl_glfw.h │ │ ├── imgui_impl_opengl3.cpp │ │ ├── imgui_impl_opengl3.h │ │ └── imgui_impl_opengl3_loader.h │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_internal.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ ├── imstb_truetype.h │ └── misc │ │ └── fonts │ │ ├── Cousine-Regular.ttf │ │ ├── DroidSans.ttf │ │ ├── Karla-Regular.ttf │ │ ├── ProggyClean.ttf │ │ ├── ProggyTiny.ttf │ │ ├── Roboto-Light.ttf │ │ ├── Roboto-Medium.ttf │ │ ├── Roboto-Regular.ttf │ │ ├── Roboto-Thin.ttf │ │ └── binary_to_compressed_c.cpp ├── json │ └── json.hpp ├── md5 │ ├── CMakeLists.txt │ ├── md5.cpp │ └── md5.h └── pybind │ ├── CMakeLists.txt │ ├── LICENSE │ ├── MANIFEST.in │ ├── README.rst │ ├── include │ └── pybind11 │ │ ├── attr.h │ │ ├── buffer_info.h │ │ ├── cast.h │ │ ├── chrono.h │ │ ├── common.h │ │ ├── complex.h │ │ ├── detail │ │ ├── class.h │ │ ├── common.h │ │ ├── descr.h │ │ ├── init.h │ │ ├── internals.h │ │ ├── type_caster_base.h │ │ └── typeid.h │ │ ├── eigen.h │ │ ├── embed.h │ │ ├── eval.h │ │ ├── functional.h │ │ ├── gil.h │ │ ├── iostream.h │ │ ├── numpy.h │ │ ├── operators.h │ │ ├── options.h │ │ ├── pybind11.h │ │ ├── pytypes.h │ │ ├── stl.h │ │ ├── stl │ │ └── filesystem.h │ │ └── stl_bind.h │ ├── pybind11 │ ├── __init__.py │ ├── __main__.py │ ├── _version.py │ ├── commands.py │ ├── py.typed │ └── setup_helpers.py │ ├── pyproject.toml │ ├── setup.cfg │ ├── setup.py │ ├── tools │ ├── FindCatch.cmake │ ├── FindEigen3.cmake │ ├── FindPythonLibsNew.cmake │ ├── JoinPaths.cmake │ ├── check-style.sh │ ├── cmake_uninstall.cmake.in │ ├── codespell_ignore_lines_from_errors.py │ ├── libsize.py │ ├── make_changelog.py │ ├── pybind11.pc.in │ ├── pybind11Common.cmake │ ├── pybind11Config.cmake.in │ ├── pybind11NewTools.cmake │ ├── pybind11Tools.cmake │ ├── pyproject.toml │ ├── setup_global.py.in │ └── setup_main.py.in │ └── version.txt ├── pyPBD ├── CMakeLists.txt ├── CollisionDetectionModule.cpp ├── ConstraintsModule.cpp ├── ParameterObjectModule.cpp ├── ParticleDataModule.cpp ├── RigidBodyModule.cpp ├── SimulationModelModule.cpp ├── SimulationModule.cpp ├── TimeModule.cpp ├── TimeStepModule.cpp ├── UtilitiesModule.cpp ├── bind_pointer_vector.h ├── common.h ├── examples │ ├── armadillo.py │ ├── beam_model.py │ ├── bunny_cloth.py │ ├── chain_model.py │ ├── cloth_collision.py │ ├── cloth_model.py │ ├── math_tools.py │ ├── pendulum.py │ ├── render_tools.py │ └── rigid_body_cloth_coupling.py └── main.cpp ├── setup.cfg ├── setup.py └── version.txt /.github/workflows/build-linux.yml: -------------------------------------------------------------------------------- 1 | name: build-linux 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | jobs: 8 | build-ubuntu: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v3 14 | - name: apt-get update 15 | run: sudo apt-get update --fix-missing 16 | - name: Install packages 17 | run: sudo apt-get -y install xorg-dev freeglut3-dev 18 | - name: configure 19 | run: mkdir build-release && cd build-release && cmake -DCMAKE_BUILD_TYPE=Release .. 20 | - name: build 21 | run: cmake --build build-release 22 | 23 | build-manylinux-python: 24 | 25 | runs-on: ubuntu-latest 26 | strategy: 27 | matrix: 28 | # python-version: [3.7] 29 | python-version: [cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310] 30 | 31 | steps: 32 | - uses: actions/checkout@v3 33 | 34 | # Set up python 35 | - name: Set up Python 3.8 36 | uses: actions/setup-python@v4 37 | with: 38 | python-version: 3.8 39 | 40 | # Install dependencies 41 | - name: Install dependencies 42 | run: python -m pip install --upgrade twine 43 | 44 | - name: Build manylinux Python wheels 45 | uses: digitalillusions/python-wheels-manylinux-build@master 46 | with: 47 | # python-versions: 'cp37-cp37m' 48 | python-versions: '${{ matrix.python-version }}' 49 | build-requirements: '' 50 | system-packages: 'cmake3 libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel' 51 | package-path: '' 52 | pip-wheel-args: '--manylinux-build' 53 | 54 | # Upload artifacts 55 | - name: Upload compiled wheel 56 | uses: actions/upload-artifact@master 57 | with: 58 | name: pypbd-linux-${{ matrix.python-version }} 59 | path: wheelhouse 60 | if: always() 61 | 62 | # Publish to pypi 63 | - name: Publish wheels to PyPI 64 | env: 65 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 66 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 67 | run: | 68 | twine upload wheelhouse/*-manylinux*.whl --skip-existing --verbose 69 | -------------------------------------------------------------------------------- /.github/workflows/build-windows.yml: -------------------------------------------------------------------------------- 1 | name: build-windows 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | jobs: 8 | build-windows: 9 | 10 | runs-on: windows-latest 11 | strategy: 12 | matrix: 13 | python-version: [3.7] 14 | 15 | steps: 16 | # Checkout repo 17 | - uses: actions/checkout@v3 18 | 19 | # Set up python 20 | - name: Set up Python ${{ matrix.python-version }} 21 | uses: actions/setup-python@v4 22 | with: 23 | python-version: ${{ matrix.python-version }} 24 | 25 | # Configure, build and test 26 | - name: configure 27 | run: mkdir build-release;cd build-release;cmake .. 28 | shell: pwsh 29 | - name: build 30 | run: cmake --build build-release --config Release 31 | 32 | 33 | # Build the python wheel in parallel 34 | build-windows-python: 35 | runs-on: windows-latest 36 | strategy: 37 | matrix: 38 | # python-version: [3.7] 39 | python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] 40 | 41 | steps: 42 | # Checkout repo 43 | - uses: actions/checkout@v3 44 | 45 | # Set up python 46 | - name: Set up Python ${{ matrix.python-version }} 47 | uses: actions/setup-python@v4 48 | with: 49 | python-version: ${{ matrix.python-version }} 50 | 51 | # Install python dependencies 52 | - name: Install dependencies 53 | run: python -m pip install --upgrade pip setuptools wheel twine 54 | 55 | # Change directory and run setup py 56 | - name: Run setup py 57 | run: python setup.py bdist_wheel 58 | 59 | # Upload artifacts 60 | - name: Upload compiled wheel 61 | uses: actions/upload-artifact@master 62 | with: 63 | name: pypbd-windows-${{ matrix.python-version }} 64 | path: build/dist 65 | if: always() 66 | 67 | # Upload wheel to pypi 68 | - name: Upload wheel to pypi 69 | env: 70 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 71 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 72 | run: twine upload build/dist/* --skip-existing 73 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | bin/ 3 | !bin/*.bat -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Set the OS, Python version and other tools you might need 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: "3.11" 12 | # You can also specify other tool versions: 13 | # nodejs: "20" 14 | # rust: "1.70" 15 | # golang: "1.20" 16 | 17 | # Build documentation in the "docs/" directory with Sphinx 18 | sphinx: 19 | configuration: doc/conf.py 20 | # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs 21 | # builder: "dirhtml" 22 | # Fail on all warnings to avoid broken references 23 | # fail_on_warning: true 24 | 25 | # Optionally build your docs in additional formats such as PDF and ePub 26 | # formats: 27 | # - pdf 28 | # - epub 29 | 30 | # Optional but recommended, declare the Python requirements required 31 | # to build your documentation 32 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 33 | python: 34 | install: 35 | - requirements: doc/requirements.txt -------------------------------------------------------------------------------- /CMake/DataCopyTargets.cmake: -------------------------------------------------------------------------------- 1 | add_custom_target(CopyPBDShaders 2 | ${CMAKE_COMMAND} -E copy_directory 3 | ${PROJECT_SOURCE_DIR}/data/shaders 4 | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources/shaders 5 | COMMENT "Copying PBD shaders" 6 | ) 7 | set_target_properties(CopyPBDShaders PROPERTIES FOLDER "Data copy") 8 | 9 | add_custom_target(CopyPBDModels 10 | ${CMAKE_COMMAND} -E copy_directory 11 | ${PROJECT_SOURCE_DIR}/data/models 12 | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources/models 13 | COMMENT "Copying PBD models" 14 | ) 15 | set_target_properties(CopyPBDModels PROPERTIES FOLDER "Data copy") 16 | 17 | add_custom_target(CopyPBDScenes 18 | ${CMAKE_COMMAND} -E copy_directory 19 | ${PROJECT_SOURCE_DIR}/data/scenes 20 | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources/scenes 21 | COMMENT "Copying PBD scenes" 22 | ) 23 | set_target_properties(CopyPBDScenes PROPERTIES FOLDER "Data copy") 24 | 25 | add_custom_target(CopyImguiFonts 26 | ${CMAKE_COMMAND} -E copy_directory 27 | ${PROJECT_SOURCE_DIR}/extern/imgui/misc/fonts 28 | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources/fonts 29 | COMMENT "Copying fonts" 30 | ) 31 | set_target_properties(CopyImguiFonts PROPERTIES FOLDER "Data copy") 32 | -------------------------------------------------------------------------------- /CMake/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | else() 27 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 28 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 29 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 30 | set(HEAD_HASH "${CMAKE_MATCH_1}") 31 | endif() 32 | endif() 33 | else() 34 | # detached HEAD 35 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 36 | endif() 37 | 38 | if(NOT HEAD_HASH) 39 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 40 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 41 | endif() 42 | -------------------------------------------------------------------------------- /Demos/BarDemo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SIMULATION_LINK_LIBRARIES imgui glfw PositionBasedDynamics Simulation Utils) 2 | set(SIMULATION_DEPENDENCIES imgui glfw PositionBasedDynamics Simulation Utils CopyPBDShaders CopyImguiFonts) 3 | 4 | if(WIN32) 5 | set(SIMULATION_LINK_LIBRARIES opengl32.lib glu32.lib ${SIMULATION_LINK_LIBRARIES}) 6 | #set(SIMULATION_DEPENDENCIES ${SIMULATION_DEPENDENCIES}) 7 | else() 8 | set(OpenGL_GL_PREFERENCE GLVND) 9 | find_package(OpenGL REQUIRED) 10 | include_directories( ${OPENGL_INCLUDE_DIRS}) 11 | 12 | set(SIMULATION_LINK_LIBRARIES 13 | ${SIMULATION_LINK_LIBRARIES} 14 | ${OPENGL_LIBRARIES} 15 | ) 16 | endif() 17 | 18 | ############################################################ 19 | # GenericParameters 20 | ############################################################ 21 | include_directories(${GenericParameters_INCLUDE_DIR}) 22 | if(TARGET Ext_GenericParameters) 23 | set(SIMULATION_DEPENDENCIES ${SIMULATION_DEPENDENCIES} Ext_GenericParameters) 24 | endif() 25 | 26 | add_executable(BarDemo 27 | main.cpp 28 | 29 | ../Common/LogWindow.cpp 30 | ../Common/LogWindow.h 31 | ../Common/Simulator_GUI_imgui.cpp 32 | ../Common/Simulator_GUI_imgui.h 33 | ../Common/imguiParameters.cpp 34 | ../Common/imguiParameters.h 35 | ../Common/DemoBase.cpp 36 | ../Common/DemoBase.h 37 | 38 | ${VIS_FILES} 39 | ${PROJECT_PATH}/Common/Common.h 40 | 41 | CMakeLists.txt 42 | ) 43 | 44 | find_package( Eigen3 REQUIRED ) 45 | include_directories( ${EIGEN3_INCLUDE_DIR} ) 46 | 47 | set_target_properties(BarDemo PROPERTIES FOLDER "Demos") 48 | set_target_properties(BarDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 49 | set_target_properties(BarDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 50 | set_target_properties(BarDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 51 | add_dependencies(BarDemo ${SIMULATION_DEPENDENCIES}) 52 | target_link_libraries(BarDemo ${SIMULATION_LINK_LIBRARIES}) 53 | VIS_SOURCE_GROUPS() 54 | -------------------------------------------------------------------------------- /Demos/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(Visualization/CMakeLists.txt) 2 | 3 | # search all demos 4 | set(PBD_DEMOS 5 | BarDemo 6 | ClothDemo 7 | CosseratRodsDemo 8 | CouplingDemos 9 | DistanceFieldDemos 10 | FluidDemo 11 | GenericConstraintsDemos 12 | PositionBasedElasticRodsDemo 13 | RigidBodyDemos 14 | SceneLoaderDemo 15 | StiffRodsDemos 16 | ) 17 | 18 | if (NOT PBD_LIBS_ONLY) 19 | foreach (_demo_name ${PBD_DEMOS}) 20 | option(Build_${_demo_name} "Build ${_demo_name}" ON) 21 | if (Build_${_demo_name}) 22 | add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/${_demo_name}) 23 | endif (Build_${_demo_name}) 24 | endforeach () 25 | endif() 26 | 27 | install(DIRECTORY ./Common 28 | DESTINATION include/Demos 29 | FILES_MATCHING PATTERN "*.h") 30 | 31 | -------------------------------------------------------------------------------- /Demos/ClothDemo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SIMULATION_LINK_LIBRARIES imgui glfw PositionBasedDynamics Simulation Utils) 2 | set(SIMULATION_DEPENDENCIES imgui glfw PositionBasedDynamics Simulation Utils CopyPBDShaders CopyImguiFonts) 3 | 4 | if(WIN32) 5 | set(SIMULATION_LINK_LIBRARIES opengl32.lib glu32.lib ${SIMULATION_LINK_LIBRARIES}) 6 | #set(SIMULATION_DEPENDENCIES ${SIMULATION_DEPENDENCIES}) 7 | else() 8 | set(OpenGL_GL_PREFERENCE GLVND) 9 | find_package(OpenGL REQUIRED) 10 | include_directories( ${OPENGL_INCLUDE_DIRS}) 11 | 12 | set(SIMULATION_LINK_LIBRARIES 13 | ${SIMULATION_LINK_LIBRARIES} 14 | ${OPENGL_LIBRARIES} 15 | ) 16 | endif() 17 | 18 | ############################################################ 19 | # GenericParameters 20 | ############################################################ 21 | include_directories(${GenericParameters_INCLUDE_DIR}) 22 | if(TARGET Ext_GenericParameters) 23 | set(SIMULATION_DEPENDENCIES ${SIMULATION_DEPENDENCIES} Ext_GenericParameters) 24 | endif() 25 | 26 | 27 | add_executable(ClothDemo 28 | main.cpp 29 | 30 | ../Common/LogWindow.cpp 31 | ../Common/LogWindow.h 32 | ../Common/Simulator_GUI_imgui.cpp 33 | ../Common/Simulator_GUI_imgui.h 34 | ../Common/imguiParameters.cpp 35 | ../Common/imguiParameters.h 36 | ../Common/DemoBase.cpp 37 | ../Common/DemoBase.h 38 | 39 | ${VIS_FILES} 40 | ${PROJECT_PATH}/Common/Common.h 41 | 42 | CMakeLists.txt 43 | ) 44 | 45 | find_package( Eigen3 REQUIRED ) 46 | include_directories( ${EIGEN3_INCLUDE_DIR} ) 47 | include_directories(${PROJECT_PATH}/extern/freeglut/include) 48 | include_directories(${PROJECT_PATH}/extern/glew/include) 49 | 50 | set_target_properties(ClothDemo PROPERTIES FOLDER "Demos") 51 | set_target_properties(ClothDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 52 | set_target_properties(ClothDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 53 | set_target_properties(ClothDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 54 | add_dependencies(ClothDemo ${SIMULATION_DEPENDENCIES}) 55 | target_link_libraries(ClothDemo ${SIMULATION_LINK_LIBRARIES}) 56 | VIS_SOURCE_GROUPS() 57 | -------------------------------------------------------------------------------- /Demos/Common/LogWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef __LogWindow_h__ 2 | #define __LogWindow_h__ 3 | 4 | #include "Common/Common.h" 5 | #include "Utils/Logger.h" 6 | #include 7 | #include "imgui.h" 8 | 9 | struct ImFont; 10 | 11 | namespace PBD 12 | { 13 | class LogWindow 14 | { 15 | protected: 16 | std::shared_ptr m_bufferSink; 17 | bool m_scrollToBottom; 18 | size_t m_lastSize; 19 | int m_selectedFilter; 20 | 21 | public: 22 | LogWindow(); 23 | ~LogWindow(); 24 | 25 | void drawWindow(ImFont *textFont); 26 | int getSelectedFilter() const { return m_selectedFilter; } 27 | void setSelectedFilter(const int i) { m_selectedFilter = i; } 28 | }; 29 | } 30 | 31 | #endif -------------------------------------------------------------------------------- /Demos/Common/Simulator_GUI_imgui.h: -------------------------------------------------------------------------------- 1 | #ifndef __Simulator_GUI_imgui_h__ 2 | #define __Simulator_GUI_imgui_h__ 3 | 4 | #include "Common/Common.h" 5 | #include 6 | 7 | struct ImFont; 8 | struct ImGuiContext; 9 | struct ImGuiSettingsHandler; 10 | struct ImGuiTextBuffer; 11 | 12 | namespace PBD 13 | { 14 | struct UserSettings 15 | { 16 | int scaleIndex; 17 | int win_x, win_y; 18 | int win_width, win_height; 19 | bool vsync; 20 | bool show_log_window; 21 | bool maximized; 22 | int log_filter; 23 | 24 | UserSettings() { win_x = 0; win_y = 0; win_width = 1280; win_height = 960; scaleIndex = 0; vsync = false; maximized = false; log_filter = 1; } 25 | }; 26 | 27 | class LogWindow; 28 | class DemoBase; 29 | 30 | class Simulator_GUI_imgui 31 | { 32 | public: 33 | Simulator_GUI_imgui(DemoBase *base); 34 | virtual ~Simulator_GUI_imgui(); 35 | 36 | protected: 37 | DemoBase* m_base; 38 | std::vector m_fonts; 39 | std::vector m_fonts2; 40 | std::vector m_scales; 41 | unsigned int m_currentScaleIndex; 42 | bool m_vsync; 43 | bool m_showLogWindow; 44 | ImGuiContext* m_context; 45 | UserSettings m_userSettings; 46 | bool m_iniFound; 47 | LogWindow* m_logWindow; 48 | const float m_baseSize = 15.0f; 49 | 50 | void initStyle(); 51 | void initImguiParameters(); 52 | 53 | void switchPause(); 54 | static void switchDrawMode(); 55 | 56 | void destroy(); 57 | 58 | static void writeIni(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* out_buf); 59 | static void readIni(ImGuiContext* ctx, ImGuiSettingsHandler* handler, void* entry, const char* line); 60 | static void* readOpenIni(ImGuiContext* ctx, ImGuiSettingsHandler* handler, const char* name); 61 | static void applySettings(ImGuiContext* ctx, ImGuiSettingsHandler* handler); 62 | bool alignedButton(const char* label, float alignment = 0.5f); 63 | void createMenuBar(); 64 | 65 | public: 66 | void init(); 67 | void initImgui(); 68 | void initSimulationParameterGUI(); 69 | void update(); 70 | void createSimulationParameterGUI(); 71 | 72 | bool getVSync() { return m_userSettings.vsync; } 73 | bool getMaximized() { return m_userSettings.maximized; } 74 | }; 75 | } 76 | 77 | #endif -------------------------------------------------------------------------------- /Demos/CosseratRodsDemo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SIMULATION_LINK_LIBRARIES imgui glfw PositionBasedDynamics Simulation Utils) 2 | set(SIMULATION_DEPENDENCIES imgui glfw PositionBasedDynamics Simulation Utils CopyPBDShaders CopyImguiFonts) 3 | 4 | if(WIN32) 5 | set(SIMULATION_LINK_LIBRARIES opengl32.lib glu32.lib ${SIMULATION_LINK_LIBRARIES}) 6 | #set(SIMULATION_DEPENDENCIES ${SIMULATION_DEPENDENCIES}) 7 | else() 8 | set(OpenGL_GL_PREFERENCE GLVND) 9 | find_package(OpenGL REQUIRED) 10 | include_directories( ${OPENGL_INCLUDE_DIRS}) 11 | 12 | set(SIMULATION_LINK_LIBRARIES 13 | ${SIMULATION_LINK_LIBRARIES} 14 | ${OPENGL_LIBRARIES} 15 | ) 16 | endif() 17 | 18 | ############################################################ 19 | # GenericParameters 20 | ############################################################ 21 | include_directories(${GenericParameters_INCLUDE_DIR}) 22 | if(TARGET Ext_GenericParameters) 23 | set(SIMULATION_DEPENDENCIES ${SIMULATION_DEPENDENCIES} Ext_GenericParameters) 24 | endif() 25 | 26 | add_executable(CosseratRodsDemo 27 | main.cpp 28 | 29 | ../Common/LogWindow.cpp 30 | ../Common/LogWindow.h 31 | ../Common/Simulator_GUI_imgui.cpp 32 | ../Common/Simulator_GUI_imgui.h 33 | ../Common/imguiParameters.cpp 34 | ../Common/imguiParameters.h 35 | ../Common/DemoBase.cpp 36 | ../Common/DemoBase.h 37 | 38 | ${VIS_FILES} 39 | ${PROJECT_PATH}/Common/Common.h 40 | 41 | CMakeLists.txt 42 | ) 43 | 44 | find_package( Eigen3 REQUIRED ) 45 | include_directories( ${EIGEN3_INCLUDE_DIR} ) 46 | include_directories(${PROJECT_PATH}/extern/freeglut/include) 47 | include_directories(${PROJECT_PATH}/extern/glew/include) 48 | 49 | set_target_properties(CosseratRodsDemo PROPERTIES FOLDER "Demos") 50 | set_target_properties(CosseratRodsDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 51 | set_target_properties(CosseratRodsDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 52 | set_target_properties(CosseratRodsDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 53 | add_dependencies(CosseratRodsDemo ${SIMULATION_DEPENDENCIES}) 54 | target_link_libraries(CosseratRodsDemo ${SIMULATION_LINK_LIBRARIES}) 55 | VIS_SOURCE_GROUPS() 56 | -------------------------------------------------------------------------------- /Demos/FluidDemo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SIMULATION_LINK_LIBRARIES imgui glfw PositionBasedDynamics Simulation Utils) 2 | set(SIMULATION_DEPENDENCIES imgui glfw PositionBasedDynamics Simulation Utils CopyPBDShaders CopyImguiFonts) 3 | 4 | if(WIN32) 5 | set(SIMULATION_LINK_LIBRARIES opengl32.lib glu32.lib ${SIMULATION_LINK_LIBRARIES}) 6 | #set(SIMULATION_DEPENDENCIES ${SIMULATION_DEPENDENCIES}) 7 | else() 8 | set(OpenGL_GL_PREFERENCE GLVND) 9 | find_package(OpenGL REQUIRED) 10 | include_directories( ${OPENGL_INCLUDE_DIRS}) 11 | 12 | set(SIMULATION_LINK_LIBRARIES 13 | ${SIMULATION_LINK_LIBRARIES} 14 | ${OPENGL_LIBRARIES} 15 | ) 16 | endif() 17 | 18 | add_executable(FluidDemo 19 | main.cpp 20 | 21 | ../Common/LogWindow.cpp 22 | ../Common/LogWindow.h 23 | ../Common/Simulator_GUI_imgui.cpp 24 | ../Common/Simulator_GUI_imgui.h 25 | ../Common/imguiParameters.cpp 26 | ../Common/imguiParameters.h 27 | ../Common/DemoBase.cpp 28 | ../Common/DemoBase.h 29 | TimeStepFluidModel.cpp 30 | TimeStepFluidModel.h 31 | FluidModel.cpp 32 | FluidModel.h 33 | 34 | ${VIS_FILES} 35 | ${PROJECT_PATH}/Common/Common.h 36 | 37 | CMakeLists.txt 38 | ) 39 | 40 | find_package( Eigen3 REQUIRED ) 41 | include_directories( ${EIGEN3_INCLUDE_DIR} ) 42 | include_directories(${PROJECT_PATH}/extern/freeglut/include) 43 | include_directories(${PROJECT_PATH}/extern/glew/include) 44 | 45 | set_target_properties(FluidDemo PROPERTIES FOLDER "Demos") 46 | set_target_properties(FluidDemo PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 47 | set_target_properties(FluidDemo PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 48 | set_target_properties(FluidDemo PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 49 | add_dependencies(FluidDemo ${SIMULATION_DEPENDENCIES}) 50 | target_link_libraries(FluidDemo ${SIMULATION_LINK_LIBRARIES}) 51 | VIS_SOURCE_GROUPS() 52 | -------------------------------------------------------------------------------- /Demos/FluidDemo/TimeStepFluidModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __TimeStepFluidModel_h__ 2 | #define __TimeStepFluidModel_h__ 3 | 4 | #include "FluidModel.h" 5 | 6 | namespace PBD 7 | { 8 | class TimeStepFluidModel 9 | { 10 | protected: 11 | int m_velocityUpdateMethod; 12 | 13 | void clearAccelerations(FluidModel &model); 14 | void computeXSPHViscosity(FluidModel &model); 15 | void computeDensities(FluidModel &model); 16 | void updateTimeStepSizeCFL(FluidModel &model, const Real minTimeStepSize, const Real maxTimeStepSize); 17 | void constraintProjection(FluidModel &model); 18 | 19 | public: 20 | TimeStepFluidModel(); 21 | virtual ~TimeStepFluidModel(void); 22 | 23 | void step(FluidModel &model); 24 | void reset(); 25 | 26 | int getVelocityUpdateMethod() const { return m_velocityUpdateMethod; } 27 | void setVelocityUpdateMethod(int val) { m_velocityUpdateMethod = val; } 28 | }; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Demos/GenericConstraintsDemos/GenericConstraintsModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __GENERICCONSTRAINTSMODEL_H__ 2 | #define __GENERICCONSTRAINTSMODEL_H__ 3 | 4 | #include "Utils/IndexedFaceMesh.h" 5 | #include "Simulation/ParticleData.h" 6 | #include "Simulation/SimulationModel.h" 7 | #include 8 | 9 | namespace PBD 10 | { 11 | class GenericConstraintsModel : public SimulationModel 12 | { 13 | public: 14 | GenericConstraintsModel(); 15 | virtual ~GenericConstraintsModel(); 16 | 17 | virtual void initParameters(); 18 | 19 | bool addGenericDistanceConstraint(const unsigned int particle1, const unsigned int particle2, const Real stiffness); 20 | bool addGenericIsometricBendingConstraint(const unsigned int particle1, const unsigned int particle2, 21 | const unsigned int particle3, const unsigned int particle4, const Real stiffness); 22 | bool addGenericHingeJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos, const Vector3r &axis); 23 | bool addGenericSliderJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos, const Vector3r &axis); 24 | bool addGenericBallJoint(const unsigned int rbIndex1, const unsigned int rbIndex2, const Vector3r &pos); 25 | 26 | virtual void setClothStiffness(Real val); 27 | virtual void setClothBendingStiffness(Real val); 28 | }; 29 | } 30 | 31 | #endif -------------------------------------------------------------------------------- /Demos/PositionBasedElasticRodsDemo/PositionBasedElasticRodsConstraints.h: -------------------------------------------------------------------------------- 1 | #ifndef _POSITIONBASEDELASTICRODSCONSTRAINTS_H 2 | #define _POSITIONBASEDELASTICRODSCONSTRAINTS_H 3 | 4 | #include 5 | #include "Simulation/Constraints.h" 6 | #include "PositionBasedElasticRodsModel.h" 7 | 8 | namespace PBD 9 | { 10 | class SimulationModel; 11 | 12 | class GhostPointEdgeDistanceConstraint : public Constraint 13 | { 14 | public: 15 | static int TYPE_ID; 16 | Real m_restLength; 17 | 18 | GhostPointEdgeDistanceConstraint() : Constraint(3) {} 19 | virtual int &getTypeId() const { return TYPE_ID; } 20 | 21 | bool initConstraint(PositionBasedElasticRodsModel &model, const unsigned int particle1, const unsigned int particle2, const unsigned int particle3); 22 | virtual bool solvePositionConstraint(SimulationModel &model, const unsigned int iter); 23 | }; 24 | 25 | class PerpendiculaBisectorConstraint : public Constraint 26 | { 27 | public: 28 | static int TYPE_ID; 29 | 30 | PerpendiculaBisectorConstraint() : Constraint(3) {} 31 | virtual int &getTypeId() const { return TYPE_ID; } 32 | 33 | bool initConstraint(SimulationModel &model, const unsigned int particle1, const unsigned int particle2, const unsigned int particle3); 34 | virtual bool solvePositionConstraint(SimulationModel &model, const unsigned int iter); 35 | }; 36 | 37 | class DarbouxVectorConstraint : public Constraint 38 | { 39 | public: 40 | static int TYPE_ID; 41 | Matrix3r m_dA; //material frame A 42 | Matrix3r m_dB; //material frame B 43 | 44 | DarbouxVectorConstraint() : Constraint(5) {} 45 | virtual int &getTypeId() const { return TYPE_ID; } 46 | 47 | virtual bool initConstraint(PositionBasedElasticRodsModel &model, const unsigned int particle1, const unsigned int particle2, 48 | const unsigned int particle3, const unsigned int particle4, const unsigned int particle5); 49 | 50 | virtual bool solvePositionConstraint(SimulationModel &model, const unsigned int iter); 51 | }; 52 | 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Demos/PositionBasedElasticRodsDemo/PositionBasedElasticRodsModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __POSITIONBASEDELASTICRODSMODEL_H__ 2 | #define __POSITIONBASEDELASTICRODSMODEL_H__ 3 | 4 | #include "Simulation/ParticleData.h" 5 | #include "Simulation/SimulationModel.h" 6 | #include 7 | 8 | namespace PBD 9 | { 10 | class Constraint; 11 | 12 | class PositionBasedElasticRodsModel : public SimulationModel 13 | { 14 | public: 15 | static int REST_DARBOUX_VECTOR; 16 | 17 | PositionBasedElasticRodsModel(); 18 | virtual ~PositionBasedElasticRodsModel(); 19 | 20 | protected: 21 | ParticleData m_ghostParticles; 22 | Vector3r m_restDarbouxVector; 23 | Vector3r m_stiffness; 24 | 25 | public: 26 | virtual void reset(); 27 | virtual void cleanup(); 28 | virtual void initParameters(); 29 | 30 | ParticleData &getGhostParticles(); 31 | void addElasticRodModel( 32 | const unsigned int nPoints, 33 | Vector3r *points); 34 | 35 | bool addPerpendiculaBisectorConstraint(const unsigned int p0, const unsigned int p1, const unsigned int p2); 36 | bool addGhostPointEdgeDistanceConstraint(const unsigned int pA, const unsigned int pB, const unsigned int pG); 37 | bool addDarbouxVectorConstraint(const unsigned int pA, const unsigned int pB, 38 | const unsigned int pC, const unsigned int pD, const unsigned int pE); 39 | 40 | 41 | void setRestDarbouxVector(const Vector3r &val) { m_restDarbouxVector = val; } 42 | Vector3r &getRestDarbouxVector() { return m_restDarbouxVector; } 43 | void setBendingAndTwistingStiffness(const Vector3r &val) { m_stiffness = val; } 44 | Vector3r &getBendingAndTwistingStiffness() { return m_stiffness; } 45 | 46 | virtual Real getRodBendingStiffnessX() { return m_stiffness[0]; } 47 | virtual void setRodBendingStiffnessX(Real val); 48 | virtual Real getRodBendingStiffnessY() { return m_stiffness[1]; } 49 | virtual void setRodBendingStiffnessY(Real val); 50 | virtual Real getRodTwistingStiffness() { return m_stiffness[2]; } 51 | virtual void setRodTwistingStiffness(Real val); 52 | 53 | }; 54 | } 55 | 56 | #endif -------------------------------------------------------------------------------- /Demos/PositionBasedElasticRodsDemo/PositionBasedElasticRodsTSC.h: -------------------------------------------------------------------------------- 1 | #ifndef __POSITIONBASEDELASTICRODSTSC_H__ 2 | #define __POSITIONBASEDELASTICRODSTSC_H__ 3 | 4 | #include "Simulation/TimeStepController.h" 5 | #include "PositionBasedElasticRodsModel.h" 6 | 7 | namespace PBD 8 | { 9 | class PositionBasedElasticRodsTSC : public TimeStepController 10 | { 11 | protected: 12 | Real m_damping; 13 | virtual void clearAccelerations(SimulationModel &model); 14 | 15 | public: 16 | PositionBasedElasticRodsTSC(); 17 | virtual ~PositionBasedElasticRodsTSC(void); 18 | 19 | virtual void step(SimulationModel &model); 20 | 21 | Real getDamping() const { return m_damping; } 22 | void setDamping(Real val) { m_damping = val; } 23 | }; 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Demos/PositionBasedElasticRodsDemo/ReadMe.txt: -------------------------------------------------------------------------------- 1 | Implementation of "Position Based Elastic Rods" paper 2 | (http://www.nobuyuki-umetani.com/PositionBasedElasticRod/2014_sca_PositionBasedElasticRod.html) 3 | for Position Based Dynamics library (https://github.com/InteractiveComputerGraphics/PositionBasedDynamics): 4 | 5 | The code is based on the implementation of 6 | 7 | Przemyslaw Korzeniowski 8 | Department of Surgery and Cancer 9 | Imperial College London 10 | 11 | http://github.com/korzen/PositionBasedDynamics-ElasticRod 12 | korzenio [at] gmail.com 13 | 14 | 15 | -------------------------------------------------------------------------------- /Demos/Visualization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(VIS_HEADER_FILES 2 | ${PROJECT_PATH}/Demos/Visualization/MiniGL.h 3 | ${PROJECT_PATH}/Demos/Visualization/Selection.h 4 | ${PROJECT_PATH}/Demos/Visualization/Shader.h 5 | ${PROJECT_PATH}/Demos/Visualization/Visualization.h 6 | ) 7 | 8 | 9 | set(VIS_SOURCE_FILES 10 | ${PROJECT_SOURCE_DIR}/extern/glfw/deps/glad_gl.c 11 | ${PROJECT_PATH}/Demos/Visualization/MiniGL.cpp 12 | ${PROJECT_PATH}/Demos/Visualization/Shader.cpp 13 | ) 14 | 15 | 16 | set(VIS_FILES 17 | ${VIS_HEADER_FILES} 18 | ${VIS_SOURCE_FILES} 19 | ) 20 | 21 | # A macro for the source groups 22 | macro(VIS_SOURCE_GROUPS) 23 | source_group("Header Files\\Visualization" FILES ${VIS_HEADER_FILES}) 24 | source_group("Source Files\\Visualization" FILES ${VIS_SOURCE_FILES}) 25 | endmacro(VIS_SOURCE_GROUPS) 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Demos/Visualization/Shader.h: -------------------------------------------------------------------------------- 1 | #ifndef __Shader_h__ 2 | #define __Shader_h__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace PBD 9 | { 10 | class Shader 11 | { 12 | public: 13 | Shader(); 14 | ~Shader(); 15 | 16 | void compileShaderString(GLenum whichShader, const std::string &source); 17 | void compileShaderFile(GLenum whichShader, const std::string &filename); 18 | void createAndLinkProgram(); 19 | void addAttribute(const std::string &attribute); 20 | void addUniform(const std::string &uniform); 21 | bool isInitialized(); 22 | 23 | void begin(); 24 | void end(); 25 | 26 | //An indexer that returns the location of the attribute/uniform 27 | GLuint getAttribute(const std::string &attribute); 28 | GLuint getUniform(const std::string &uniform); 29 | 30 | private: 31 | bool m_initialized; 32 | GLuint m_program; 33 | std::map m_attributes; 34 | std::map m_uniforms; 35 | GLuint m_shaders[3]; 36 | }; 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-present, PositionBasedDynamics contributors 4 | 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 all 13 | 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 THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include data * 2 | -------------------------------------------------------------------------------- /PositionBasedDynamics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(PositionBasedDynamics 2 | ${PROJECT_PATH}/Common/Common.h 3 | 4 | DirectPositionBasedSolverForStiffRodsInterface.h 5 | MathFunctions.cpp 6 | MathFunctions.h 7 | PositionBasedDynamics.cpp 8 | PositionBasedDynamics.h 9 | PositionBasedElasticRods.cpp 10 | PositionBasedElasticRods.h 11 | PositionBasedFluids.cpp 12 | PositionBasedFluids.h 13 | PositionBasedRigidBodyDynamics.cpp 14 | PositionBasedRigidBodyDynamics.h 15 | PositionBasedGenericConstraints.h 16 | SPHKernels.cpp 17 | SPHKernels.h 18 | TimeIntegration.cpp 19 | TimeIntegration.h 20 | XPBD.cpp 21 | XPBD.h 22 | 23 | CMakeLists.txt 24 | ) 25 | 26 | find_package( Eigen3 REQUIRED ) 27 | include_directories( ${EIGEN3_INCLUDE_DIR} ) 28 | 29 | install(TARGETS PositionBasedDynamics 30 | RUNTIME DESTINATION bin 31 | LIBRARY DESTINATION lib 32 | ARCHIVE DESTINATION lib) 33 | 34 | install(DIRECTORY . 35 | DESTINATION include/PositionBasedDynamics 36 | FILES_MATCHING PATTERN "*.h") 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /PositionBasedDynamics/DirectPositionBasedSolverForStiffRodsInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef DIRECT_POSITION_BASED_SOLVER_FOR_STIFF_RODS_INTERFACE 2 | #define DIRECT_POSITION_BASED_SOLVER_FOR_STIFF_RODS_INTERFACE 3 | 4 | #include "Common/Common.h" 5 | 6 | namespace PBD{ 7 | // Implementation of "Direct Position-Based Solver for Stiff Rods" paper 8 | // (https://animation.rwth-aachen.de/publication/0557/) 9 | // 10 | // Implemented by: 11 | // 12 | // Crispin Deul 13 | // Graduate School CE 14 | // Technische Universität Darmstadt 15 | // 16 | // deul[at] gsc.tu-darmstadt.de 17 | // 18 | 19 | 20 | class RodSegment 21 | { 22 | public: 23 | virtual bool isDynamic() = 0; 24 | virtual Real Mass() = 0; 25 | virtual const Vector3r & InertiaTensor() = 0; 26 | virtual const Vector3r & Position() = 0; 27 | virtual const Quaternionr & Rotation() = 0; 28 | }; 29 | 30 | class RodConstraint 31 | { 32 | public: 33 | using Vector6r = Eigen::Matrix; 34 | virtual unsigned int segmentIndex(unsigned int i) = 0; 35 | virtual Eigen::Matrix & getConstraintInfo() = 0; 36 | virtual Real getAverageSegmentLength() = 0; 37 | virtual Vector3r &getRestDarbouxVector() = 0; 38 | virtual Vector3r &getStiffnessCoefficientK() = 0; 39 | virtual Vector3r & getStretchCompliance() = 0; 40 | virtual Vector3r & getBendingAndTorsionCompliance() = 0; 41 | }; 42 | } 43 | #endif 44 | -------------------------------------------------------------------------------- /PositionBasedDynamics/MathFunctions.h: -------------------------------------------------------------------------------- 1 | #ifndef MATH_FUNCTIONS_H 2 | #define MATH_FUNCTIONS_H 3 | 4 | #include "Common/Common.h" 5 | 6 | // ------------------------------------------------------------------------------------ 7 | namespace PBD 8 | { 9 | class MathFunctions 10 | { 11 | private: 12 | static void jacobiRotate(Matrix3r &A, 13 | Matrix3r &R, 14 | int p, 15 | int q); 16 | 17 | public: 18 | static Real infNorm(const Matrix3r &A); 19 | static Real oneNorm(const Matrix3r &A); 20 | 21 | static void eigenDecomposition(const Matrix3r &A, 22 | Matrix3r &eigenVecs, 23 | Vector3r &eigenVals); 24 | 25 | static void polarDecomposition(const Matrix3r &A, 26 | Matrix3r &R, 27 | Matrix3r &U, 28 | Matrix3r &D); 29 | 30 | static void polarDecompositionStable(const Matrix3r &M, 31 | const Real tolerance, 32 | Matrix3r &R); 33 | 34 | static void svdWithInversionHandling(const Matrix3r &A, 35 | Vector3r &sigma, 36 | Matrix3r &U, 37 | Matrix3r &VT); 38 | 39 | static Real cotTheta(const Vector3r &v, const Vector3r &w); 40 | 41 | /** Computes the cross product matrix of a vector. 42 | * @param v input vector 43 | * @param v_hat resulting cross product matrix 44 | */ 45 | static void crossProductMatrix(const Vector3r &v, Matrix3r &v_hat); 46 | 47 | /** Implementation of the paper: \n 48 | * Matthias Müller, Jan Bender, Nuttapong Chentanez and Miles Macklin, 49 | * "A Robust Method to Extract the Rotational Part of Deformations", 50 | * ACM SIGGRAPH Motion in Games, 2016 51 | */ 52 | static void extractRotation(const Matrix3r &A, Quaternionr &q, const unsigned int maxIter); 53 | }; 54 | } 55 | 56 | #endif -------------------------------------------------------------------------------- /PositionBasedDynamics/SPHKernels.cpp: -------------------------------------------------------------------------------- 1 | #include "SPHKernels.h" 2 | 3 | using namespace PBD; 4 | 5 | Real CubicKernel::m_radius; 6 | Real CubicKernel::m_k; 7 | Real CubicKernel::m_l; 8 | Real CubicKernel::m_W_zero; 9 | -------------------------------------------------------------------------------- /PositionBasedDynamics/SPHKernels.h: -------------------------------------------------------------------------------- 1 | #ifndef SPHKERNELS_H 2 | #define SPHKERNELS_H 3 | 4 | #define _USE_MATH_DEFINES 5 | #include 6 | #include "Common/Common.h" 7 | #include 8 | 9 | #define NO_DISTANCE_TEST 10 | 11 | namespace PBD 12 | { 13 | class CubicKernel 14 | { 15 | protected: 16 | static Real m_radius; 17 | static Real m_k; 18 | static Real m_l; 19 | static Real m_W_zero; 20 | public: 21 | static Real getRadius() { return m_radius; } 22 | static void setRadius(Real val) 23 | { 24 | m_radius = val; 25 | static const Real pi = static_cast(M_PI); 26 | 27 | const Real h3 = m_radius*m_radius*m_radius; 28 | m_k = static_cast(8.0) / (pi*h3); 29 | m_l = static_cast(48.0) / (pi*h3); 30 | m_W_zero = W(Vector3r(0.0, 0.0, 0.0)); 31 | } 32 | 33 | public: 34 | //static unsigned int counter; 35 | static Real W(const Vector3r &r) 36 | { 37 | //counter++; 38 | Real res = 0.0; 39 | const Real rl = r.norm(); 40 | const Real q = rl/m_radius; 41 | #ifndef NO_DISTANCE_TEST 42 | if (q <= 1.0) 43 | #endif 44 | { 45 | if (q <= 0.5) 46 | { 47 | const Real q2 = q*q; 48 | const Real q3 = q2*q; 49 | res = m_k * (static_cast(6.0)*q3- static_cast(6.0)*q2+ static_cast(1.0)); 50 | } 51 | else 52 | { 53 | res = m_k * (static_cast(2.0)*pow(static_cast(1.0)-q,3)); 54 | } 55 | } 56 | return res; 57 | } 58 | 59 | static Vector3r gradW(const Vector3r &r) 60 | { 61 | Vector3r res; 62 | const Real rl = r.norm(); 63 | const Real q = rl / m_radius; 64 | #ifndef NO_DISTANCE_TEST 65 | if (q <= 1.0) 66 | #endif 67 | { 68 | if (rl > 1.0e-6) 69 | { 70 | const Vector3r gradq = r * ((Real) 1.0 / (rl*m_radius)); 71 | if (q <= 0.5) 72 | { 73 | res = m_l*q*((Real) 3.0*q - (Real) 2.0)*gradq; 74 | } 75 | else 76 | { 77 | const Real factor = static_cast(1.0) - q; 78 | res = m_l*(-factor*factor)*gradq; 79 | } 80 | } 81 | } 82 | #ifndef NO_DISTANCE_TEST 83 | else 84 | res.zero(); 85 | #endif 86 | 87 | return res; 88 | } 89 | 90 | static Real W_zero() 91 | { 92 | return m_W_zero; 93 | } 94 | }; 95 | } 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /Simulation/BoundingSphereHierarchy.h: -------------------------------------------------------------------------------- 1 | #ifndef __BOUNDINGSPHEREHIERARCHY_H__ 2 | #define __BOUNDINGSPHEREHIERARCHY_H__ 3 | 4 | #include "Common/Common.h" 5 | #include "BoundingSphere.h" 6 | #include "kdTree.h" 7 | 8 | namespace PBD 9 | { 10 | class PointCloudBSH : public KDTree 11 | { 12 | 13 | public: 14 | 15 | using super = KDTree; 16 | 17 | PointCloudBSH(); 18 | 19 | void init(const Vector3r *vertices, const unsigned int numVertices); 20 | Vector3r const& entity_position(unsigned int i) const final; 21 | void compute_hull(unsigned int b, unsigned int n, BoundingSphere& hull) 22 | const final; 23 | void compute_hull_approx(unsigned int b, unsigned int n, BoundingSphere& hull) 24 | const final; 25 | 26 | private: 27 | const Vector3r *m_vertices; 28 | unsigned int m_numVertices; 29 | }; 30 | 31 | 32 | class TetMeshBSH : public KDTree 33 | { 34 | 35 | public: 36 | 37 | using super = KDTree; 38 | 39 | TetMeshBSH(); 40 | 41 | void init(const Vector3r *vertices, const unsigned int numVertices, const unsigned int *indices, const unsigned int numTets, const Real tolerance); 42 | Vector3r const& entity_position(unsigned int i) const final; 43 | void compute_hull(unsigned int b, unsigned int n, BoundingSphere& hull) 44 | const final; 45 | void compute_hull_approx(unsigned int b, unsigned int n, BoundingSphere& hull) 46 | const final; 47 | void updateVertices(const Vector3r* vertices); 48 | 49 | private: 50 | const Vector3r *m_vertices; 51 | unsigned int m_numVertices; 52 | const unsigned int *m_indices; 53 | unsigned int m_numTets; 54 | Real m_tolerance; 55 | std::vector m_com; 56 | }; 57 | 58 | class BVHTest 59 | { 60 | public: 61 | using TraversalCallback = std::function ; 62 | 63 | static void traverse(PointCloudBSH const& b1, TetMeshBSH const& b2, TraversalCallback func); 64 | static void traverse(PointCloudBSH const& b1, const unsigned int node_index1, TetMeshBSH const& b2, const unsigned int node_index2, TraversalCallback func); 65 | }; 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /Simulation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Simulation 2 | AABB.h 3 | CollisionDetection.cpp 4 | CollisionDetection.h 5 | Constraints.cpp 6 | Constraints.h 7 | CubicSDFCollisionDetection.cpp 8 | CubicSDFCollisionDetection.h 9 | DistanceFieldCollisionDetection.cpp 10 | DistanceFieldCollisionDetection.h 11 | IDFactory.cpp 12 | IDFactory.h 13 | LineModel.cpp 14 | LineModel.h 15 | NeighborhoodSearchSpatialHashing.cpp 16 | NeighborhoodSearchSpatialHashing.h 17 | ParticleData.h 18 | RigidBody.h 19 | RigidBodyGeometry.cpp 20 | RigidBodyGeometry.h 21 | Simulation.cpp 22 | Simulation.h 23 | SimulationModel.cpp 24 | SimulationModel.h 25 | TetModel.cpp 26 | TetModel.h 27 | TimeManager.cpp 28 | TimeManager.h 29 | TimeStep.cpp 30 | TimeStep.h 31 | TimeStepController.cpp 32 | TimeStepController.h 33 | TriangleModel.cpp 34 | TriangleModel.h 35 | 36 | BoundingSphere.h 37 | BoundingSphereHierarchy.cpp 38 | BoundingSphereHierarchy.h 39 | kdTree.h 40 | kdTree.inl 41 | 42 | CMakeLists.txt 43 | ) 44 | 45 | ############################################################ 46 | # Discregrid 47 | ############################################################ 48 | target_include_directories(Simulation PUBLIC ${Discregrid_INCLUDE_DIR}) 49 | if (TARGET Ext_Discregrid) 50 | add_dependencies(Simulation Ext_Discregrid) 51 | endif() 52 | 53 | 54 | ############################################################ 55 | # GenericParameters 56 | ############################################################ 57 | target_include_directories(Simulation PUBLIC ${GenericParameters_INCLUDE_DIR}) 58 | if(TARGET Ext_GenericParameters) 59 | add_dependencies(Simulation Ext_GenericParameters) 60 | endif() 61 | 62 | find_package( Eigen3 REQUIRED ) 63 | target_include_directories(Simulation PUBLIC ${EIGEN3_INCLUDE_DIR} ) 64 | 65 | target_link_libraries(Simulation PUBLIC PositionBasedDynamics) 66 | 67 | 68 | install(TARGETS Simulation 69 | RUNTIME DESTINATION bin 70 | LIBRARY DESTINATION lib 71 | ARCHIVE DESTINATION lib) 72 | 73 | install(DIRECTORY . 74 | DESTINATION include/Simulation 75 | FILES_MATCHING PATTERN "*.h" PATTERN "*.inl") -------------------------------------------------------------------------------- /Simulation/CubicSDFCollisionDetection.h: -------------------------------------------------------------------------------- 1 | #ifndef _CubicSDFCollisionDetection_H 2 | #define _CubicSDFCollisionDetection_H 3 | 4 | #include "Common/Common.h" 5 | #include "Simulation/DistanceFieldCollisionDetection.h" 6 | #include 7 | 8 | #include "Discregrid/All" 9 | 10 | namespace PBD 11 | { 12 | /** Collision detection based on cubic signed distance fields. 13 | */ 14 | class CubicSDFCollisionDetection : public DistanceFieldCollisionDetection 15 | { 16 | public: 17 | using Grid = Discregrid::CubicLagrangeDiscreteGrid; 18 | using GridPtr = std::shared_ptr; 19 | 20 | struct CubicSDFCollisionObject : public DistanceFieldCollisionDetection::DistanceFieldCollisionObject 21 | { 22 | std::string m_sdfFile; 23 | Vector3r m_scale; 24 | GridPtr m_sdf; 25 | static int TYPE_ID; 26 | 27 | CubicSDFCollisionObject(); 28 | virtual ~CubicSDFCollisionObject(); 29 | virtual int &getTypeId() const { return TYPE_ID; } 30 | virtual bool collisionTest(const Vector3r &x, const Real tolerance, Vector3r &cp, Vector3r &n, Real &dist, const Real maxDist = 0.0); 31 | virtual double distance(const Eigen::Vector3d &x, const Real tolerance); 32 | }; 33 | 34 | public: 35 | CubicSDFCollisionDetection(); 36 | virtual ~CubicSDFCollisionDetection(); 37 | 38 | virtual bool isDistanceFieldCollisionObject(CollisionObject *co) const; 39 | 40 | void addCubicSDFCollisionObject(const unsigned int bodyIndex, const unsigned int bodyType, const Vector3r *vertices, const unsigned int numVertices, const std::string &sdfFile, const Vector3r &scale, const bool testMesh = true, const bool invertSDF = false); 41 | void addCubicSDFCollisionObject(const unsigned int bodyIndex, const unsigned int bodyType, const Vector3r *vertices, const unsigned int numVertices, GridPtr sdf, const Vector3r &scale, const bool testMesh = true, const bool invertSDF = false); 42 | }; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Simulation/IDFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "IDFactory.h" 2 | 3 | using namespace PBD; 4 | 5 | int IDFactory::id = 0; 6 | 7 | -------------------------------------------------------------------------------- /Simulation/IDFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef __IDFACTORY_H__ 2 | #define __IDFACTORY_H__ 3 | 4 | namespace PBD 5 | { 6 | /** Factory for unique ids. 7 | */ 8 | class IDFactory 9 | { 10 | private: 11 | /** Current id */ 12 | static int id; 13 | 14 | public: 15 | static int getId() { return id++; } 16 | }; 17 | } 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /Simulation/LineModel.cpp: -------------------------------------------------------------------------------- 1 | #include "LineModel.h" 2 | #include "PositionBasedDynamics/PositionBasedRigidBodyDynamics.h" 3 | #include "PositionBasedDynamics/PositionBasedDynamics.h" 4 | #include "TriangleModel.h" 5 | 6 | using namespace PBD; 7 | 8 | LineModel::LineModel() 9 | { 10 | m_restitutionCoeff = static_cast(0.6); 11 | m_frictionCoeff = static_cast(0.2); 12 | } 13 | 14 | LineModel::~LineModel(void) 15 | { 16 | 17 | } 18 | 19 | LineModel::Edges& LineModel::getEdges() 20 | { 21 | return m_edges; 22 | } 23 | 24 | void LineModel::initMesh(const unsigned int nPoints, const unsigned int nQuaternions, const unsigned int indexOffset, const unsigned int indexOffsetQuaternions, unsigned int* indices, unsigned int* indicesQuaternions) 25 | { 26 | m_nPoints = nPoints; 27 | m_nQuaternions = nQuaternions; 28 | m_indexOffset = indexOffset; 29 | m_indexOffsetQuaternions = indexOffsetQuaternions; 30 | 31 | m_edges.resize(nPoints - 1); 32 | 33 | for (unsigned int i = 0; i < nPoints-1; i++) 34 | { 35 | m_edges[i] = OrientedEdge(indices[2*i], indices[2*i + 1], indicesQuaternions[i]); 36 | } 37 | } 38 | 39 | unsigned int LineModel::getIndexOffset() const 40 | { 41 | return m_indexOffset; 42 | } 43 | 44 | unsigned LineModel::getIndexOffsetQuaternions() const 45 | { 46 | return m_indexOffsetQuaternions; 47 | } -------------------------------------------------------------------------------- /Simulation/LineModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINEMODEL_H__ 2 | #define __LINEMODEL_H__ 3 | 4 | #include "Common/Common.h" 5 | #include 6 | #include "Simulation/RigidBody.h" 7 | #include "Utils/IndexedFaceMesh.h" 8 | #include "Simulation/ParticleData.h" 9 | #include "Constraints.h" 10 | 11 | namespace PBD 12 | { 13 | class LineModel 14 | { 15 | struct OrientedEdge 16 | { 17 | OrientedEdge(){} 18 | OrientedEdge(unsigned int p0, unsigned int p1, unsigned int q0) 19 | { 20 | m_vert[0] = p0; 21 | m_vert[1] = p1; 22 | m_quat = q0; 23 | } 24 | unsigned int m_vert[2]; 25 | unsigned int m_quat; 26 | }; 27 | 28 | public: 29 | typedef std::vector Edges; 30 | 31 | LineModel(); 32 | virtual ~LineModel(); 33 | 34 | protected: 35 | /** offset which must be added to get the correct index in the particles array */ 36 | unsigned int m_indexOffset; 37 | /** offset which must be added to get the correct index in the quaternions array */ 38 | unsigned int m_indexOffsetQuaternions; 39 | unsigned int m_nPoints, m_nQuaternions; 40 | Edges m_edges; 41 | Real m_restitutionCoeff; 42 | Real m_frictionCoeff; 43 | 44 | public: 45 | void updateConstraints(); 46 | 47 | Edges &getEdges(); 48 | 49 | unsigned int getIndexOffset() const; 50 | unsigned int getIndexOffsetQuaternions() const; 51 | 52 | void initMesh(const unsigned int nPoints, const unsigned int nQuaternions, const unsigned int indexOffset, const unsigned int indexOffsetQuaternions, unsigned int* indices, unsigned int* indicesQuaternions); 53 | 54 | FORCE_INLINE Real getRestitutionCoeff() const 55 | { 56 | return m_restitutionCoeff; 57 | } 58 | 59 | FORCE_INLINE void setRestitutionCoeff(Real val) 60 | { 61 | m_restitutionCoeff = val; 62 | } 63 | 64 | FORCE_INLINE Real getFrictionCoeff() const 65 | { 66 | return m_frictionCoeff; 67 | } 68 | 69 | FORCE_INLINE void setFrictionCoeff(Real val) 70 | { 71 | m_frictionCoeff = val; 72 | } 73 | }; 74 | } 75 | 76 | #endif -------------------------------------------------------------------------------- /Simulation/RigidBodyGeometry.cpp: -------------------------------------------------------------------------------- 1 | #include "RigidBodyGeometry.h" 2 | 3 | using namespace PBD; 4 | 5 | RigidBodyGeometry::RigidBodyGeometry() : 6 | m_mesh() 7 | { 8 | } 9 | 10 | RigidBodyGeometry::~RigidBodyGeometry(void) 11 | { 12 | m_mesh.release(); 13 | } 14 | 15 | RigidBodyGeometry::Mesh &RigidBodyGeometry::getMesh() 16 | { 17 | return m_mesh; 18 | } 19 | 20 | void RigidBodyGeometry::initMesh(const unsigned int nVertices, const unsigned int nFaces, const Vector3r *vertices, const unsigned int* indices, const Mesh::UVIndices& uvIndices, const Mesh::UVs& uvs, const Vector3r &scale, const bool flatShading) 21 | { 22 | m_mesh.release(); 23 | m_mesh.initMesh(nVertices, nFaces * 2, nFaces); 24 | m_vertexData_local.resize(nVertices); 25 | m_vertexData.resize(nVertices); 26 | m_mesh.setFlatShading(flatShading); 27 | for (unsigned int i = 0; i < nVertices; i++) 28 | { 29 | m_vertexData_local.getPosition(i) = vertices[i].cwiseProduct(scale); 30 | m_vertexData.getPosition(i) = m_vertexData_local.getPosition(i); 31 | } 32 | 33 | for (unsigned int i = 0; i < nFaces; i++) 34 | { 35 | m_mesh.addFace(&indices[3 * i]); 36 | } 37 | m_mesh.copyUVs(uvIndices, uvs); 38 | m_mesh.buildNeighbors(); 39 | updateMeshNormals(m_vertexData); 40 | } 41 | 42 | void RigidBodyGeometry::updateMeshNormals(const VertexData &vd) 43 | { 44 | m_mesh.updateNormals(vd, 0); 45 | m_mesh.updateVertexNormals(vd); 46 | } 47 | 48 | void RigidBodyGeometry::updateMeshTransformation(const Vector3r &x, const Matrix3r &R) 49 | { 50 | for (unsigned int i = 0; i < m_vertexData_local.size(); i++) 51 | { 52 | m_vertexData.getPosition(i) = R * m_vertexData_local.getPosition(i) + x; 53 | } 54 | updateMeshNormals(m_vertexData); 55 | } 56 | 57 | VertexData & RigidBodyGeometry::getVertexData() 58 | { 59 | return m_vertexData; 60 | } 61 | 62 | const VertexData & RigidBodyGeometry::getVertexData() const 63 | { 64 | return m_vertexData; 65 | } 66 | 67 | VertexData & RigidBodyGeometry::getVertexDataLocal() 68 | { 69 | return m_vertexData_local; 70 | } 71 | 72 | const VertexData & RigidBodyGeometry::getVertexDataLocal() const 73 | { 74 | return m_vertexData_local; 75 | } 76 | -------------------------------------------------------------------------------- /Simulation/RigidBodyGeometry.h: -------------------------------------------------------------------------------- 1 | #ifndef __RIGIDBODYGEOMETRY_H__ 2 | #define __RIGIDBODYGEOMETRY_H__ 3 | 4 | #include "Common/Common.h" 5 | #include "Utils/IndexedFaceMesh.h" 6 | #include "Simulation/ParticleData.h" 7 | #include 8 | 9 | namespace PBD 10 | { 11 | class RigidBodyGeometry 12 | { 13 | public: 14 | RigidBodyGeometry(); 15 | virtual ~RigidBodyGeometry(); 16 | 17 | typedef Utilities::IndexedFaceMesh Mesh; 18 | 19 | protected: 20 | Mesh m_mesh; 21 | VertexData m_vertexData_local; 22 | VertexData m_vertexData; 23 | 24 | public: 25 | Mesh &getMesh(); 26 | VertexData &getVertexData(); 27 | const VertexData &getVertexData() const; 28 | VertexData &getVertexDataLocal(); 29 | const VertexData &getVertexDataLocal() const; 30 | 31 | void initMesh(const unsigned int nVertices, const unsigned int nFaces, const Vector3r *vertices, const unsigned int* indices, const Mesh::UVIndices& uvIndices, const Mesh::UVs& uvs, const Vector3r &scale = Vector3r(1.0, 1.0, 1.0), const bool flatShading = false); 32 | void updateMeshTransformation(const Vector3r &x, const Matrix3r &R); 33 | void updateMeshNormals(const VertexData &vd); 34 | 35 | }; 36 | } 37 | 38 | #endif -------------------------------------------------------------------------------- /Simulation/Simulation.cpp: -------------------------------------------------------------------------------- 1 | #include "Simulation.h" 2 | #include "TimeManager.h" 3 | #include "Utils/Timing.h" 4 | #include "TimeStep.h" 5 | #include "TimeStepController.h" 6 | 7 | using namespace PBD; 8 | using namespace std; 9 | using namespace GenParam; 10 | 11 | Simulation* Simulation::current = nullptr; 12 | int Simulation::GRAVITATION = -1; 13 | 14 | Simulation::Simulation () 15 | { 16 | m_gravitation = Vector3r(0.0, -9.81, 0.0); 17 | 18 | m_timeStep = nullptr; 19 | m_model = nullptr; 20 | } 21 | 22 | Simulation::~Simulation () 23 | { 24 | delete m_timeStep; 25 | delete TimeManager::getCurrent(); 26 | 27 | current = nullptr; 28 | } 29 | 30 | Simulation* Simulation::getCurrent () 31 | { 32 | if (current == nullptr) 33 | { 34 | current = new Simulation (); 35 | current->init(); 36 | } 37 | return current; 38 | } 39 | 40 | void Simulation::setCurrent (Simulation* tm) 41 | { 42 | current = tm; 43 | } 44 | 45 | bool Simulation::hasCurrent() 46 | { 47 | return (current != nullptr); 48 | } 49 | 50 | void Simulation::init() 51 | { 52 | initParameters(); 53 | 54 | m_timeStep = new TimeStepController(); 55 | m_timeStep->init(); 56 | TimeManager::getCurrent()->setTimeStepSize(static_cast(0.005)); 57 | } 58 | 59 | void Simulation::initParameters() 60 | { 61 | ParameterObject::initParameters(); 62 | 63 | GRAVITATION = createVectorParameter("gravitation", "Gravitation", 3u, m_gravitation.data()); 64 | setGroup(GRAVITATION, "Simulation|General"); 65 | setDescription(GRAVITATION, "Vector to define the gravitational acceleration."); 66 | } 67 | 68 | void Simulation::reset() 69 | { 70 | m_model->reset(); 71 | if (m_timeStep) 72 | m_timeStep->reset(); 73 | 74 | TimeManager::getCurrent()->setTime(static_cast(0.0)); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /Simulation/Simulation.h: -------------------------------------------------------------------------------- 1 | #ifndef __Simulation_h__ 2 | #define __Simulation_h__ 3 | 4 | #include "Common/Common.h" 5 | #include "SimulationModel.h" 6 | #include "ParameterObject.h" 7 | #include "TimeStep.h" 8 | 9 | 10 | namespace PBD 11 | { 12 | /** \brief Class to manage the current simulation time and the time step size. 13 | * This class is a singleton. 14 | */ 15 | class Simulation : public GenParam::ParameterObject 16 | { 17 | public: 18 | static int GRAVITATION; 19 | 20 | protected: 21 | SimulationModel *m_model; 22 | TimeStep *m_timeStep; 23 | Vector3r m_gravitation; 24 | 25 | virtual void initParameters(); 26 | 27 | 28 | private: 29 | static Simulation *current; 30 | 31 | public: 32 | Simulation (); 33 | Simulation(const Simulation&) = delete; 34 | Simulation& operator=(const Simulation&) = delete; 35 | ~Simulation (); 36 | 37 | void init(); 38 | void reset(); 39 | 40 | // Singleton 41 | static Simulation* getCurrent (); 42 | static void setCurrent (Simulation* tm); 43 | static bool hasCurrent(); 44 | 45 | SimulationModel *getModel() { return m_model; } 46 | void setModel(SimulationModel *model) { m_model = model; } 47 | 48 | TimeStep *getTimeStep() { return m_timeStep; } 49 | void setTimeStep(TimeStep *ts) { m_timeStep = ts; } 50 | }; 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Simulation/TimeManager.cpp: -------------------------------------------------------------------------------- 1 | #include "TimeManager.h" 2 | 3 | using namespace PBD; 4 | 5 | TimeManager* TimeManager::current = 0; 6 | 7 | TimeManager::TimeManager () 8 | { 9 | time = 0; 10 | h = static_cast(0.005); 11 | } 12 | 13 | TimeManager::~TimeManager () 14 | { 15 | current = 0; 16 | } 17 | 18 | TimeManager* TimeManager::getCurrent () 19 | { 20 | if (current == 0) 21 | { 22 | current = new TimeManager (); 23 | } 24 | return current; 25 | } 26 | 27 | void TimeManager::setCurrent (TimeManager* tm) 28 | { 29 | current = tm; 30 | } 31 | 32 | bool TimeManager::hasCurrent() 33 | { 34 | return (current != 0); 35 | } 36 | 37 | Real TimeManager::getTime() 38 | { 39 | return time; 40 | } 41 | 42 | void TimeManager::setTime(Real t) 43 | { 44 | time = t; 45 | } 46 | 47 | Real TimeManager::getTimeStepSize() 48 | { 49 | return h; 50 | } 51 | 52 | void TimeManager::setTimeStepSize(Real tss) 53 | { 54 | h = tss; 55 | } 56 | -------------------------------------------------------------------------------- /Simulation/TimeManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _TIMEMANAGER_H 2 | #define _TIMEMANAGER_H 3 | 4 | #include "Common/Common.h" 5 | 6 | namespace PBD 7 | { 8 | class TimeManager 9 | { 10 | private: 11 | Real time; 12 | static TimeManager *current; 13 | Real h; 14 | 15 | public: 16 | TimeManager (); 17 | ~TimeManager (); 18 | 19 | // Singleton 20 | static TimeManager* getCurrent (); 21 | static void setCurrent (TimeManager* tm); 22 | static bool hasCurrent(); 23 | 24 | Real getTime(); 25 | void setTime(Real t); 26 | Real getTimeStepSize(); 27 | void setTimeStepSize(Real tss); 28 | }; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Simulation/TimeStep.h: -------------------------------------------------------------------------------- 1 | #ifndef __TimeStep_h__ 2 | #define __TimeStep_h__ 3 | 4 | #include "Common/Common.h" 5 | #include "SimulationModel.h" 6 | #include "CollisionDetection.h" 7 | #include "ParameterObject.h" 8 | 9 | namespace PBD 10 | { 11 | /** \brief Base class for the simulation methods. 12 | */ 13 | class TimeStep : public GenParam::ParameterObject 14 | { 15 | protected: 16 | CollisionDetection *m_collisionDetection; 17 | 18 | /** Clear accelerations and add gravitation. 19 | */ 20 | void clearAccelerations(SimulationModel &model); 21 | 22 | virtual void initParameters(); 23 | 24 | static void contactCallbackFunction(const unsigned int contactType, 25 | const unsigned int bodyIndex1, const unsigned int bodyIndex2, 26 | const Vector3r &cp1, const Vector3r &cp2, 27 | const Vector3r &normal, const Real dist, 28 | const Real restitutionCoeff, const Real frictionCoeff, void *userData); 29 | 30 | static void solidContactCallbackFunction(const unsigned int contactType, 31 | const unsigned int bodyIndex1, const unsigned int bodyIndex2, 32 | const unsigned int tetIndex, const Vector3r &bary, 33 | const Vector3r &cp1, const Vector3r &cp2, 34 | const Vector3r &normal, const Real dist, 35 | const Real restitutionCoeff, const Real frictionCoeff, void *userData); 36 | 37 | public: 38 | TimeStep(); 39 | virtual ~TimeStep(void); 40 | 41 | virtual void step(SimulationModel &model) = 0; 42 | virtual void reset(); 43 | 44 | virtual void init(); 45 | 46 | void setCollisionDetection(SimulationModel &model, CollisionDetection *cd); 47 | CollisionDetection *getCollisionDetection(); 48 | }; 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Simulation/TimeStepController.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIMESTEPCONTROLLER_h__ 2 | #define __TIMESTEPCONTROLLER_h__ 3 | 4 | #include "Common/Common.h" 5 | #include "TimeStep.h" 6 | #include "SimulationModel.h" 7 | #include "CollisionDetection.h" 8 | 9 | namespace PBD 10 | { 11 | class TimeStepController : public TimeStep 12 | { 13 | public: 14 | // static int SOLVER_ITERATIONS; 15 | // static int SOLVER_ITERATIONS_V; 16 | static int NUM_SUB_STEPS; 17 | static int MAX_ITERATIONS; 18 | static int MAX_ITERATIONS_V; 19 | static int VELOCITY_UPDATE_METHOD; 20 | 21 | static int ENUM_VUPDATE_FIRST_ORDER; 22 | static int ENUM_VUPDATE_SECOND_ORDER; 23 | 24 | protected: 25 | int m_velocityUpdateMethod; 26 | unsigned int m_iterations; 27 | unsigned int m_iterationsV; 28 | unsigned int m_subSteps; 29 | unsigned int m_maxIterations; 30 | unsigned int m_maxIterationsV; 31 | 32 | virtual void initParameters(); 33 | 34 | void positionConstraintProjection(SimulationModel &model); 35 | void velocityConstraintProjection(SimulationModel &model); 36 | 37 | 38 | public: 39 | TimeStepController(); 40 | virtual ~TimeStepController(void); 41 | 42 | virtual void step(SimulationModel &model); 43 | virtual void reset(); 44 | }; 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Simulation/TriangleModel.cpp: -------------------------------------------------------------------------------- 1 | #include "TriangleModel.h" 2 | #include "PositionBasedDynamics/PositionBasedRigidBodyDynamics.h" 3 | #include "PositionBasedDynamics/PositionBasedDynamics.h" 4 | 5 | using namespace PBD; 6 | 7 | TriangleModel::TriangleModel() : 8 | m_particleMesh() 9 | { 10 | m_restitutionCoeff = static_cast(0.6); 11 | m_frictionCoeff = static_cast(0.2); 12 | } 13 | 14 | TriangleModel::~TriangleModel(void) 15 | { 16 | cleanupModel(); 17 | } 18 | 19 | void TriangleModel::cleanupModel() 20 | { 21 | m_particleMesh.release(); 22 | } 23 | 24 | void TriangleModel::updateMeshNormals(const ParticleData &pd) 25 | { 26 | m_particleMesh.updateNormals(pd, m_indexOffset); 27 | m_particleMesh.updateVertexNormals(pd); 28 | } 29 | 30 | void TriangleModel::initMesh(const unsigned int nPoints, const unsigned int nFaces, const unsigned int indexOffset, unsigned int* indices, const ParticleMesh::UVIndices& uvIndices, const ParticleMesh::UVs& uvs) 31 | { 32 | m_indexOffset = indexOffset; 33 | m_particleMesh.release(); 34 | 35 | m_particleMesh.initMesh(nPoints, nFaces * 2, nFaces); 36 | 37 | for (unsigned int i = 0; i < nFaces; i++) 38 | { 39 | m_particleMesh.addFace(&indices[3 * i]); 40 | } 41 | m_particleMesh.copyUVs(uvIndices, uvs); 42 | m_particleMesh.buildNeighbors(); 43 | } 44 | 45 | unsigned int TriangleModel::getIndexOffset() const 46 | { 47 | return m_indexOffset; 48 | } 49 | -------------------------------------------------------------------------------- /Simulation/TriangleModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRIANGLEMODEL_H__ 2 | #define __TRIANGLEMODEL_H__ 3 | 4 | #include "Common/Common.h" 5 | #include 6 | #include "Simulation/RigidBody.h" 7 | #include "Utils/IndexedFaceMesh.h" 8 | #include "Simulation/ParticleData.h" 9 | #include "Constraints.h" 10 | 11 | namespace PBD 12 | { 13 | class TriangleModel 14 | { 15 | public: 16 | TriangleModel(); 17 | virtual ~TriangleModel(); 18 | 19 | typedef Utilities::IndexedFaceMesh ParticleMesh; 20 | 21 | protected: 22 | /** offset which must be added to get the correct index in the particles array */ 23 | unsigned int m_indexOffset; 24 | /** Face mesh of particles which represents the simulation model */ 25 | ParticleMesh m_particleMesh; 26 | Real m_restitutionCoeff; 27 | Real m_frictionCoeff; 28 | 29 | public: 30 | ParticleMesh &getParticleMesh() { return m_particleMesh; } 31 | const ParticleMesh& getParticleMesh() const { return m_particleMesh; } 32 | 33 | void cleanupModel(); 34 | 35 | unsigned int getIndexOffset() const; 36 | 37 | void initMesh(const unsigned int nPoints, const unsigned int nFaces, const unsigned int indexOffset, unsigned int* indices, const ParticleMesh::UVIndices& uvIndices, const ParticleMesh::UVs& uvs); 38 | void updateMeshNormals(const ParticleData &pd); 39 | 40 | FORCE_INLINE Real getRestitutionCoeff() const 41 | { 42 | return m_restitutionCoeff; 43 | } 44 | 45 | FORCE_INLINE void setRestitutionCoeff(Real val) 46 | { 47 | m_restitutionCoeff = val; 48 | } 49 | 50 | FORCE_INLINE Real getFrictionCoeff() const 51 | { 52 | return m_frictionCoeff; 53 | } 54 | 55 | FORCE_INLINE void setFrictionCoeff(Real val) 56 | { 57 | m_frictionCoeff = val; 58 | } 59 | }; 60 | } 61 | 62 | #endif -------------------------------------------------------------------------------- /Utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(GetGitRevisionDescription) 2 | get_git_head_revision(GIT_REFSPEC GIT_SHA1) 3 | git_local_changes(GIT_LOCAL_CHANGES) 4 | if (${GIT_LOCAL_CHANGES} STREQUAL "DIRTY") 5 | set(COMPILER_MESSAGE "#pragma WARNING(Local changes not committed.)") 6 | endif() 7 | 8 | file (STRINGS "../version.txt" PBD_VERSION) 9 | 10 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/Version.h @ONLY) 11 | 12 | add_library(Utils 13 | FileSystem.h 14 | Hashmap.h 15 | IndexedFaceMesh.cpp 16 | IndexedFaceMesh.h 17 | IndexedTetMesh.cpp 18 | IndexedTetMesh.h 19 | Logger.h 20 | OBJLoader.h 21 | PLYLoader.h 22 | SceneLoader.cpp 23 | SceneLoader.h 24 | StringTools.h 25 | SystemInfo.h 26 | TetGenLoader.cpp 27 | TetGenLoader.h 28 | Timing.h 29 | Version.h 30 | VolumeIntegration.cpp 31 | VolumeIntegration.h 32 | 33 | CMakeLists.txt 34 | ) 35 | 36 | ############################################################ 37 | # GenericParameters 38 | ############################################################ 39 | include_directories(${GenericParameters_INCLUDE_DIR}) 40 | if(TARGET Ext_GenericParameters) 41 | add_dependencies(Utils Ext_GenericParameters) 42 | endif() 43 | 44 | find_package( Eigen3 REQUIRED ) 45 | include_directories( ${EIGEN3_INCLUDE_DIR} ) 46 | 47 | install(TARGETS Utils 48 | RUNTIME DESTINATION bin 49 | LIBRARY DESTINATION lib 50 | ARCHIVE DESTINATION lib) 51 | 52 | install(DIRECTORY . 53 | DESTINATION include/Utils 54 | FILES_MATCHING PATTERN "*.h") 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Utils/PLYLoader.h: -------------------------------------------------------------------------------- 1 | #ifndef __PLYLoader_h__ 2 | #define __PLYLoader_h__ 3 | 4 | #include 5 | #include "Logger.h" 6 | #include "extern/happly/happly.h" 7 | #include 8 | 9 | namespace Utilities 10 | { 11 | /** \brief Read for PLY files. 12 | */ 13 | class PLYLoader 14 | { 15 | public: 16 | /** This function loads an PLY file. 17 | * Only triangulated meshes are supported. 18 | */ 19 | 20 | static void loadPly(const std::string &filename, std::vector> &x, std::vector> &faces, const std::array&scale) 21 | { 22 | LOG_INFO << "Loading " << filename; 23 | 24 | happly::PLYData plyIn(filename.c_str()); 25 | std::vector> vPos = plyIn.getVertexPositions(); 26 | std::vector> fInd = plyIn.getFaceIndices(); 27 | 28 | x.resize(vPos.size()); 29 | for (unsigned int i = 0; i < vPos.size(); i++) 30 | { 31 | x[i] = { 32 | scale[0] * static_cast(vPos[i][0]), 33 | scale[1] * static_cast(vPos[i][1]), 34 | scale[2] * static_cast(vPos[i][2]) 35 | }; 36 | } 37 | 38 | faces.resize(fInd.size()); 39 | for (unsigned int i = 0; i < fInd.size(); i++) 40 | faces[i] = { static_cast(fInd[i][0]), static_cast(fInd[i][1]), static_cast(fInd[i][2]) }; 41 | } 42 | 43 | }; 44 | } 45 | 46 | #endif -------------------------------------------------------------------------------- /Utils/StringTools.h: -------------------------------------------------------------------------------- 1 | #ifndef __StringTools_h__ 2 | #define __StringTools_h__ 3 | 4 | #include 5 | #include 6 | 7 | namespace Utilities 8 | { 9 | /** \brief Tools to handle std::string objects 10 | */ 11 | class StringTools 12 | { 13 | public: 14 | 15 | static void tokenize(const std::string& str, std::vector& tokens, const std::string& delimiters = " ") 16 | { 17 | std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); 18 | std::string::size_type pos = str.find_first_of(delimiters, lastPos); 19 | 20 | while (std::string::npos != pos || std::string::npos != lastPos) 21 | { 22 | tokens.push_back(str.substr(lastPos, pos - lastPos)); 23 | lastPos = str.find_first_not_of(delimiters, pos); 24 | pos = str.find_first_of(delimiters, lastPos); 25 | } 26 | } 27 | 28 | }; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Utils/SystemInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef __SystemInfo_h__ 2 | #define __SystemInfo_h__ 3 | 4 | #if WIN32 5 | #define NOMINMAX 6 | #include "windows.h" 7 | #else 8 | #include 9 | #include 10 | #endif 11 | 12 | namespace Utilities 13 | { 14 | class SystemInfo 15 | { 16 | public: 17 | static std::string getHostName() 18 | { 19 | #ifdef WIN32 20 | const unsigned int bufferSize = 32767; 21 | TCHAR infoBuf[bufferSize]; 22 | DWORD bufCharCount = bufferSize; 23 | if (!GetComputerName(infoBuf, &bufCharCount)) 24 | return ""; 25 | return infoBuf; 26 | #else 27 | const unsigned int bufferSize = 32767; 28 | char hostname[bufferSize]; 29 | gethostname(hostname, bufferSize); 30 | return hostname; 31 | #endif 32 | } 33 | }; 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Utils/TetGenLoader.h: -------------------------------------------------------------------------------- 1 | #ifndef __TETGENLOADER_H__ 2 | #define __TETGENLOADER_H__ 3 | 4 | #include 5 | #include 6 | #include "Common/Common.h" 7 | 8 | 9 | namespace Utilities 10 | { 11 | class TetGenLoader 12 | { 13 | public: 14 | static void loadTetFile(const std::string &filename, std::vector& vertices, std::vector& tets); 15 | static void loadTetgenModel(const std::string &nodeFilename, const std::string &eleFilename, std::vector& vertices, std::vector& tets); 16 | static void loadMSHModel(const std::string &mshFilename, std::vector& vertices, std::vector& tets); 17 | }; 18 | } 19 | 20 | #endif -------------------------------------------------------------------------------- /Utils/Version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef __Version_h__ 2 | #define __Version_h__ 3 | 4 | #define STRINGIZE_HELPER(x) #x 5 | #define STRINGIZE(x) STRINGIZE_HELPER(x) 6 | #define WARNING(desc) message(__FILE__ "(" STRINGIZE(__LINE__) ") : Warning: " #desc) 7 | 8 | #define GIT_SHA1 "@GIT_SHA1@" 9 | #define GIT_REFSPEC "@GIT_REFSPEC@" 10 | #define GIT_LOCAL_STATUS "@GIT_LOCAL_CHANGES@" 11 | 12 | #define PBD_VERSION "@PBD_VERSION@" 13 | 14 | #ifdef DL_OUTPUT 15 | @COMPILER_MESSAGE@ 16 | #endif 17 | 18 | #endif -------------------------------------------------------------------------------- /Utils/VolumeIntegration.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __VOLUME_INTEGRATION_H__ 3 | #define __VOLUME_INTEGRATION_H__ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "Common/Common.h" 10 | 11 | namespace Utilities 12 | { 13 | class VolumeIntegration 14 | { 15 | 16 | private: 17 | int A; 18 | int B; 19 | int C; 20 | 21 | // projection integrals 22 | Real P1, Pa, Pb, Paa, Pab, Pbb, Paaa, Paab, Pabb, Pbbb; 23 | // face integrals 24 | Real Fa, Fb, Fc, Faa, Fbb, Fcc, Faaa, Fbbb, Fccc, Faab, Fbbc, Fcca; 25 | // volume integrals 26 | Real T0; 27 | Real T1[3]; 28 | Real T2[3]; 29 | Real TP[3]; 30 | 31 | public: 32 | 33 | VolumeIntegration(const unsigned int nVertices, const unsigned int nFaces, Vector3r * const vertices, const unsigned int* indices); 34 | 35 | /** Compute inertia tensor for given geometry and given density. 36 | */ 37 | void compute_inertia_tensor(Real density); 38 | 39 | /** Return mass of body. */ 40 | Real getMass() const { return m_mass; } 41 | /** Return volume of body. */ 42 | Real getVolume() const { return m_volume; } 43 | /** Return inertia tensor of body. */ 44 | Matrix3r const& getInertia() const { return m_theta; } 45 | /** Return center of mass. */ 46 | Vector3r const& getCenterOfMass() const { return m_r; } 47 | 48 | private: 49 | 50 | void volume_integrals(); 51 | void face_integrals(unsigned int i); 52 | 53 | /** Compute various integrations over projection of face. 54 | */ 55 | void projection_integrals(unsigned int i); 56 | 57 | 58 | std::vector m_face_normals; 59 | std::vector m_weights; 60 | unsigned int m_nVertices; 61 | unsigned int m_nFaces; 62 | std::vector m_vertices; 63 | const unsigned int* m_indices; 64 | 65 | Real m_mass, m_volume; 66 | Vector3r m_r; 67 | Vector3r m_x; 68 | Matrix3r m_theta; 69 | }; 70 | } 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /bin/ArmadilloCollisionScene.bat: -------------------------------------------------------------------------------- 1 | .\SceneLoaderDemo.exe ../data/scenes/ArmadilloCollisionScene.json -------------------------------------------------------------------------------- /bin/CarScene.bat: -------------------------------------------------------------------------------- 1 | .\SceneLoaderDemo.exe ../data/scenes/CarScene.json -------------------------------------------------------------------------------- /bin/ClothCollisionScene.bat: -------------------------------------------------------------------------------- 1 | .\SceneLoaderDemo.exe ../data/scenes/ClothCollisionScene.json -------------------------------------------------------------------------------- /bin/DeformableSolidCollisionScene.bat: -------------------------------------------------------------------------------- 1 | .\SceneLoaderDemo.exe ../data/scenes/DeformableSolidCollisionScene.json -------------------------------------------------------------------------------- /bin/PileScene.bat: -------------------------------------------------------------------------------- 1 | .\SceneLoaderDemo.exe ../data/scenes/PileScene.json -------------------------------------------------------------------------------- /data/models/cube.obj: -------------------------------------------------------------------------------- 1 | v -0.500000 -0.500000 0.500000 2 | v 0.500000 -0.500000 0.500000 3 | v -0.500000 0.500000 0.500000 4 | v 0.500000 0.500000 0.500000 5 | v -0.500000 0.500000 -0.500000 6 | v 0.500000 0.500000 -0.500000 7 | v -0.500000 -0.500000 -0.500000 8 | v 0.500000 -0.500000 -0.500000 9 | vt 0.375000 0.000000 10 | vt 0.625000 0.000000 11 | vt 0.375000 0.250000 12 | vt 0.625000 0.250000 13 | vt 0.375000 0.500000 14 | vt 0.625000 0.500000 15 | vt 0.375000 0.750000 16 | vt 0.625000 0.750000 17 | vt 0.375000 1.000000 18 | vt 0.625000 1.000000 19 | vt 0.875000 0.000000 20 | vt 0.875000 0.250000 21 | vt 0.125000 0.000000 22 | vt 0.125000 0.250000 23 | f 1/1 2/2 3/3 24 | f 3/3 2/2 4/4 25 | f 3/3 4/4 5/5 26 | f 5/5 4/4 6/6 27 | f 5/5 6/6 7/7 28 | f 7/7 6/6 8/8 29 | f 7/7 8/8 1/9 30 | f 1/9 8/8 2/10 31 | f 2/2 8/11 4/4 32 | f 4/4 8/11 6/12 33 | f 7/13 1/1 5/14 34 | f 5/14 1/1 3/3 -------------------------------------------------------------------------------- /data/scenes/ClothScene.py: -------------------------------------------------------------------------------- 1 | from SceneGenerator import * 2 | import math 3 | 4 | scene = generateScene('ClothScene', camPosition=[0,15,30], camLookat=[0,0,0]) 5 | addParameters(scene, h=0.005, contactTolerance=0.05) 6 | friction = 0.1 7 | restitution = 0.2 8 | 9 | addRigidBody(scene, '../models/cube.obj', 2, coScale=[100, 1, 100], scale=[100, 1, 100], dynamic=0) 10 | 11 | addRigidBody(scene, '../models/torus.obj', 4, coScale=[2, 1, 2], scale=[2, 2, 2], translation=[0,5,0], 12 | friction=friction, rest = restitution, dynamic=0) 13 | 14 | addTriangleModel(scene, '../models/plane_50x50.obj', translation=[0, 10, 0], 15 | scale=[10,10,10], friction=friction, rest = restitution, staticParticles=[]) 16 | 17 | writeScene(scene, 'ClothScene.json') 18 | -------------------------------------------------------------------------------- /data/sdf/bunny_10k.csdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/data/sdf/bunny_10k.csdf -------------------------------------------------------------------------------- /data/shaders/fs_flat.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform vec3 surface_color; 4 | uniform float shininess; 5 | uniform float specular_factor; 6 | 7 | layout(location = 0, index = 0) out vec4 frag_color; 8 | 9 | in GeoData 10 | { 11 | vec3 normal; 12 | vec3 view; 13 | } 14 | inData; 15 | 16 | void main() 17 | { 18 | vec3 normal = inData.normal; 19 | 20 | if (!gl_FrontFacing) 21 | { 22 | normal = -inData.normal; 23 | } 24 | 25 | const vec3 ambient = vec3(0.6, 0.6, 0.6); 26 | const vec3 diffuse = vec3(1.0, 1.0, 1.0); 27 | const vec3 specular = vec3(1.0, 1.0, 1.0); 28 | 29 | vec3 eye_n = normalize(normal); 30 | vec3 eye_v = normalize(inData.view); 31 | const vec3 eye_l = vec3(0.0, 0.0, 1.0); 32 | float cos_ln = max(dot(eye_l, eye_n), 0.0); 33 | vec3 h = normalize(eye_l + eye_v); 34 | float cos_nh = max(dot(eye_n, h), 0.0); 35 | 36 | vec3 color = surface_color * (ambient + diffuse * cos_ln + specular_factor * specular * pow(cos_nh, shininess)); 37 | 38 | frag_color = vec4(color, 1.0); 39 | } 40 | -------------------------------------------------------------------------------- /data/shaders/fs_flatTex.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform vec3 surface_color; 4 | uniform float shininess; 5 | uniform float specular_factor; 6 | uniform sampler2D tex; 7 | 8 | layout(location = 0, index = 0) out vec4 frag_color; 9 | 10 | in GeoData 11 | { 12 | vec3 normal; 13 | vec3 view; 14 | vec2 texCoord; 15 | } 16 | inData; 17 | 18 | void main() 19 | { 20 | vec3 normal = inData.normal; 21 | 22 | if (!gl_FrontFacing) 23 | { 24 | normal = -inData.normal; 25 | } 26 | 27 | const vec3 ambient = vec3(0.6, 0.6, 0.6); 28 | const vec3 diffuse = vec3(1.0, 1.0, 1.0); 29 | const vec3 specular = vec3(1.0, 1.0, 1.0); 30 | 31 | vec3 eye_n = normalize(normal); 32 | vec3 eye_v = normalize(inData.view); 33 | const vec3 eye_l = vec3(0.0, 0.0, 1.0); 34 | float cos_ln = max(dot(eye_l, eye_n), 0.0); 35 | vec3 h = normalize(eye_l + eye_v); 36 | float cos_nh = max(dot(eye_n, h), 0.0); 37 | 38 | vec3 color = surface_color * (ambient + diffuse * cos_ln + specular_factor * specular * pow(cos_nh, shininess)); 39 | vec4 color2 = texture2D(tex, inData.texCoord) * vec4(color, 1.0); 40 | 41 | frag_color = color2; 42 | } 43 | -------------------------------------------------------------------------------- /data/shaders/fs_smooth.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform vec3 surface_color; 4 | uniform float shininess; 5 | uniform float specular_factor; 6 | 7 | layout(location = 0, index = 0) out vec4 frag_color; 8 | 9 | in VertexData 10 | { 11 | vec3 normal; 12 | vec3 view; 13 | } 14 | inData; 15 | 16 | void main() 17 | { 18 | vec3 normal = inData.normal; 19 | 20 | if (!gl_FrontFacing) 21 | { 22 | normal = -inData.normal; 23 | } 24 | 25 | const vec3 ambient = vec3(0.6, 0.6, 0.6); 26 | const vec3 diffuse = vec3(1.0, 1.0, 1.0); 27 | const vec3 specular = vec3(1.0, 1.0, 1.0); 28 | 29 | vec3 eye_n = normalize(normal); 30 | vec3 eye_v = normalize(inData.view); 31 | const vec3 eye_l = vec3(0.0, 0.0, 1.0); 32 | float cos_ln = max(dot(eye_l, eye_n), 0.0); 33 | vec3 h = normalize(eye_l + eye_v); 34 | float cos_nh = max(dot(eye_n, h), 0.0); 35 | 36 | vec3 color = surface_color * (ambient + diffuse * cos_ln + specular_factor * specular * pow(cos_nh, shininess)); 37 | 38 | frag_color = vec4(color, 1.0); 39 | } 40 | -------------------------------------------------------------------------------- /data/shaders/fs_smoothTex.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform vec3 surface_color; 4 | uniform float shininess; 5 | uniform float specular_factor; 6 | uniform sampler2D tex; 7 | 8 | layout(location = 0, index = 0) out vec4 frag_color; 9 | 10 | in VertexData 11 | { 12 | vec3 normal; 13 | vec3 view; 14 | vec2 texCoord; 15 | } 16 | inData; 17 | 18 | void main() 19 | { 20 | vec3 normal = inData.normal; 21 | 22 | if (!gl_FrontFacing) 23 | { 24 | normal = -inData.normal; 25 | } 26 | 27 | const vec3 ambient = vec3(0.6, 0.6, 0.6); 28 | const vec3 diffuse = vec3(1.0, 1.0, 1.0); 29 | const vec3 specular = vec3(1.0, 1.0, 1.0); 30 | 31 | vec3 eye_n = normalize(normal); 32 | vec3 eye_v = normalize(inData.view); 33 | const vec3 eye_l = vec3(0.0, 0.0, 1.0); 34 | float cos_ln = max(dot(eye_l, eye_n), 0.0); 35 | vec3 h = normalize(eye_l + eye_v); 36 | float cos_nh = max(dot(eye_n, h), 0.0); 37 | 38 | vec3 color = surface_color * (ambient + diffuse * cos_ln + specular_factor * specular * pow(cos_nh, shininess)); 39 | vec4 color2 = texture2D(tex, inData.texCoord) * vec4(color, 1.0); 40 | 41 | frag_color = color2; 42 | } 43 | -------------------------------------------------------------------------------- /data/shaders/gs_flat.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform mat4 projection_matrix; 4 | 5 | layout(triangles) in; 6 | layout(triangle_strip, max_vertices = 3) out; 7 | 8 | in VertexData 9 | { 10 | vec3 view; 11 | } 12 | inData[]; 13 | 14 | out GeoData 15 | { 16 | vec3 normal; 17 | vec3 view; 18 | } 19 | outData; 20 | 21 | void main() 22 | { 23 | vec3 x0 = gl_in[0].gl_Position.xyz; 24 | vec3 x1 = gl_in[1].gl_Position.xyz; 25 | vec3 x2 = gl_in[2].gl_Position.xyz; 26 | 27 | vec3 eye_n = normalize(cross(x1 - x0, x2 - x0)); 28 | 29 | vec4 p0 = projection_matrix * gl_in[0].gl_Position; 30 | vec4 p1 = projection_matrix * gl_in[1].gl_Position; 31 | vec4 p2 = projection_matrix * gl_in[2].gl_Position; 32 | 33 | gl_Position = p0; 34 | outData.normal = eye_n; 35 | outData.view = inData[0].view; 36 | EmitVertex(); 37 | 38 | gl_Position = p1; 39 | outData.normal = eye_n; 40 | outData.view = inData[1].view; 41 | EmitVertex(); 42 | 43 | gl_Position = p2; 44 | outData.normal = eye_n; 45 | outData.view = inData[2].view; 46 | EmitVertex(); 47 | } 48 | -------------------------------------------------------------------------------- /data/shaders/gs_flatTex.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform mat4 projection_matrix; 4 | 5 | layout(triangles) in; 6 | layout(triangle_strip, max_vertices = 3) out; 7 | 8 | in VertexData 9 | { 10 | vec3 view; 11 | vec2 texCoord; 12 | } 13 | inData[]; 14 | 15 | out GeoData 16 | { 17 | vec3 normal; 18 | vec3 view; 19 | vec2 texCoord; 20 | } 21 | outData; 22 | 23 | void main() 24 | { 25 | vec3 x0 = gl_in[0].gl_Position.xyz; 26 | vec3 x1 = gl_in[1].gl_Position.xyz; 27 | vec3 x2 = gl_in[2].gl_Position.xyz; 28 | 29 | vec3 eye_n = normalize(cross(x1 - x0, x2 - x0)); 30 | 31 | vec4 p0 = projection_matrix * gl_in[0].gl_Position; 32 | vec4 p1 = projection_matrix * gl_in[1].gl_Position; 33 | vec4 p2 = projection_matrix * gl_in[2].gl_Position; 34 | 35 | gl_Position = p0; 36 | outData.normal = eye_n; 37 | outData.view = inData[0].view; 38 | outData.texCoord = inData[0].texCoord; 39 | EmitVertex(); 40 | 41 | gl_Position = p1; 42 | outData.normal = eye_n; 43 | outData.view = inData[1].view; 44 | outData.texCoord = inData[1].texCoord; 45 | EmitVertex(); 46 | 47 | gl_Position = p2; 48 | outData.normal = eye_n; 49 | outData.view = inData[2].view; 50 | outData.texCoord = inData[2].texCoord; 51 | EmitVertex(); 52 | } 53 | -------------------------------------------------------------------------------- /data/shaders/vs_flat.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform mat4 modelview_matrix; 4 | 5 | layout(location = 0) in vec3 position; 6 | 7 | out VertexData 8 | { 9 | vec3 view; 10 | } 11 | outData; 12 | 13 | void main() 14 | { 15 | vec4 v_position = modelview_matrix * vec4(position, 1.0); 16 | outData.view = -v_position.xyz; 17 | gl_Position = v_position; 18 | } 19 | -------------------------------------------------------------------------------- /data/shaders/vs_flatTex.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform mat4 modelview_matrix; 4 | 5 | layout(location = 0) in vec3 position; 6 | layout(location = 1) in vec2 texCoord; 7 | 8 | out VertexData 9 | { 10 | vec3 view; 11 | vec2 texCoord; 12 | } 13 | outData; 14 | 15 | void main() 16 | { 17 | vec4 v_position = modelview_matrix * vec4(position, 1.0); 18 | outData.view = -v_position.xyz; 19 | outData.texCoord = texCoord; 20 | gl_Position = v_position; 21 | } 22 | -------------------------------------------------------------------------------- /data/shaders/vs_smooth.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform mat4 modelview_matrix; 4 | uniform mat4 projection_matrix; 5 | 6 | layout(location = 0) in vec3 position; 7 | layout(location = 2) in vec3 normal; 8 | 9 | out VertexData 10 | { 11 | vec3 normal; 12 | vec3 view; 13 | } 14 | outData; 15 | 16 | void main() 17 | { 18 | vec4 v_position = projection_matrix * modelview_matrix * vec4(position, 1.0); 19 | outData.normal = mat3(modelview_matrix) * normal; 20 | outData.view = -v_position.xyz; 21 | gl_Position = v_position; 22 | } 23 | -------------------------------------------------------------------------------- /data/shaders/vs_smoothTex.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform mat4 modelview_matrix; 4 | uniform mat4 projection_matrix; 5 | 6 | layout(location = 0) in vec3 position; 7 | layout(location = 1) in vec2 texCoord; 8 | layout(location = 2) in vec3 normal; 9 | 10 | out VertexData 11 | { 12 | vec3 normal; 13 | vec3 view; 14 | vec2 texCoord; 15 | } 16 | outData; 17 | 18 | void main() 19 | { 20 | vec4 v_position = projection_matrix * modelview_matrix * vec4(position, 1.0); 21 | outData.normal = mat3(modelview_matrix) * normal; 22 | outData.view = -v_position.xyz; 23 | outData.texCoord = texCoord; 24 | gl_Position = v_position; 25 | } 26 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile clean 16 | 17 | clean: 18 | rm -rf doxyoutput/ api/ 19 | @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 20 | 21 | # Catch-all target: route all unknown targets to Sphinx using the new 22 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 23 | %: Makefile 24 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /doc/bibliography.rst: -------------------------------------------------------------------------------- 1 | References 2 | ========== 3 | 4 | .. bibliography:: bibliography.bib 5 | :all: 6 | 7 | -------------------------------------------------------------------------------- /doc/cmake_options.md: -------------------------------------------------------------------------------- 1 | # CMake Options 2 | 3 | This page should give you a short overview over the CMake options of PositionBasedDynamics. 4 | 5 | ## USE_DOUBLE_PRECISION 6 | 7 | If this flag is enabled, then all computations with floating point values are performed using double precision (double). Otherwise single precision (float) is used. 8 | 9 | ## USE_OpenMP 10 | 11 | Enable the OpenMP parallelization which lets the simulation run in parallel on all available cores of the CPU. 12 | 13 | ## USE_PYTHON_BINDINGS 14 | 15 | Generate a shared library object which can be imported into python scripts and exposes C++ functionality to the python interpreter. 16 | *Default:On* 17 | *Options:* 18 | -------------------------------------------------------------------------------- /doc/getting_started.md: -------------------------------------------------------------------------------- 1 | # Getting started 2 | 3 | This page should give you a short overview of PositionBasedDynamics. 4 | 5 | ## Demos 6 | 7 | After building the PositionBasedDynamics library, there are several demos which can by executed in the binary folder. To execute a demo, you can call, e.g.: 8 | 9 | ``` 10 | cd ../bin 11 | ./BarDemo 12 | ``` 13 | 14 | ## SceneLoaderDemo 15 | 16 | This special demo reads a PositionBasedDynamics scene file and performs a simulation of the scene. You can start this simulator, e.g., by calling: 17 | 18 | ``` 19 | cd ../bin 20 | ./SceneLoaderDemo ../data/Scenes/CarScene.json 21 | ``` 22 | 23 | The scene file format is explained [here.](file_format.md) 24 | 25 | ##### Hotkeys 26 | 27 | * Space: pause/contiunue simulation 28 | * r: reset simulation 29 | * w: wireframe rendering of meshes 30 | * ESC: exit 31 | 32 | ## Python bindings 33 | 34 | PositionBasedDynamics implements bindings for python using [pybind11](https://github.com/pybind/pybind11). 35 | See the [getting started guide](./py_getting_started.md). 36 | 37 | ### Impatient installation guide 38 | 39 | In order to install, simply clone the repository and run pip install on the repository. 40 | It is recommended, that you set up a **virtual environment** for this, because cache files will be stored in the directory of the python installation along with models and scene files. 41 | 42 | ```shell script 43 | git clone https://github.com/InteractiveComputerGraphics/PositionBasedDynamics.git 44 | pip install PositionBasedDynamics/ 45 | ``` 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /doc/images/PBD1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/doc/images/PBD1.jpg -------------------------------------------------------------------------------- /doc/images/PBD2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/doc/images/PBD2.jpg -------------------------------------------------------------------------------- /doc/images/balljoint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/doc/images/balljoint.jpg -------------------------------------------------------------------------------- /doc/images/ballonlinejoint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/doc/images/ballonlinejoint.jpg -------------------------------------------------------------------------------- /doc/images/hingejoint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/doc/images/hingejoint.jpg -------------------------------------------------------------------------------- /doc/images/motorhingejoint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/doc/images/motorhingejoint.jpg -------------------------------------------------------------------------------- /doc/images/motorsliderjoint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/doc/images/motorsliderjoint.jpg -------------------------------------------------------------------------------- /doc/images/sliderjoint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/doc/images/sliderjoint.jpg -------------------------------------------------------------------------------- /doc/images/universaljoint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/doc/images/universaljoint.jpg -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | :maxdepth: 2 3 | :caption: Introduction: 4 | 5 | about 6 | getting_started 7 | file_format 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | :caption: Developer Guide: 12 | 13 | build_from_source 14 | cmake_options 15 | 16 | .. toctree:: 17 | :maxdepth: 2 18 | :caption: Python Package: 19 | 20 | py_getting_started 21 | 22 | .. toctree:: 23 | :maxdepth: 2 24 | :caption: API Documentation: 25 | 26 | api/library_root 27 | 28 | .. toctree:: 29 | :caption: References 30 | 31 | bibliography 32 | 33 | 34 | Indices and tables 35 | ================== 36 | 37 | * :ref:`genindex` 38 | * :ref:`search` 39 | 40 | -------------------------------------------------------------------------------- /doc/mainpage.dox: -------------------------------------------------------------------------------- 1 | namespace PBD { 2 | 3 | /** \mainpage notitle 4 | 5 | This is the API documentation for PositionBasedDynamics. 6 | 7 | @author Jan Bender 8 | 9 | \copyright 10 | 11 | The MIT License (MIT) 12 | 13 | Copyright (c) 2015-present, PositionBasedDynamics contributors 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the "Software"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | 33 | */ 34 | 35 | } 36 | -------------------------------------------------------------------------------- /doc/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | exhale 2 | recommonmark 3 | Sphinx==5.2.3 4 | sphinx_rtd_theme==1.3.0 5 | sphinxcontrib.bibtex==2.6.1 6 | docutils==0.16 7 | -------------------------------------------------------------------------------- /extern/eigen/COPYING.BSD: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Intel Corporation. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of Intel Corporation nor the names of its contributors may 13 | be used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | -------------------------------------------------------------------------------- /extern/eigen/COPYING.README: -------------------------------------------------------------------------------- 1 | Eigen is primarily MPL2 licensed. See COPYING.MPL2 and these links: 2 | http://www.mozilla.org/MPL/2.0/ 3 | http://www.mozilla.org/MPL/2.0/FAQ.html 4 | 5 | Some files contain third-party code under BSD or LGPL licenses, whence the other 6 | COPYING.* files here. 7 | 8 | All the LGPL code is either LGPL 2.1-only, or LGPL 2.1-or-later. 9 | For this reason, the COPYING.LGPL file contains the LGPL 2.1 text. 10 | 11 | If you want to guarantee that the Eigen code that you are #including is licensed 12 | under the MPL2 and possibly more permissive licenses (like BSD), #define this 13 | preprocessor symbol: 14 | EIGEN_MPL2_ONLY 15 | For example, with most compilers, you could add this to your project CXXFLAGS: 16 | -DEIGEN_MPL2_ONLY 17 | This will cause a compilation error to be generated if you #include any code that is 18 | LGPL licensed. 19 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(RegexUtils) 2 | test_escape_string_as_regex() 3 | 4 | file(GLOB Eigen_directory_files "*") 5 | 6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 7 | 8 | foreach(f ${Eigen_directory_files}) 9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src") 10 | list(APPEND Eigen_directory_files_to_install ${f}) 11 | endif() 12 | endforeach(f ${Eigen_directory_files}) 13 | 14 | install(FILES 15 | ${Eigen_directory_files_to_install} 16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel 17 | ) 18 | 19 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h") 20 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLESKY_MODULE_H 9 | #define EIGEN_CHOLESKY_MODULE_H 10 | 11 | #include "Core" 12 | #include "Jacobi" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** \defgroup Cholesky_Module Cholesky module 17 | * 18 | * 19 | * 20 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 21 | * Those decompositions are also accessible via the following methods: 22 | * - MatrixBase::llt() 23 | * - MatrixBase::ldlt() 24 | * - SelfAdjointView::llt() 25 | * - SelfAdjointView::ldlt() 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | */ 31 | 32 | #include "src/Cholesky/LLT.h" 33 | #include "src/Cholesky/LDLT.h" 34 | #ifdef EIGEN_USE_LAPACKE 35 | #ifdef EIGEN_USE_MKL 36 | #include "mkl_lapacke.h" 37 | #else 38 | #include "src/misc/lapacke.h" 39 | #endif 40 | #include "src/Cholesky/LLT_LAPACKE.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_CHOLESKY_MODULE_H 46 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/CholmodSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H 9 | #define EIGEN_CHOLMODSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup CholmodSupport_Module CholmodSupport module 21 | * 22 | * This module provides an interface to the Cholmod library which is part of the suitesparse package. 23 | * It provides the two following main factorization classes: 24 | * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization. 25 | * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). 26 | * 27 | * For the sake of completeness, this module also propose the two following classes: 28 | * - class CholmodSimplicialLLT 29 | * - class CholmodSimplicialLDLT 30 | * Note that these classes does not bring any particular advantage compared to the built-in 31 | * SimplicialLLT and SimplicialLDLT factorization classes. 32 | * 33 | * \code 34 | * #include 35 | * \endcode 36 | * 37 | * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies. 38 | * The dependencies depend on how cholmod has been compiled. 39 | * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. 40 | * 41 | */ 42 | 43 | #include "src/CholmodSupport/CholmodSupport.h" 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_CHOLMODSUPPORT_MODULE_H 48 | 49 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Eigenvalues: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_EIGENVALUES_MODULE_H 9 | #define EIGEN_EIGENVALUES_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | #include "LU" 17 | #include "Geometry" 18 | 19 | #include "src/Core/util/DisableStupidWarnings.h" 20 | 21 | /** \defgroup Eigenvalues_Module Eigenvalues module 22 | * 23 | * 24 | * 25 | * This module mainly provides various eigenvalue solvers. 26 | * This module also provides some MatrixBase methods, including: 27 | * - MatrixBase::eigenvalues(), 28 | * - MatrixBase::operatorNorm() 29 | * 30 | * \code 31 | * #include 32 | * \endcode 33 | */ 34 | 35 | #include "src/misc/RealSvd2x2.h" 36 | #include "src/Eigenvalues/Tridiagonalization.h" 37 | #include "src/Eigenvalues/RealSchur.h" 38 | #include "src/Eigenvalues/EigenSolver.h" 39 | #include "src/Eigenvalues/SelfAdjointEigenSolver.h" 40 | #include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" 41 | #include "src/Eigenvalues/HessenbergDecomposition.h" 42 | #include "src/Eigenvalues/ComplexSchur.h" 43 | #include "src/Eigenvalues/ComplexEigenSolver.h" 44 | #include "src/Eigenvalues/RealQZ.h" 45 | #include "src/Eigenvalues/GeneralizedEigenSolver.h" 46 | #include "src/Eigenvalues/MatrixBaseEigenvalues.h" 47 | #ifdef EIGEN_USE_LAPACKE 48 | #ifdef EIGEN_USE_MKL 49 | #include "mkl_lapacke.h" 50 | #else 51 | #include "src/misc/lapacke.h" 52 | #endif 53 | #include "src/Eigenvalues/RealSchur_LAPACKE.h" 54 | #include "src/Eigenvalues/ComplexSchur_LAPACKE.h" 55 | #include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h" 56 | #endif 57 | 58 | #include "src/Core/util/ReenableStupidWarnings.h" 59 | 60 | #endif // EIGEN_EIGENVALUES_MODULE_H 61 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Geometry: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_GEOMETRY_MODULE_H 9 | #define EIGEN_GEOMETRY_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "SVD" 14 | #include "LU" 15 | #include 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 18 | 19 | /** \defgroup Geometry_Module Geometry module 20 | * 21 | * This module provides support for: 22 | * - fixed-size homogeneous transformations 23 | * - translation, scaling, 2D and 3D rotations 24 | * - \link Quaternion quaternions \endlink 25 | * - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3) 26 | * - orthognal vector generation (\ref MatrixBase::unitOrthogonal) 27 | * - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink 28 | * - \link AlignedBox axis aligned bounding boxes \endlink 29 | * - \link umeyama least-square transformation fitting \endlink 30 | * 31 | * \code 32 | * #include 33 | * \endcode 34 | */ 35 | 36 | #include "src/Geometry/OrthoMethods.h" 37 | #include "src/Geometry/EulerAngles.h" 38 | 39 | #include "src/Geometry/Homogeneous.h" 40 | #include "src/Geometry/RotationBase.h" 41 | #include "src/Geometry/Rotation2D.h" 42 | #include "src/Geometry/Quaternion.h" 43 | #include "src/Geometry/AngleAxis.h" 44 | #include "src/Geometry/Transform.h" 45 | #include "src/Geometry/Translation.h" 46 | #include "src/Geometry/Scaling.h" 47 | #include "src/Geometry/Hyperplane.h" 48 | #include "src/Geometry/ParametrizedLine.h" 49 | #include "src/Geometry/AlignedBox.h" 50 | #include "src/Geometry/Umeyama.h" 51 | 52 | // Use the SSE optimized version whenever possible. 53 | #if (defined EIGEN_VECTORIZE_SSE) || (defined EIGEN_VECTORIZE_NEON) 54 | #include "src/Geometry/arch/Geometry_SIMD.h" 55 | #endif 56 | 57 | #include "src/Core/util/ReenableStupidWarnings.h" 58 | 59 | #endif // EIGEN_GEOMETRY_MODULE_H 60 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Householder: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 9 | #define EIGEN_HOUSEHOLDER_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Householder_Module Householder module 16 | * This module provides Householder transformations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/Householder/Householder.h" 24 | #include "src/Householder/HouseholderSequence.h" 25 | #include "src/Householder/BlockHouseholder.h" 26 | 27 | #include "src/Core/util/ReenableStupidWarnings.h" 28 | 29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 30 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_JACOBI_MODULE_H 9 | #define EIGEN_JACOBI_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Jacobi_Module Jacobi module 16 | * This module provides Jacobi and Givens rotations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | * 22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 23 | * - MatrixBase::applyOnTheLeft() 24 | * - MatrixBase::applyOnTheRight(). 25 | */ 26 | 27 | #include "src/Jacobi/Jacobi.h" 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_JACOBI_MODULE_H 32 | 33 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/KLUSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_KLUSUPPORT_MODULE_H 9 | #define EIGEN_KLUSUPPORT_MODULE_H 10 | 11 | #include 12 | 13 | #include 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup KLUSupport_Module KLUSupport module 22 | * 23 | * This module provides an interface to the KLU library which is part of the suitesparse package. 24 | * It provides the following factorization class: 25 | * - class KLU: a sparse LU factorization, well-suited for circuit simulation. 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | * 31 | * In order to use this module, the klu and btf headers must be accessible from the include paths, and your binary must be linked to the klu library and its dependencies. 32 | * The dependencies depend on how umfpack has been compiled. 33 | * For a cmake based project, you can use our FindKLU.cmake module to help you in this task. 34 | * 35 | */ 36 | 37 | #include "src/KLUSupport/KLUSupport.h" 38 | 39 | #include 40 | 41 | #endif // EIGEN_KLUSUPPORT_MODULE_H 42 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/LU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_LU_MODULE_H 9 | #define EIGEN_LU_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup LU_Module LU module 16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 17 | * This module defines the following MatrixBase methods: 18 | * - MatrixBase::inverse() 19 | * - MatrixBase::determinant() 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/misc/Kernel.h" 27 | #include "src/misc/Image.h" 28 | #include "src/LU/FullPivLU.h" 29 | #include "src/LU/PartialPivLU.h" 30 | #ifdef EIGEN_USE_LAPACKE 31 | #ifdef EIGEN_USE_MKL 32 | #include "mkl_lapacke.h" 33 | #else 34 | #include "src/misc/lapacke.h" 35 | #endif 36 | #include "src/LU/PartialPivLU_LAPACKE.h" 37 | #endif 38 | #include "src/LU/Determinant.h" 39 | #include "src/LU/InverseImpl.h" 40 | 41 | #if defined EIGEN_VECTORIZE_SSE || defined EIGEN_VECTORIZE_NEON 42 | #include "src/LU/arch/InverseSize4.h" 43 | #endif 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_LU_MODULE_H 48 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_METISSUPPORT_MODULE_H 9 | #define EIGEN_METISSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup MetisSupport_Module MetisSupport module 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 28 | */ 29 | 30 | 31 | #include "src/MetisSupport/MetisSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_METISSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 9 | #define EIGEN_PASTIXSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | #ifdef complex 21 | #undef complex 22 | #endif 23 | 24 | /** \ingroup Support_modules 25 | * \defgroup PaStiXSupport_Module PaStiXSupport module 26 | * 27 | * This module provides an interface to the PaSTiX library. 28 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 29 | * It provides the two following main factorization classes: 30 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 31 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 32 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | * 38 | * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. 39 | * This wrapper resuires PaStiX version 5.x compiled without MPI support. 40 | * The dependencies depend on how PaSTiX has been compiled. 41 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 42 | * 43 | */ 44 | 45 | #include "src/PaStiXSupport/PaStiXSupport.h" 46 | 47 | #include "src/Core/util/ReenableStupidWarnings.h" 48 | 49 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 50 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 9 | #define EIGEN_PARDISOSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup PardisoSupport_Module PardisoSupport module 19 | * 20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 28 | * 29 | */ 30 | 31 | #include "src/PardisoSupport/PardisoSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/QR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QR_MODULE_H 9 | #define EIGEN_QR_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 18 | 19 | /** \defgroup QR_Module QR module 20 | * 21 | * 22 | * 23 | * This module provides various QR decompositions 24 | * This module also provides some MatrixBase methods, including: 25 | * - MatrixBase::householderQr() 26 | * - MatrixBase::colPivHouseholderQr() 27 | * - MatrixBase::fullPivHouseholderQr() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/QR/HouseholderQR.h" 35 | #include "src/QR/FullPivHouseholderQR.h" 36 | #include "src/QR/ColPivHouseholderQR.h" 37 | #include "src/QR/CompleteOrthogonalDecomposition.h" 38 | #ifdef EIGEN_USE_LAPACKE 39 | #ifdef EIGEN_USE_MKL 40 | #include "mkl_lapacke.h" 41 | #else 42 | #include "src/misc/lapacke.h" 43 | #endif 44 | #include "src/QR/HouseholderQR_LAPACKE.h" 45 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_QR_MODULE_H 51 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QTMALLOC_MODULE_H 9 | #define EIGEN_QTMALLOC_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | void *qMalloc(std::size_t size) 18 | { 19 | return Eigen::internal::aligned_malloc(size); 20 | } 21 | 22 | void qFree(void *ptr) 23 | { 24 | Eigen::internal::aligned_free(ptr); 25 | } 26 | 27 | void *qRealloc(void *ptr, std::size_t size) 28 | { 29 | void* newPtr = Eigen::internal::aligned_malloc(size); 30 | std::memcpy(newPtr, ptr, size); 31 | Eigen::internal::aligned_free(ptr); 32 | return newPtr; 33 | } 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | 39 | #endif // EIGEN_QTMALLOC_MODULE_H 40 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 9 | #define EIGEN_SPQRSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SuiteSparseQR.hpp" 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup SPQRSupport_Module SuiteSparseQR module 19 | * 20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). 27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 28 | * 29 | */ 30 | 31 | #include "src/CholmodSupport/CholmodSupport.h" 32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/SVD: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SVD_MODULE_H 9 | #define EIGEN_SVD_MODULE_H 10 | 11 | #include "QR" 12 | #include "Householder" 13 | #include "Jacobi" 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | /** \defgroup SVD_Module SVD module 18 | * 19 | * 20 | * 21 | * This module provides SVD decomposition for matrices (both real and complex). 22 | * Two decomposition algorithms are provided: 23 | * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones. 24 | * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems. 25 | * These decompositions are accessible via the respective classes and following MatrixBase methods: 26 | * - MatrixBase::jacobiSvd() 27 | * - MatrixBase::bdcSvd() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/misc/RealSvd2x2.h" 35 | #include "src/SVD/UpperBidiagonalization.h" 36 | #include "src/SVD/SVDBase.h" 37 | #include "src/SVD/JacobiSVD.h" 38 | #include "src/SVD/BDCSVD.h" 39 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 40 | #ifdef EIGEN_USE_MKL 41 | #include "mkl_lapacke.h" 42 | #else 43 | #include "src/misc/lapacke.h" 44 | #endif 45 | #include "src/SVD/JacobiSVD_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SVD_MODULE_H 51 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSE_MODULE_H 9 | #define EIGEN_SPARSE_MODULE_H 10 | 11 | /** \defgroup Sparse_Module Sparse meta-module 12 | * 13 | * Meta-module including all related modules: 14 | * - \ref SparseCore_Module 15 | * - \ref OrderingMethods_Module 16 | * - \ref SparseCholesky_Module 17 | * - \ref SparseLU_Module 18 | * - \ref SparseQR_Module 19 | * - \ref IterativeLinearSolvers_Module 20 | * 21 | \code 22 | #include 23 | \endcode 24 | */ 25 | 26 | #include "SparseCore" 27 | #include "OrderingMethods" 28 | #include "SparseCholesky" 29 | #include "SparseLU" 30 | #include "SparseQR" 31 | #include "IterativeLinearSolvers" 32 | 33 | #endif // EIGEN_SPARSE_MODULE_H 34 | 35 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #include "src/SparseCholesky/SimplicialCholesky.h" 34 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 38 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/SparseLU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // Copyright (C) 2012 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSELU_MODULE_H 12 | #define EIGEN_SPARSELU_MODULE_H 13 | 14 | #include "SparseCore" 15 | 16 | /** 17 | * \defgroup SparseLU_Module SparseLU module 18 | * This module defines a supernodal factorization of general sparse matrices. 19 | * The code is fully optimized for supernode-panel updates with specialized kernels. 20 | * Please, see the documentation of the SparseLU class for more details. 21 | */ 22 | 23 | // Ordering interface 24 | #include "OrderingMethods" 25 | 26 | #include "src/Core/util/DisableStupidWarnings.h" 27 | 28 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 29 | 30 | #include "src/SparseLU/SparseLU_Structs.h" 31 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 32 | #include "src/SparseLU/SparseLUImpl.h" 33 | #include "src/SparseCore/SparseColEtree.h" 34 | #include "src/SparseLU/SparseLU_Memory.h" 35 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 36 | #include "src/SparseLU/SparseLU_relax_snode.h" 37 | #include "src/SparseLU/SparseLU_pivotL.h" 38 | #include "src/SparseLU/SparseLU_panel_dfs.h" 39 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 40 | #include "src/SparseLU/SparseLU_panel_bmod.h" 41 | #include "src/SparseLU/SparseLU_column_dfs.h" 42 | #include "src/SparseLU/SparseLU_column_bmod.h" 43 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 44 | #include "src/SparseLU/SparseLU_pruneL.h" 45 | #include "src/SparseLU/SparseLU_Utils.h" 46 | #include "src/SparseLU/SparseLU.h" 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SPARSELU_MODULE_H 51 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSEQR_MODULE_H 9 | #define EIGEN_SPARSEQR_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup SparseQR_Module SparseQR module 16 | * \brief Provides QR decomposition for sparse matrices 17 | * 18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 19 | * The columns of the input matrix should be reordered to limit the fill-in during the 20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 22 | * of built-in and external ordering methods. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | * 28 | * 29 | */ 30 | 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseQR/SparseQR.h" 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdDeque.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDDEQUE_MODULE_H 28 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdVector.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDVECTOR_MODULE_H 28 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup UmfPackSupport_Module UmfPackSupport module 21 | * 22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 23 | * It provides the following factorization class: 24 | * - class UmfPackLU: a multifrontal sequential LU factorization. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. 31 | * The dependencies depend on how umfpack has been compiled. 32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/UmfPackSupport/UmfPackSupport.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 41 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/DiagonalProduct.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2007-2009 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_DIAGONALPRODUCT_H 12 | #define EIGEN_DIAGONALPRODUCT_H 13 | 14 | namespace Eigen { 15 | 16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. 17 | */ 18 | template 19 | template 20 | EIGEN_DEVICE_FUNC inline const Product 21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const 22 | { 23 | return Product(derived(),a_diagonal.derived()); 24 | } 25 | 26 | } // end namespace Eigen 27 | 28 | #endif // EIGEN_DIAGONALPRODUCT_H 29 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SELFCWISEBINARYOP_H 11 | #define EIGEN_SELFCWISEBINARYOP_H 12 | 13 | namespace Eigen { 14 | 15 | // TODO generalize the scalar type of 'other' 16 | 17 | template 18 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other) 19 | { 20 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op()); 21 | return derived(); 22 | } 23 | 24 | template 25 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other) 26 | { 27 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op()); 28 | return derived(); 29 | } 30 | 31 | template 32 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator-=(const Scalar& other) 33 | { 34 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op()); 35 | return derived(); 36 | } 37 | 38 | template 39 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other) 40 | { 41 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op()); 42 | return derived(); 43 | } 44 | 45 | } // end namespace Eigen 46 | 47 | #endif // EIGEN_SELFCWISEBINARYOP_H 48 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/arch/Default/Settings.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | 12 | /* All the parameters defined in this file can be specialized in the 13 | * architecture specific files, and/or by the user. 14 | * More to come... */ 15 | 16 | #ifndef EIGEN_DEFAULT_SETTINGS_H 17 | #define EIGEN_DEFAULT_SETTINGS_H 18 | 19 | /** Defines the maximal loop size to enable meta unrolling of loops. 20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS", 21 | * it does not correspond to the number of iterations or the number of instructions 22 | */ 23 | #ifndef EIGEN_UNROLLING_LIMIT 24 | #define EIGEN_UNROLLING_LIMIT 110 25 | #endif 26 | 27 | /** Defines the threshold between a "small" and a "large" matrix. 28 | * This threshold is mainly used to select the proper product implementation. 29 | */ 30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 32 | #endif 33 | 34 | /** Defines the maximal width of the blocks used in the triangular product and solver 35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8. 36 | */ 37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8 39 | #endif 40 | 41 | 42 | /** Defines the default number of registers available for that architecture. 43 | * Currently it must be 8 or 16. Other values will fail. 44 | */ 45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8 47 | #endif 48 | 49 | #endif // EIGEN_DEFAULT_SETTINGS_H 50 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * math_constants.h - 3 | * HIP equivalent of the CUDA header of the same name 4 | */ 5 | 6 | #ifndef __MATH_CONSTANTS_H__ 7 | #define __MATH_CONSTANTS_H__ 8 | 9 | /* single precision constants */ 10 | 11 | #define HIPRT_INF_F __int_as_float(0x7f800000) 12 | #define HIPRT_NAN_F __int_as_float(0x7fffffff) 13 | #define HIPRT_MIN_DENORM_F __int_as_float(0x00000001) 14 | #define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff) 15 | #define HIPRT_NEG_ZERO_F __int_as_float(0x80000000) 16 | #define HIPRT_ZERO_F 0.0f 17 | #define HIPRT_ONE_F 1.0f 18 | 19 | /* double precision constants */ 20 | #define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000) 21 | #define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000) 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2020, Arm Limited and Contributors 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MATH_FUNCTIONS_SVE_H 11 | #define EIGEN_MATH_FUNCTIONS_SVE_H 12 | 13 | namespace Eigen { 14 | namespace internal { 15 | 16 | template <> 17 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf pexp(const PacketXf& x) { 18 | return pexp_float(x); 19 | } 20 | 21 | template <> 22 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf plog(const PacketXf& x) { 23 | return plog_float(x); 24 | } 25 | 26 | template <> 27 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf psin(const PacketXf& x) { 28 | return psin_float(x); 29 | } 30 | 31 | template <> 32 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf pcos(const PacketXf& x) { 33 | return pcos_float(x); 34 | } 35 | 36 | // Hyperbolic Tangent function. 37 | template <> 38 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf ptanh(const PacketXf& x) { 39 | return internal::generic_fast_tanh_float(x); 40 | } 41 | } // end namespace internal 42 | } // end namespace Eigen 43 | 44 | #endif // EIGEN_MATH_FUNCTIONS_SVE_H 45 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2020, Arm Limited and Contributors 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TYPE_CASTING_SVE_H 11 | #define EIGEN_TYPE_CASTING_SVE_H 12 | 13 | namespace Eigen { 14 | namespace internal { 15 | 16 | template <> 17 | struct type_casting_traits { 18 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 19 | }; 20 | 21 | template <> 22 | struct type_casting_traits { 23 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 24 | }; 25 | 26 | template <> 27 | EIGEN_STRONG_INLINE PacketXf pcast(const PacketXi& a) { 28 | return svcvt_f32_s32_z(svptrue_b32(), a); 29 | } 30 | 31 | template <> 32 | EIGEN_STRONG_INLINE PacketXi pcast(const PacketXf& a) { 33 | return svcvt_s32_f32_z(svptrue_b32(), a); 34 | } 35 | 36 | template <> 37 | EIGEN_STRONG_INLINE PacketXf preinterpret(const PacketXi& a) { 38 | return svreinterpret_f32_s32(a); 39 | } 40 | 41 | template <> 42 | EIGEN_STRONG_INLINE PacketXi preinterpret(const PacketXf& a) { 43 | return svreinterpret_s32_f32(a); 44 | } 45 | 46 | } // namespace internal 47 | } // namespace Eigen 48 | 49 | #endif // EIGEN_TYPE_CASTING_SVE_H 50 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/functors/TernaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TERNARY_FUNCTORS_H 11 | #define EIGEN_TERNARY_FUNCTORS_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | //---------- associative ternary functors ---------- 18 | 19 | 20 | 21 | } // end namespace internal 22 | 23 | } // end namespace Eigen 24 | 25 | #endif // EIGEN_TERNARY_FUNCTORS_H 26 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED_2 2 | // "DisableStupidWarnings.h" was included twice recursively: Do not reenable warnings yet! 3 | # undef EIGEN_WARNINGS_DISABLED_2 4 | 5 | #elif defined(EIGEN_WARNINGS_DISABLED) 6 | #undef EIGEN_WARNINGS_DISABLED 7 | 8 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 9 | #ifdef _MSC_VER 10 | #pragma warning( pop ) 11 | #elif defined __INTEL_COMPILER 12 | #pragma warning pop 13 | #elif defined __clang__ 14 | #pragma clang diagnostic pop 15 | #elif defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 16 | #pragma GCC diagnostic pop 17 | #endif 18 | 19 | #if defined __NVCC__ 20 | // Don't reenable the diagnostic messages, as it turns out these messages need 21 | // to be disabled at the point of the template instantiation (i.e the user code) 22 | // otherwise they'll be triggered by nvcc. 23 | // #pragma diag_default code_is_unreachable 24 | // #pragma diag_default initialization_not_reachable 25 | // #pragma diag_default 2651 26 | // #pragma diag_default 2653 27 | #endif 28 | 29 | #endif 30 | 31 | #endif // EIGEN_WARNINGS_DISABLED 32 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/util/ReshapedHelper.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2017 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | 11 | #ifndef EIGEN_RESHAPED_HELPER_H 12 | #define EIGEN_RESHAPED_HELPER_H 13 | 14 | namespace Eigen { 15 | 16 | enum AutoSize_t { AutoSize }; 17 | const int AutoOrder = 2; 18 | 19 | namespace internal { 20 | 21 | template 22 | struct get_compiletime_reshape_size { 23 | enum { value = get_fixed_value::value }; 24 | }; 25 | 26 | template 27 | Index get_runtime_reshape_size(SizeType size, Index /*other*/, Index /*total*/) { 28 | return internal::get_runtime_value(size); 29 | } 30 | 31 | template 32 | struct get_compiletime_reshape_size { 33 | enum { 34 | other_size = get_fixed_value::value, 35 | value = (TotalSize==Dynamic || other_size==Dynamic) ? Dynamic : TotalSize / other_size }; 36 | }; 37 | 38 | inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) { 39 | return total/other; 40 | } 41 | 42 | template 43 | struct get_compiletime_reshape_order { 44 | enum { value = Order == AutoOrder ? Flags & RowMajorBit : Order }; 45 | }; 46 | 47 | } 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_RESHAPED_HELPER_H 52 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/SparseCore/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | template 17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const 18 | { 19 | const typename internal::nested_eval::type actualA(derived()); 20 | typename internal::conditional::type, 22 | const PlainObject>::type actualB(other.derived()); 23 | 24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); 25 | } 26 | 27 | } // end namespace Eigen 28 | 29 | #endif // EIGEN_SPARSE_FUZZY_H 30 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/SparseCore/SparseRedux.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSEREDUX_H 11 | #define EIGEN_SPARSEREDUX_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | typename internal::traits::Scalar 17 | SparseMatrixBase::sum() const 18 | { 19 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 20 | Scalar res(0); 21 | internal::evaluator thisEval(derived()); 22 | for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) 24 | res += iter.value(); 25 | return res; 26 | } 27 | 28 | template 29 | typename internal::traits >::Scalar 30 | SparseMatrix<_Scalar,_Options,_Index>::sum() const 31 | { 32 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 33 | if(this->isCompressed()) 34 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 35 | else 36 | return Base::sum(); 37 | } 38 | 39 | template 40 | typename internal::traits >::Scalar 41 | SparseVector<_Scalar,_Options,_Index>::sum() const 42 | { 43 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 44 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 45 | } 46 | 47 | } // end namespace Eigen 48 | 49 | #endif // EIGEN_SPARSEREDUX_H 50 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/misc/RealSvd2x2.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Benoit Jacob 5 | // Copyright (C) 2013-2016 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_REALSVD2X2_H 12 | #define EIGEN_REALSVD2X2_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | template 19 | void real_2x2_jacobi_svd(const MatrixType& matrix, Index p, Index q, 20 | JacobiRotation *j_left, 21 | JacobiRotation *j_right) 22 | { 23 | using std::sqrt; 24 | using std::abs; 25 | Matrix m; 26 | m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)), 27 | numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q)); 28 | JacobiRotation rot1; 29 | RealScalar t = m.coeff(0,0) + m.coeff(1,1); 30 | RealScalar d = m.coeff(1,0) - m.coeff(0,1); 31 | 32 | if(abs(d) < (std::numeric_limits::min)()) 33 | { 34 | rot1.s() = RealScalar(0); 35 | rot1.c() = RealScalar(1); 36 | } 37 | else 38 | { 39 | // If d!=0, then t/d cannot overflow because the magnitude of the 40 | // entries forming d are not too small compared to the ones forming t. 41 | RealScalar u = t / d; 42 | RealScalar tmp = sqrt(RealScalar(1) + numext::abs2(u)); 43 | rot1.s() = RealScalar(1) / tmp; 44 | rot1.c() = u / tmp; 45 | } 46 | m.applyOnTheLeft(0,1,rot1); 47 | j_right->makeJacobi(m,0,1); 48 | *j_left = rot1 * j_right->transpose(); 49 | } 50 | 51 | } // end namespace internal 52 | 53 | } // end namespace Eigen 54 | 55 | #endif // EIGEN_REALSVD2X2_H 56 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /extern/eigen/signature_of_eigen3_matrix_library: -------------------------------------------------------------------------------- 1 | This file is just there as a signature to help identify directories containing Eigen3. When writing a script looking for Eigen3, just look for this file. This is especially useful to help disambiguate with Eigen2... 2 | -------------------------------------------------------------------------------- /extern/eigen/version.txt: -------------------------------------------------------------------------------- 1 | Eigen 3.4.0 -------------------------------------------------------------------------------- /extern/glfw/CMake/GenerateMappings.cmake: -------------------------------------------------------------------------------- 1 | # Usage: 2 | # cmake -P GenerateMappings.cmake 3 | 4 | set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt") 5 | set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt") 6 | set(template_path "${CMAKE_ARGV3}") 7 | set(target_path "${CMAKE_ARGV4}") 8 | 9 | if (NOT EXISTS "${template_path}") 10 | message(FATAL_ERROR "Failed to find template file ${template_path}") 11 | endif() 12 | 13 | file(DOWNLOAD "${source_url}" "${source_path}" 14 | STATUS download_status 15 | TLS_VERIFY on) 16 | 17 | list(GET download_status 0 status_code) 18 | list(GET download_status 1 status_message) 19 | 20 | if (status_code) 21 | message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}") 22 | endif() 23 | 24 | file(STRINGS "${source_path}" lines) 25 | foreach(line ${lines}) 26 | if ("${line}" MATCHES "^[0-9a-fA-F].*$") 27 | set(GLFW_GAMEPAD_MAPPINGS "${GLFW_GAMEPAD_MAPPINGS}\"${line}\",\n") 28 | endif() 29 | endforeach() 30 | 31 | configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX) 32 | file(REMOVE "${source_path}") 33 | 34 | -------------------------------------------------------------------------------- /extern/glfw/CMake/MacOSXBundleInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 9 | CFBundleGetInfoString 10 | ${MACOSX_BUNDLE_INFO_STRING} 11 | CFBundleIconFile 12 | ${MACOSX_BUNDLE_ICON_FILE} 13 | CFBundleIdentifier 14 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 19 | CFBundleName 20 | ${MACOSX_BUNDLE_BUNDLE_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | ${MACOSX_BUNDLE_BUNDLE_VERSION} 29 | CSResourcesFileMapped 30 | 31 | LSRequiresCarbon 32 | 33 | NSHumanReadableCopyright 34 | ${MACOSX_BUNDLE_COPYRIGHT} 35 | NSHighResolutionCapable 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /extern/glfw/CMake/i686-w64-mingw32-clang.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 Clang 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-clang") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-clang++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /extern/glfw/CMake/i686-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 GCC 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /extern/glfw/CMake/modules/FindEpollShim.cmake: -------------------------------------------------------------------------------- 1 | # Find EpollShim 2 | # Once done, this will define 3 | # 4 | # EPOLLSHIM_FOUND - System has EpollShim 5 | # EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories 6 | # EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim 7 | 8 | find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim) 9 | find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib) 10 | 11 | if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) 12 | set(EPOLLSHIM_FOUND TRUE) 13 | endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) 14 | 15 | include(FindPackageHandleStandardArgs) 16 | find_package_handle_standard_args(EPOLLSHIM DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS) 17 | mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES) 18 | -------------------------------------------------------------------------------- /extern/glfw/CMake/modules/FindOSMesa.cmake: -------------------------------------------------------------------------------- 1 | # Try to find OSMesa on a Unix system 2 | # 3 | # This will define: 4 | # 5 | # OSMESA_LIBRARIES - Link these to use OSMesa 6 | # OSMESA_INCLUDE_DIR - Include directory for OSMesa 7 | # 8 | # Copyright (c) 2014 Brandon Schaefer 9 | 10 | if (NOT WIN32) 11 | 12 | find_package (PkgConfig) 13 | pkg_check_modules (PKG_OSMESA QUIET osmesa) 14 | 15 | set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS}) 16 | set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES}) 17 | 18 | endif () 19 | -------------------------------------------------------------------------------- /extern/glfw/CMake/modules/FindWaylandProtocols.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION}) 4 | 5 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols 6 | OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR 7 | RESULT_VARIABLE _pkgconfig_failed) 8 | if (_pkgconfig_failed) 9 | message(FATAL_ERROR "Missing wayland-protocols pkgdatadir") 10 | endif() 11 | 12 | string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}") 13 | 14 | find_package_handle_standard_args(WaylandProtocols 15 | FOUND_VAR 16 | WaylandProtocols_FOUND 17 | REQUIRED_VARS 18 | WaylandProtocols_PKGDATADIR 19 | VERSION_VAR 20 | WaylandProtocols_VERSION 21 | HANDLE_COMPONENTS 22 | ) 23 | 24 | set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND}) 25 | set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR}) 26 | set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION}) 27 | -------------------------------------------------------------------------------- /extern/glfw/CMake/modules/FindXKBCommon.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find XKBCommon 2 | # Once done, this will define 3 | # 4 | # XKBCOMMON_FOUND - System has XKBCommon 5 | # XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories 6 | # XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon 7 | # XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon 8 | 9 | find_package(PkgConfig) 10 | pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon) 11 | set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER}) 12 | 13 | find_path(XKBCOMMON_INCLUDE_DIR 14 | NAMES xkbcommon/xkbcommon.h 15 | HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} 16 | ) 17 | 18 | find_library(XKBCOMMON_LIBRARY 19 | NAMES xkbcommon 20 | HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS} 21 | ) 22 | 23 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) 24 | set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS}) 25 | set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR}) 26 | 27 | include(FindPackageHandleStandardArgs) 28 | find_package_handle_standard_args(XKBCommon DEFAULT_MSG 29 | XKBCOMMON_LIBRARY 30 | XKBCOMMON_INCLUDE_DIR 31 | ) 32 | 33 | mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) 34 | 35 | -------------------------------------------------------------------------------- /extern/glfw/CMake/x86_64-w64-mingw32-clang.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 Clang 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-clang") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-clang++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /extern/glfw/CMake/x86_64-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 GCC 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /extern/glfw/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | 3 | Copyright (c) 2006-2019 Camilla Löwy 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | 24 | -------------------------------------------------------------------------------- /extern/glfw/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 4 | endif() 5 | 6 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 7 | string(REGEX REPLACE "\n" ";" files "${files}") 8 | 9 | foreach (file ${files}) 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | if (EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 13 | OUTPUT_VARIABLE rm_out 14 | RETURN_VALUE rm_retval) 15 | if (NOT "${rm_retval}" STREQUAL 0) 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | endif() 18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}") 19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 20 | OUTPUT_VARIABLE rm_out 21 | RETURN_VALUE rm_retval) 22 | if (NOT "${rm_retval}" STREQUAL 0) 23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") 24 | endif() 25 | else() 26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 27 | endif() 28 | endforeach() 29 | 30 | -------------------------------------------------------------------------------- /extern/glfw/src/cocoa_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Cocoa - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickNS ns 33 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE struct { int dummyJoystick; } 34 | 35 | #define _GLFW_PLATFORM_MAPPING_NAME "Mac OS X" 36 | 37 | // Cocoa-specific per-joystick data 38 | // 39 | typedef struct _GLFWjoystickNS 40 | { 41 | IOHIDDeviceRef device; 42 | CFMutableArrayRef axes; 43 | CFMutableArrayRef buttons; 44 | CFMutableArrayRef hats; 45 | } _GLFWjoystickNS; 46 | 47 | 48 | void _glfwInitJoysticksNS(void); 49 | void _glfwTerminateJoysticksNS(void); 50 | 51 | -------------------------------------------------------------------------------- /extern/glfw/src/glfw3.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 5 | 6 | Name: GLFW 7 | Description: A multi-platform library for OpenGL, window and input 8 | Version: @GLFW_VERSION@ 9 | URL: https://www.glfw.org/ 10 | Requires.private: @GLFW_PKG_DEPS@ 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@ 12 | Libs.private: @GLFW_PKG_LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /extern/glfw/src/glfw3Config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake") 2 | -------------------------------------------------------------------------------- /extern/glfw/src/null_init.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2016-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | // It is fine to use C99 in this file because it will not be built with VS 28 | //======================================================================== 29 | 30 | #include "internal.h" 31 | 32 | 33 | ////////////////////////////////////////////////////////////////////////// 34 | ////// GLFW platform API ////// 35 | ////////////////////////////////////////////////////////////////////////// 36 | 37 | int _glfwPlatformInit(void) 38 | { 39 | _glfwInitTimerPOSIX(); 40 | return GLFW_TRUE; 41 | } 42 | 43 | void _glfwPlatformTerminate(void) 44 | { 45 | _glfwTerminateOSMesa(); 46 | } 47 | 48 | const char* _glfwPlatformGetVersionString(void) 49 | { 50 | return _GLFW_VERSION_NUMBER " null OSMesa"; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /extern/glfw/src/null_joystick.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // It is fine to use C99 in this file because it will not be built with VS 27 | //======================================================================== 28 | 29 | #include "internal.h" 30 | 31 | 32 | ////////////////////////////////////////////////////////////////////////// 33 | ////// GLFW platform API ////// 34 | ////////////////////////////////////////////////////////////////////////// 35 | 36 | int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode) 37 | { 38 | return GLFW_FALSE; 39 | } 40 | 41 | void _glfwPlatformUpdateGamepadGUID(char* guid) 42 | { 43 | } 44 | 45 | -------------------------------------------------------------------------------- /extern/glfw/src/null_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_JOYSTICK_STATE struct { int dummyJoystick; } 28 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE struct { int dummyLibraryJoystick; } 29 | 30 | #define _GLFW_PLATFORM_MAPPING_NAME "" 31 | 32 | -------------------------------------------------------------------------------- /extern/glfw/src/posix_thread.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include 29 | 30 | #define _GLFW_PLATFORM_TLS_STATE _GLFWtlsPOSIX posix 31 | #define _GLFW_PLATFORM_MUTEX_STATE _GLFWmutexPOSIX posix 32 | 33 | 34 | // POSIX-specific thread local storage data 35 | // 36 | typedef struct _GLFWtlsPOSIX 37 | { 38 | GLFWbool allocated; 39 | pthread_key_t key; 40 | 41 | } _GLFWtlsPOSIX; 42 | 43 | // POSIX-specific mutex data 44 | // 45 | typedef struct _GLFWmutexPOSIX 46 | { 47 | GLFWbool allocated; 48 | pthread_mutex_t handle; 49 | 50 | } _GLFWmutexPOSIX; 51 | 52 | -------------------------------------------------------------------------------- /extern/glfw/src/posix_time.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define _GLFW_PLATFORM_LIBRARY_TIMER_STATE _GLFWtimerPOSIX posix 29 | 30 | #include 31 | 32 | 33 | // POSIX-specific global timer data 34 | // 35 | typedef struct _GLFWtimerPOSIX 36 | { 37 | GLFWbool monotonic; 38 | uint64_t frequency; 39 | 40 | } _GLFWtimerPOSIX; 41 | 42 | 43 | void _glfwInitTimerPOSIX(void); 44 | 45 | -------------------------------------------------------------------------------- /extern/glfw/src/win32_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickWin32 win32 28 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE struct { int dummyLibraryJoystick; } 29 | 30 | #define _GLFW_PLATFORM_MAPPING_NAME "Windows" 31 | 32 | // Joystick element (axis, button or slider) 33 | // 34 | typedef struct _GLFWjoyobjectWin32 35 | { 36 | int offset; 37 | int type; 38 | } _GLFWjoyobjectWin32; 39 | 40 | // Win32-specific per-joystick data 41 | // 42 | typedef struct _GLFWjoystickWin32 43 | { 44 | _GLFWjoyobjectWin32* objects; 45 | int objectCount; 46 | IDirectInputDevice8W* device; 47 | DWORD index; 48 | GUID guid; 49 | } _GLFWjoystickWin32; 50 | 51 | 52 | void _glfwInitJoysticksWin32(void); 53 | void _glfwTerminateJoysticksWin32(void); 54 | void _glfwDetectJoystickConnectionWin32(void); 55 | void _glfwDetectJoystickDisconnectionWin32(void); 56 | 57 | -------------------------------------------------------------------------------- /extern/glfw/src/xkb_unicode.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | long _glfwKeySym2Unicode(unsigned int keysym); 28 | 29 | -------------------------------------------------------------------------------- /extern/glfw/version.txt: -------------------------------------------------------------------------------- 1 | glfw-3.3.2 -------------------------------------------------------------------------------- /extern/happly/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Nick Sharp 4 | 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /extern/imgui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(IMGUI_HEADERS 2 | imconfig.h 3 | imgui.h 4 | imgui_internal.h 5 | imstb_rectpack.h 6 | imstb_textedit.h 7 | imstb_truetype.h 8 | 9 | backends/imgui_impl_glfw.h 10 | backends/imgui_impl_opengl3.h 11 | backends/imgui_impl_opengl3_loader.h 12 | ) 13 | 14 | set(IMGUI_SOURCES 15 | imgui.cpp 16 | imgui_demo.cpp # useful examples of how to use imgui 17 | imgui_draw.cpp 18 | imgui_tables.cpp 19 | imgui_widgets.cpp 20 | 21 | backends/imgui_impl_glfw.cpp 22 | backends/imgui_impl_opengl3.cpp 23 | ) 24 | 25 | add_library(imgui 26 | ${IMGUI_HEADERS} 27 | ${IMGUI_SOURCES} 28 | ) 29 | 30 | target_compile_definitions(imgui PUBLIC -DIMGUI_IMPL_OPENGL_LOADER_GLAD) 31 | 32 | add_dependencies(imgui glfw) 33 | target_link_libraries(imgui PUBLIC glfw) 34 | 35 | target_include_directories(glfw PUBLIC ${CMAKE_CURRENT_LIST_DIR}) 36 | set_target_properties(imgui PROPERTIES FOLDER "External Dependencies") 37 | 38 | -------------------------------------------------------------------------------- /extern/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2022 Omar Cornut 4 | 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/imgui/misc/fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/imgui/misc/fonts/DroidSans.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/imgui/misc/fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/imgui/misc/fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/imgui/misc/fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/imgui/misc/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/imgui/misc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/imgui/misc/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/imgui/misc/fonts/Roboto-Thin.ttf -------------------------------------------------------------------------------- /extern/md5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(MD5 STATIC 2 | md5.cpp 3 | md5.h 4 | ) 5 | 6 | set_target_properties(MD5 PROPERTIES FOLDER "External Dependencies") 7 | -------------------------------------------------------------------------------- /extern/pybind/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Wenzel Jakob , All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | 3. Neither the name of the copyright holder nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | Please also refer to the file .github/CONTRIBUTING.md, which clarifies licensing of 29 | external contributions to this project including patches, pull requests, etc. 30 | -------------------------------------------------------------------------------- /extern/pybind/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include pybind11/include/pybind11 *.h 2 | recursive-include pybind11 *.py 3 | recursive-include pybind11 py.typed 4 | include pybind11/share/cmake/pybind11/*.cmake 5 | include LICENSE README.rst pyproject.toml setup.py setup.cfg 6 | -------------------------------------------------------------------------------- /extern/pybind/include/pybind11/common.h: -------------------------------------------------------------------------------- 1 | #include "detail/common.h" 2 | #warning "Including 'common.h' is deprecated. It will be removed in v3.0. Use 'pybind11.h'." 3 | -------------------------------------------------------------------------------- /extern/pybind/include/pybind11/detail/typeid.h: -------------------------------------------------------------------------------- 1 | /* 2 | pybind11/detail/typeid.h: Compiler-independent access to type identifiers 3 | 4 | Copyright (c) 2016 Wenzel Jakob 5 | 6 | All rights reserved. Use of this source code is governed by a 7 | BSD-style license that can be found in the LICENSE file. 8 | */ 9 | 10 | #pragma once 11 | 12 | #include 13 | #include 14 | 15 | #if defined(__GNUG__) 16 | # include 17 | #endif 18 | 19 | #include "common.h" 20 | 21 | PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) 22 | PYBIND11_NAMESPACE_BEGIN(detail) 23 | 24 | /// Erase all occurrences of a substring 25 | inline void erase_all(std::string &string, const std::string &search) { 26 | for (size_t pos = 0;;) { 27 | pos = string.find(search, pos); 28 | if (pos == std::string::npos) { 29 | break; 30 | } 31 | string.erase(pos, search.length()); 32 | } 33 | } 34 | 35 | PYBIND11_NOINLINE void clean_type_id(std::string &name) { 36 | #if defined(__GNUG__) 37 | int status = 0; 38 | std::unique_ptr res{ 39 | abi::__cxa_demangle(name.c_str(), nullptr, nullptr, &status), std::free}; 40 | if (status == 0) { 41 | name = res.get(); 42 | } 43 | #else 44 | detail::erase_all(name, "class "); 45 | detail::erase_all(name, "struct "); 46 | detail::erase_all(name, "enum "); 47 | #endif 48 | detail::erase_all(name, "pybind11::"); 49 | } 50 | 51 | inline std::string clean_type_id(const char *typeid_name) { 52 | std::string name(typeid_name); 53 | detail::clean_type_id(name); 54 | return name; 55 | } 56 | 57 | PYBIND11_NAMESPACE_END(detail) 58 | 59 | /// Return a string representation of a C++ type 60 | template 61 | static std::string type_id() { 62 | return detail::clean_type_id(typeid(T).name()); 63 | } 64 | 65 | PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) 66 | -------------------------------------------------------------------------------- /extern/pybind/pybind11/__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | if sys.version_info < (3, 6): 4 | msg = "pybind11 does not support Python < 3.6. 2.9 was the last release supporting Python 2.7 and 3.5." 5 | raise ImportError(msg) 6 | 7 | 8 | from ._version import __version__, version_info 9 | from .commands import get_cmake_dir, get_include, get_pkgconfig_dir 10 | 11 | __all__ = ( 12 | "version_info", 13 | "__version__", 14 | "get_include", 15 | "get_cmake_dir", 16 | "get_pkgconfig_dir", 17 | ) 18 | -------------------------------------------------------------------------------- /extern/pybind/pybind11/__main__.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=missing-function-docstring 2 | 3 | import argparse 4 | import sys 5 | import sysconfig 6 | 7 | from .commands import get_cmake_dir, get_include, get_pkgconfig_dir 8 | 9 | 10 | def print_includes() -> None: 11 | dirs = [ 12 | sysconfig.get_path("include"), 13 | sysconfig.get_path("platinclude"), 14 | get_include(), 15 | ] 16 | 17 | # Make unique but preserve order 18 | unique_dirs = [] 19 | for d in dirs: 20 | if d and d not in unique_dirs: 21 | unique_dirs.append(d) 22 | 23 | print(" ".join("-I" + d for d in unique_dirs)) 24 | 25 | 26 | def main() -> None: 27 | 28 | parser = argparse.ArgumentParser() 29 | parser.add_argument( 30 | "--includes", 31 | action="store_true", 32 | help="Include flags for both pybind11 and Python headers.", 33 | ) 34 | parser.add_argument( 35 | "--cmakedir", 36 | action="store_true", 37 | help="Print the CMake module directory, ideal for setting -Dpybind11_ROOT in CMake.", 38 | ) 39 | parser.add_argument( 40 | "--pkgconfigdir", 41 | action="store_true", 42 | help="Print the pkgconfig directory, ideal for setting $PKG_CONFIG_PATH.", 43 | ) 44 | args = parser.parse_args() 45 | if not sys.argv[1:]: 46 | parser.print_help() 47 | if args.includes: 48 | print_includes() 49 | if args.cmakedir: 50 | print(get_cmake_dir()) 51 | if args.pkgconfigdir: 52 | print(get_pkgconfig_dir()) 53 | 54 | 55 | if __name__ == "__main__": 56 | main() 57 | -------------------------------------------------------------------------------- /extern/pybind/pybind11/_version.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | 4 | def _to_int(s: str) -> Union[int, str]: 5 | try: 6 | return int(s) 7 | except ValueError: 8 | return s 9 | 10 | 11 | __version__ = "2.10.1" 12 | version_info = tuple(_to_int(s) for s in __version__.split(".")) 13 | -------------------------------------------------------------------------------- /extern/pybind/pybind11/commands.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | DIR = os.path.abspath(os.path.dirname(__file__)) 4 | 5 | 6 | def get_include(user: bool = False) -> str: # pylint: disable=unused-argument 7 | """ 8 | Return the path to the pybind11 include directory. The historical "user" 9 | argument is unused, and may be removed. 10 | """ 11 | installed_path = os.path.join(DIR, "include") 12 | source_path = os.path.join(os.path.dirname(DIR), "include") 13 | return installed_path if os.path.exists(installed_path) else source_path 14 | 15 | 16 | def get_cmake_dir() -> str: 17 | """ 18 | Return the path to the pybind11 CMake module directory. 19 | """ 20 | cmake_installed_path = os.path.join(DIR, "share", "cmake", "pybind11") 21 | if os.path.exists(cmake_installed_path): 22 | return cmake_installed_path 23 | 24 | msg = "pybind11 not installed, installation required to access the CMake files" 25 | raise ImportError(msg) 26 | 27 | 28 | def get_pkgconfig_dir() -> str: 29 | """ 30 | Return the path to the pybind11 pkgconfig directory. 31 | """ 32 | pkgconfig_installed_path = os.path.join(DIR, "share", "pkgconfig") 33 | if os.path.exists(pkgconfig_installed_path): 34 | return pkgconfig_installed_path 35 | 36 | msg = "pybind11 not installed, installation required to access the pkgconfig files" 37 | raise ImportError(msg) 38 | -------------------------------------------------------------------------------- /extern/pybind/pybind11/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/PositionBasedDynamics/afa26c12594e18a0ed2c069fb992ee6ae225c482/extern/pybind/pybind11/py.typed -------------------------------------------------------------------------------- /extern/pybind/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=42", "cmake>=3.18", "ninja"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [tool.check-manifest] 6 | ignore = [ 7 | "tests/**", 8 | "docs/**", 9 | "tools/**", 10 | "include/**", 11 | ".*", 12 | "pybind11/include/**", 13 | "pybind11/share/**", 14 | "CMakeLists.txt", 15 | "noxfile.py", 16 | ] 17 | 18 | [tool.isort] 19 | # Needs the compiled .so modules and env.py from tests 20 | known_first_party = "env,pybind11_cross_module_tests,pybind11_tests," 21 | # For black compatibility 22 | profile = "black" 23 | 24 | [tool.mypy] 25 | files = ["pybind11"] 26 | python_version = "3.6" 27 | strict = true 28 | show_error_codes = true 29 | enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] 30 | warn_unreachable = true 31 | 32 | [[tool.mypy.overrides]] 33 | module = ["ghapi.*", "setuptools.*"] 34 | ignore_missing_imports = true 35 | 36 | 37 | [tool.pytest.ini_options] 38 | minversion = "6.0" 39 | addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] 40 | xfail_strict = true 41 | filterwarnings = ["error"] 42 | log_cli_level = "info" 43 | testpaths = [ 44 | "tests", 45 | ] 46 | timeout=300 47 | 48 | 49 | [tool.pylint] 50 | master.py-version = "3.6" 51 | reports.output-format = "colorized" 52 | messages_control.disable = [ 53 | "design", 54 | "fixme", 55 | "imports", 56 | "line-too-long", 57 | "imports", 58 | "invalid-name", 59 | "protected-access", 60 | "missing-module-docstring", 61 | ] 62 | -------------------------------------------------------------------------------- /extern/pybind/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | long_description = file: README.rst 3 | long_description_content_type = text/x-rst 4 | description = Seamless operability between C++11 and Python 5 | author = Wenzel Jakob 6 | author_email = wenzel.jakob@epfl.ch 7 | url = https://github.com/pybind/pybind11 8 | license = BSD 9 | 10 | classifiers = 11 | Development Status :: 5 - Production/Stable 12 | Intended Audience :: Developers 13 | Topic :: Software Development :: Libraries :: Python Modules 14 | Topic :: Utilities 15 | Programming Language :: C++ 16 | Programming Language :: Python :: 3 :: Only 17 | Programming Language :: Python :: 3.6 18 | Programming Language :: Python :: 3.7 19 | Programming Language :: Python :: 3.8 20 | Programming Language :: Python :: 3.9 21 | Programming Language :: Python :: 3.10 22 | Programming Language :: Python :: 3.11 23 | License :: OSI Approved :: BSD License 24 | Programming Language :: Python :: Implementation :: PyPy 25 | Programming Language :: Python :: Implementation :: CPython 26 | Programming Language :: C++ 27 | Topic :: Software Development :: Libraries :: Python Modules 28 | 29 | keywords = 30 | C++11 31 | Python bindings 32 | 33 | project_urls = 34 | Documentation = https://pybind11.readthedocs.io/ 35 | Bug Tracker = https://github.com/pybind/pybind11/issues 36 | Discussions = https://github.com/pybind/pybind11/discussions 37 | Changelog = https://pybind11.readthedocs.io/en/latest/changelog.html 38 | Chat = https://gitter.im/pybind/Lobby 39 | 40 | [options] 41 | python_requires = >=3.6 42 | zip_safe = False 43 | 44 | 45 | [flake8] 46 | max-line-length = 120 47 | show_source = True 48 | exclude = .git, __pycache__, build, dist, docs, tools, venv 49 | extend-ignore = E203, E722, B903, B950 50 | extend-select = B9 51 | -------------------------------------------------------------------------------- /extern/pybind/tools/JoinPaths.cmake: -------------------------------------------------------------------------------- 1 | # This module provides function for joining paths 2 | # known from most languages 3 | # 4 | # SPDX-License-Identifier: (MIT OR CC0-1.0) 5 | # Copyright 2020 Jan Tojnar 6 | # https://github.com/jtojnar/cmake-snips 7 | # 8 | # Modelled after Python’s os.path.join 9 | # https://docs.python.org/3.7/library/os.path.html#os.path.join 10 | # Windows not supported 11 | function(join_paths joined_path first_path_segment) 12 | set(temp_path "${first_path_segment}") 13 | foreach(current_segment IN LISTS ARGN) 14 | if(NOT ("${current_segment}" STREQUAL "")) 15 | if(IS_ABSOLUTE "${current_segment}") 16 | set(temp_path "${current_segment}") 17 | else() 18 | set(temp_path "${temp_path}/${current_segment}") 19 | endif() 20 | endif() 21 | endforeach() 22 | set(${joined_path} "${temp_path}" PARENT_SCOPE) 23 | endfunction() 24 | -------------------------------------------------------------------------------- /extern/pybind/tools/check-style.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Script to check include/test code for common pybind11 code style errors. 4 | # 5 | # This script currently checks for 6 | # 7 | # 1. missing space between keyword and parenthesis, e.g.: for(, if(, while( 8 | # 2. Missing space between right parenthesis and brace, e.g. 'for (...){' 9 | # 3. opening brace on its own line. It should always be on the same line as the 10 | # if/while/for/do statement. 11 | # 12 | # Invoke as: tools/check-style.sh 13 | # 14 | 15 | check_style_errors=0 16 | IFS=$'\n' 17 | 18 | 19 | found="$(grep '\<\(if\|for\|while\|catch\)(\|){' "$@" -rn --color=always)" 20 | if [ -n "$found" ]; then 21 | echo -e '\033[31;01mError: found the following coding style problems:\033[0m' 22 | check_style_errors=1 23 | echo "${found//^/ /}" 24 | fi 25 | 26 | found="$(awk ' 27 | function prefix(filename, lineno) { 28 | return " \033[35m" filename "\033[36m:\033[32m" lineno "\033[36m:\033[0m" 29 | } 30 | function mark(pattern, string) { sub(pattern, "\033[01;31m&\033[0m", string); return string } 31 | last && /^\s*{/ { 32 | print prefix(FILENAME, FNR-1) mark("\\)\\s*$", last) 33 | print prefix(FILENAME, FNR) mark("^\\s*{", $0) 34 | last="" 35 | } 36 | { last = /(if|for|while|catch|switch)\s*\(.*\)\s*$/ ? $0 : "" } 37 | ' "$(find include -type f)" "$@")" 38 | if [ -n "$found" ]; then 39 | check_style_errors=1 40 | echo -e '\033[31;01mError: braces should occur on the same line as the if/while/.. statement. Found issues in the following files:\033[0m' 41 | echo "$found" 42 | fi 43 | 44 | exit $check_style_errors 45 | -------------------------------------------------------------------------------- /extern/pybind/tools/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # Source: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake 2 | 3 | if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 4 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") 5 | endif() 6 | 7 | file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 8 | string(REGEX REPLACE "\n" ";" files "${files}") 9 | foreach(file ${files}) 10 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 11 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program( 13 | "@CMAKE_COMMAND@" ARGS 14 | "-E remove \"$ENV{DESTDIR}${file}\"" 15 | OUTPUT_VARIABLE rm_out 16 | RETURN_VALUE rm_retval) 17 | if(NOT "${rm_retval}" STREQUAL 0) 18 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 19 | endif() 20 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 21 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 22 | endif() 23 | endforeach() 24 | -------------------------------------------------------------------------------- /extern/pybind/tools/codespell_ignore_lines_from_errors.py: -------------------------------------------------------------------------------- 1 | """Simple script for rebuilding .codespell-ignore-lines 2 | 3 | Usage: 4 | 5 | cat < /dev/null > .codespell-ignore-lines 6 | pre-commit run --all-files codespell >& /tmp/codespell_errors.txt 7 | python3 tools/codespell_ignore_lines_from_errors.py /tmp/codespell_errors.txt > .codespell-ignore-lines 8 | 9 | git diff to review changes, then commit, push. 10 | """ 11 | 12 | import sys 13 | from typing import List 14 | 15 | 16 | def run(args: List[str]) -> None: 17 | assert len(args) == 1, "codespell_errors.txt" 18 | cache = {} 19 | done = set() 20 | for line in sorted(open(args[0]).read().splitlines()): 21 | i = line.find(" ==> ") 22 | if i > 0: 23 | flds = line[:i].split(":") 24 | if len(flds) >= 2: 25 | filename, line_num = flds[:2] 26 | if filename not in cache: 27 | cache[filename] = open(filename).read().splitlines() 28 | supp = cache[filename][int(line_num) - 1] 29 | if supp not in done: 30 | print(supp) 31 | done.add(supp) 32 | 33 | 34 | if __name__ == "__main__": 35 | run(args=sys.argv[1:]) 36 | -------------------------------------------------------------------------------- /extern/pybind/tools/libsize.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | # Internal build script for generating debugging test .so size. 5 | # Usage: 6 | # python libsize.py file.so save.txt -- displays the size of file.so and, if save.txt exists, compares it to the 7 | # size in it, then overwrites save.txt with the new size for future runs. 8 | 9 | if len(sys.argv) != 3: 10 | sys.exit("Invalid arguments: usage: python libsize.py file.so save.txt") 11 | 12 | lib = sys.argv[1] 13 | save = sys.argv[2] 14 | 15 | if not os.path.exists(lib): 16 | sys.exit(f"Error: requested file ({lib}) does not exist") 17 | 18 | libsize = os.path.getsize(lib) 19 | 20 | print("------", os.path.basename(lib), "file size:", libsize, end="") 21 | 22 | if os.path.exists(save): 23 | with open(save) as sf: 24 | oldsize = int(sf.readline()) 25 | 26 | if oldsize > 0: 27 | change = libsize - oldsize 28 | if change == 0: 29 | print(" (no change)") 30 | else: 31 | print(f" (change of {change:+} bytes = {change / oldsize:+.2%})") 32 | else: 33 | print() 34 | 35 | with open(save, "w") as sf: 36 | sf.write(str(libsize)) 37 | -------------------------------------------------------------------------------- /extern/pybind/tools/make_changelog.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import re 4 | 5 | import ghapi.all 6 | from rich import print 7 | from rich.syntax import Syntax 8 | 9 | ENTRY = re.compile( 10 | r""" 11 | Suggested \s changelog \s entry: 12 | .* 13 | ```rst 14 | \s* 15 | (.*?) 16 | \s* 17 | ``` 18 | """, 19 | re.DOTALL | re.VERBOSE, 20 | ) 21 | 22 | print() 23 | 24 | 25 | api = ghapi.all.GhApi(owner="pybind", repo="pybind11") 26 | 27 | issues_pages = ghapi.page.paged( 28 | api.issues.list_for_repo, labels="needs changelog", state="closed" 29 | ) 30 | issues = (issue for page in issues_pages for issue in page) 31 | missing = [] 32 | 33 | for issue in issues: 34 | changelog = ENTRY.findall(issue.body) 35 | if changelog: 36 | (msg,) = changelog 37 | if not msg.startswith("* "): 38 | msg = "* " + msg 39 | if not msg.endswith("."): 40 | msg += "." 41 | 42 | msg += f"\n `#{issue.number} <{issue.html_url}>`_" 43 | 44 | print(Syntax(msg, "rst", theme="ansi_light", word_wrap=True)) 45 | print() 46 | 47 | else: 48 | missing.append(issue) 49 | 50 | if missing: 51 | print() 52 | print("[blue]" + "-" * 30) 53 | print() 54 | 55 | for issue in missing: 56 | print(f"[red bold]Missing:[/red bold][red] {issue.title}") 57 | print(f"[red] {issue.html_url}\n") 58 | 59 | print("[bold]Template:\n") 60 | msg = "## Suggested changelog entry:\n\n```rst\n\n```" 61 | print(Syntax(msg, "md", theme="ansi_light")) 62 | 63 | print() 64 | -------------------------------------------------------------------------------- /extern/pybind/tools/pybind11.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix_for_pc_file@ 2 | includedir=@includedir_for_pc_file@ 3 | 4 | Name: @PROJECT_NAME@ 5 | Description: Seamless operability between C++11 and Python 6 | Version: @PROJECT_VERSION@ 7 | Cflags: -I${includedir} 8 | -------------------------------------------------------------------------------- /extern/pybind/tools/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=42", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | -------------------------------------------------------------------------------- /extern/pybind/tools/setup_global.py.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Setup script for pybind11-global (in the sdist or in tools/setup_global.py in the repository) 4 | # This package is targeted for easy use from CMake. 5 | 6 | import glob 7 | import os 8 | import re 9 | 10 | # Setuptools has to be before distutils 11 | from setuptools import setup 12 | 13 | from distutils.command.install_headers import install_headers 14 | 15 | class InstallHeadersNested(install_headers): 16 | def run(self): 17 | headers = self.distribution.headers or [] 18 | for header in headers: 19 | # Remove pybind11/include/ 20 | short_header = header.split("/", 2)[-1] 21 | 22 | dst = os.path.join(self.install_dir, os.path.dirname(short_header)) 23 | self.mkpath(dst) 24 | (out, _) = self.copy_file(header, dst) 25 | self.outfiles.append(out) 26 | 27 | 28 | main_headers = glob.glob("pybind11/include/pybind11/*.h") 29 | detail_headers = glob.glob("pybind11/include/pybind11/detail/*.h") 30 | stl_headers = glob.glob("pybind11/include/pybind11/stl/*.h") 31 | cmake_files = glob.glob("pybind11/share/cmake/pybind11/*.cmake") 32 | pkgconfig_files = glob.glob("pybind11/share/pkgconfig/*.pc") 33 | headers = main_headers + detail_headers + stl_headers 34 | 35 | cmdclass = {"install_headers": InstallHeadersNested} 36 | $extra_cmd 37 | 38 | # This will _not_ affect installing from wheels, 39 | # only building wheels or installing from SDist. 40 | # Primarily intended on Windows, where this is sometimes 41 | # customized (for example, conda-forge uses Library/) 42 | base = os.environ.get("PYBIND11_GLOBAL_PREFIX", "") 43 | 44 | # Must have a separator 45 | if base and not base.endswith("/"): 46 | base += "/" 47 | 48 | setup( 49 | name="pybind11_global", 50 | version="$version", 51 | packages=[], 52 | headers=headers, 53 | data_files=[ 54 | (base + "share/cmake/pybind11", cmake_files), 55 | (base + "share/pkgconfig", pkgconfig_files), 56 | (base + "include/pybind11", main_headers), 57 | (base + "include/pybind11/detail", detail_headers), 58 | (base + "include/pybind11/stl", stl_headers), 59 | ], 60 | cmdclass=cmdclass, 61 | ) 62 | -------------------------------------------------------------------------------- /extern/pybind/tools/setup_main.py.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Setup script (in the sdist or in tools/setup_main.py in the repository) 4 | 5 | from setuptools import setup 6 | 7 | cmdclass = {} 8 | $extra_cmd 9 | 10 | setup( 11 | name="pybind11", 12 | version="$version", 13 | download_url='https://github.com/pybind/pybind11/tarball/v$version', 14 | packages=[ 15 | "pybind11", 16 | "pybind11.include.pybind11", 17 | "pybind11.include.pybind11.detail", 18 | "pybind11.include.pybind11.stl", 19 | "pybind11.share.cmake.pybind11", 20 | "pybind11.share.pkgconfig", 21 | ], 22 | package_data={ 23 | "pybind11": ["py.typed"], 24 | "pybind11.include.pybind11": ["*.h"], 25 | "pybind11.include.pybind11.detail": ["*.h"], 26 | "pybind11.include.pybind11.stl": ["*.h"], 27 | "pybind11.share.cmake.pybind11": ["*.cmake"], 28 | "pybind11.share.pkgconfig": ["*.pc"], 29 | }, 30 | extras_require={ 31 | "global": ["pybind11_global==$version"] 32 | }, 33 | entry_points={ 34 | "console_scripts": [ 35 | "pybind11-config = pybind11.__main__:main", 36 | ], 37 | "pipx.run": [ 38 | "pybind11 = pybind11.__main__:main", 39 | ] 40 | }, 41 | cmdclass=cmdclass 42 | ) 43 | -------------------------------------------------------------------------------- /extern/pybind/version.txt: -------------------------------------------------------------------------------- 1 | 2.10.1 -------------------------------------------------------------------------------- /pyPBD/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | pybind11_add_module(pypbd 2 | main.cpp 3 | 4 | bind_pointer_vector.h 5 | common.h 6 | CollisionDetectionModule.cpp 7 | ConstraintsModule.cpp 8 | ParameterObjectModule.cpp 9 | ParticleDataModule.cpp 10 | RigidBodyModule.cpp 11 | SimulationModelModule.cpp 12 | SimulationModule.cpp 13 | TimeModule.cpp 14 | TimeStepModule.cpp 15 | UtilitiesModule.cpp 16 | ) 17 | 18 | # All the same postfix, otherwise the module name ist not the same as the exported name and python gets confused 19 | set_target_properties(pypbd PROPERTIES 20 | DEBUG_POSTFIX "" 21 | RELWITHDEBINFO_POSTFIX "" 22 | MINSIZEREL_POSTFIX "") 23 | 24 | target_link_libraries(pypbd PRIVATE Simulation PositionBasedDynamics Utils ${Discregrid_LIBRARIES}) 25 | add_dependencies(pypbd Simulation PositionBasedDynamics Utils Ext_GenericParameters Ext_Discregrid) 26 | 27 | add_custom_target(pypbd_install 28 | ${PYTHON_EXECUTABLE} setup.py bdist_wheel 29 | COMMAND ${PYTHON_EXECUTABLE} -m pip install -I build/dist/py*.whl 30 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) 31 | 32 | -------------------------------------------------------------------------------- /pyPBD/ParameterObjectModule.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by sjeske on 1/22/20. 3 | // 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace py = pybind11; 14 | 15 | void ParameterObjectModule(py::module m_sub){ 16 | //auto m_sub = m.def_submodule("Common"); 17 | py::class_(m_sub, "ParameterObject") 18 | // .def(py::init<>()) TODO: no constructor for now because this object does not need to be constructable 19 | .def("getValueBool", &GenParam::ParameterObject::getValue) 20 | .def("getValueInt", &GenParam::ParameterObject::getValue) 21 | .def("getValueUInt", &GenParam::ParameterObject::getValue) 22 | .def("getValueFloat", &GenParam::ParameterObject::getValue) 23 | .def("getValueString", &GenParam::ParameterObject::getValue) 24 | 25 | .def("setValueBool", &GenParam::ParameterObject::setValue) 26 | .def("setValueInt", &GenParam::ParameterObject::setValue) 27 | .def("setValueUInt", &GenParam::ParameterObject::setValue) 28 | .def("setValueFloat", &GenParam::ParameterObject::setValue) 29 | .def("setValueString", &GenParam::ParameterObject::setValue); 30 | } 31 | -------------------------------------------------------------------------------- /pyPBD/SimulationModule.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace py = pybind11; 9 | 10 | void SimulationModule(py::module m_sub) { 11 | // --------------------------------------- 12 | // Class Simulation 13 | // --------------------------------------- 14 | py::class_(m_sub, "Simulation") 15 | .def(py::init<>()) 16 | .def_static("getCurrent", &PBD::Simulation::getCurrent, py::return_value_policy::reference) 17 | .def_static("setCurrent", &PBD::Simulation::setCurrent) 18 | .def_static("hasCurrent", &PBD::Simulation::hasCurrent) 19 | 20 | .def("init", &PBD::Simulation::init) 21 | .def("reset", &PBD::Simulation::reset) 22 | .def("getModel", &PBD::Simulation::getModel, py::return_value_policy::reference_internal) 23 | .def("setModel", &PBD::Simulation::setModel) 24 | .def("getTimeStep", &PBD::Simulation::getTimeStep, py::return_value_policy::reference_internal) 25 | .def("setTimeStep", &PBD::Simulation::setTimeStep) 26 | .def("initDefault", [](PBD::Simulation &sim) 27 | { 28 | sim.setModel(new PBD::SimulationModel()); 29 | sim.getModel()->init(); 30 | PBD::CubicSDFCollisionDetection* cd = new PBD::CubicSDFCollisionDetection(); 31 | sim.getTimeStep()->setCollisionDetection(*sim.getModel(), cd); 32 | }) 33 | ; 34 | } -------------------------------------------------------------------------------- /pyPBD/TimeModule.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace py = pybind11; 8 | 9 | void TimeModule(py::module m_sub) { 10 | // --------------------------------------- 11 | // Class Time Manager 12 | // --------------------------------------- 13 | py::class_(m_sub, "TimeManager") 14 | .def(py::init<>()) 15 | .def_static("getCurrent", &PBD::TimeManager::getCurrent, py::return_value_policy::reference) 16 | .def_static("setCurrent", &PBD::TimeManager::setCurrent) 17 | .def_static("hasCurrent", &PBD::TimeManager::hasCurrent) 18 | 19 | .def("getTime", &PBD::TimeManager::getTime) 20 | .def("setTime", &PBD::TimeManager::setTime) 21 | .def("getTimeStepSize", &PBD::TimeManager::getTimeStepSize) 22 | .def("setTimeStepSize", &PBD::TimeManager::setTimeStepSize); 23 | } -------------------------------------------------------------------------------- /pyPBD/TimeStepModule.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace py = pybind11; 12 | 13 | void TimeStepModule(py::module m_sub) 14 | { 15 | py::class_(m_sub, "TimeStep") 16 | //.def(py::init<>()) 17 | .def("step", &PBD::TimeStep::step) 18 | .def("reset", &PBD::TimeStep::reset) 19 | .def("init", &PBD::TimeStep::init) 20 | .def("setCollisionDetection", &PBD::TimeStep::setCollisionDetection) 21 | .def("getCollisionDetection", &PBD::TimeStep::getCollisionDetection, py::return_value_policy::reference_internal); 22 | 23 | py::class_(m_sub, "TimeStepController") 24 | .def_readwrite_static("NUM_SUB_STEPS", &PBD::TimeStepController::NUM_SUB_STEPS) 25 | .def_readwrite_static("MAX_ITERATIONS", &PBD::TimeStepController::MAX_ITERATIONS) 26 | .def_readwrite_static("MAX_ITERATIONS_V", &PBD::TimeStepController::MAX_ITERATIONS_V) 27 | .def_readwrite_static("VELOCITY_UPDATE_METHOD", &PBD::TimeStepController::VELOCITY_UPDATE_METHOD) 28 | .def_readwrite_static("ENUM_VUPDATE_FIRST_ORDER", &PBD::TimeStepController::ENUM_VUPDATE_FIRST_ORDER) 29 | .def_readwrite_static("ENUM_VUPDATE_SECOND_ORDER", &PBD::TimeStepController::ENUM_VUPDATE_SECOND_ORDER) 30 | 31 | .def(py::init<>()); 32 | } -------------------------------------------------------------------------------- /pyPBD/common.h: -------------------------------------------------------------------------------- 1 | #ifndef PBD_COMMON_H 2 | #define PBD_COMMON_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "Common/Common.h" 10 | #include "Simulation/SimulationModel.h" 11 | 12 | //PYBIND11_MAKE_OPAQUE(std::vector) 13 | PYBIND11_MAKE_OPAQUE(std::vector) 14 | PYBIND11_MAKE_OPAQUE(std::vector) 15 | PYBIND11_MAKE_OPAQUE(std::vector) 16 | PYBIND11_MAKE_OPAQUE(std::vector) 17 | 18 | #endif //PBD_COMMON_H 19 | -------------------------------------------------------------------------------- /pyPBD/examples/math_tools.py: -------------------------------------------------------------------------------- 1 | import math 2 | import numpy as np 3 | 4 | 5 | ###################################################### 6 | # compute rotation matrix 7 | ###################################################### 8 | def rotation_matrix(angle, axis): 9 | x = axis[0] 10 | y = axis[1] 11 | z = axis[2] 12 | d = math.sqrt(x*x + y*y + z*z) 13 | if d < 1.0e-6: 14 | print ("Vector of rotation matrix is zero!") 15 | return 16 | x = x/d; 17 | y = y/d; 18 | z = z/d; 19 | 20 | x2 = x*x; 21 | y2 = y*y; 22 | z2 = z*z; 23 | s = math.sin(angle); 24 | c = math.cos(angle); 25 | c1 = 1.0-c; 26 | xyc = x*y*c1; 27 | xzc = x*z*c1; 28 | yzc = y*z*c1; 29 | xs=x*s; 30 | ys=y*s; 31 | zs=z*s; 32 | 33 | return np.array(((c + x2*c1, xyc-zs, xzc+ys), 34 | (xyc+zs, c+y2*c1, yzc-xs), 35 | (xzc-ys, yzc+xs, c+z2*c1))) 36 | 37 | -------------------------------------------------------------------------------- /pyPBD/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // Put this here for now 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | #include 9 | INIT_LOGGING 10 | INIT_TIMING 11 | 12 | namespace py = pybind11; 13 | 14 | void CollisionDetectionModule(py::module); 15 | void ConstraintsModule(py::module); 16 | void ParameterObjectModule(py::module); 17 | void ParticleDataModule(py::module); 18 | void RigidBodyModule(py::module); 19 | void SimulationModelModule(py::module); 20 | void SimulationModule(py::module); 21 | void TimeStepModule(py::module); 22 | void TimeModule(py::module); 23 | void UtilitiesModule(py::module); 24 | 25 | PYBIND11_MODULE(pypbd, m) 26 | { 27 | CollisionDetectionModule(m); 28 | ParticleDataModule(m); 29 | RigidBodyModule(m); 30 | ParameterObjectModule(m); 31 | SimulationModelModule(m); 32 | SimulationModule(m); 33 | ConstraintsModule(m); 34 | TimeStepModule(m); 35 | TimeModule(m); 36 | UtilitiesModule(m); 37 | } -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | dist-dir = build/dist 3 | 4 | [egg_info] 5 | egg_base = build/ -------------------------------------------------------------------------------- /version.txt: -------------------------------------------------------------------------------- 1 | 2.2.1 --------------------------------------------------------------------------------