Open source C++ physics engine library in 3D

Overview

ReactPhysics3D
ReactPhysics3D

ReactPhysics3D is an open source C++ physics engine library that can be used in 3D simulations and games.

www.reactphysics3d.com

Build

Drawing

🎯 Features

  • Rigid body dynamics
  • Discrete collision detection
  • Collision shapes (Sphere, Box, Capsule, Convex Mesh, Static Concave Mesh, Height Field)
  • Multiple collision shapes per body
  • Broadphase collision detection (Dynamic AABB tree)
  • Narrowphase collision detection (SAT/GJK)
  • Collision response and friction (Sequential Impulses Solver)
  • Joints (Ball and Socket, Hinge, Slider, Fixed)
  • Collision filtering with categories
  • Ray casting
  • Sleeping technique for inactive bodies
  • Multi-platform (Windows, Linux, Mac OS X)
  • No external libraries (do not use STL containers)
  • Documentation (user manual and Doxygen API)
  • Testbed application with demos
  • Integrated profiler
  • Debugging renderer
  • Logs
  • Unit tests

📖 Documentation

You can find the user manual and the Doxygen API documentation here.

ℹ️ Branches

The "master" branch always contains the last released version of the library and some possible hot fixes. This is the most stable version. On the other side, the "develop" branch is used for development. This branch is frequently updated and can be quite unstable. Therefore, if you want to use the library in your application, it is recommended to checkout the "master" branch.

Questions

If you have any questions about the library and how to use it, you should use Github Discussions to read previous questions and answers or to ask new questions. If you want, you can also share your project there if you are using the ReactPhysics3D library.

⚠️ Issues

If you find any issue with the library, you can report it on the issue tracker here.

👨 Author

The ReactPhysics3D library has been created and is maintained by Daniel Chappuis.

©️ License

The ReactPhysics3D library is released under the open-source ZLib license.

👍 Sponsorship

If you are using this library and want to support its development, you can sponsor it here.

👏 Credits

Thanks a lot to Erin Catto, Dirk Gregorius, Erwin Coumans, Pierre Terdiman and Christer Ericson for their amazing GDC presentations, their physics engines, their books or articles and their contributions on many physics engine forums.

Thanks to all the contributors that have reported issues or have taken the time to send pull requests.

Issues
  • Memory corruption?

    Memory corruption?

    Hi,

    I have enabled assertions recently in our game and hit an assertion, looks like a possible memory corruption to me if assertions are disabled. The assertion is hit at:

    • https://github.com/andreasdr/tdme2/blob/master/ext/reactphysics3d/src/collision/broadphase/DynamicAABBTree.h#L271

    It happens when trying to check if a player can spawn using this logic:

    • https://github.com/andreasdr/tdme2/blob/master/src/tdme/engine/physics/World.cpp#L386

    Any ideas? We had a related bug before but you fixed it.

    Many thanx and

    Best regards Andreas

    bug 
    opened by andreasdr 30
  • Objects fall through ConcaveMeshShape

    Objects fall through ConcaveMeshShape

    HI,

    sometimes in like 2/8 cases objects fall through ConcaveMeshShape. In my case the bounding volumes are just BoxShapes.

    I have an example video where you can see the issue:

    • https://www.youtube.com/watch?v=hCFecUVEDQs&feature=youtu.be

    I can provide another video if interested.

    Many thanx and

    Best regards Andreas

    bug 
    opened by andreasdr 30
  • Assertion Fails and Segmentation Faults With Concave Shape

    Assertion Fails and Segmentation Faults With Concave Shape

    Hi, I started using this library yesterday to help with my undergrad dissertation. I've been enjoying the library but getting tons of segmentation faults. I'm on macOS 10.15.7 using XCode.

    tid_307 (1): EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    

    This was very prevalent with my first implementation of the physics code. I need to test whether bunch of voxels collide with a mesh, so was creating a box shape and collider body for each voxel. This code produced tons of segmentation faults.

    I've since changed the code to use one box shape and collider, and purely move the transform to each voxel. However, with this change I now get an assertion fail:

    assert(contactPoints[i].size() == 0);
    

    This assertion only triggers on the 5th/6th voxel, however, which makes the problem even stranger. However, I assume it just happens that the 5th/6th voxel is actually colliding so there's a difference in the methods. Ie, for the first few voxels, there's no collision so no contact points. But for the 5th or 6th, it's colliding so there are collision points.

    And if I comment out the assertion, I get more segmentation faults from this code.

    mCollidersComponents.mCollisionShapes[i]->computeAABB(aabb, transform * mCollidersComponents.mLocalToBodyTransforms[i]);
    

    To note about the segmentation faults, they've happened in multiple places and it doesn't seem to be one problematic line of code. However, there seems to be a similarity in that it's related to the entity component system / pointers to entities.

    Segmentation Fault Stack Trace

    #0	0x000000015184d383 in reactphysics3d::BroadPhaseSystem::updateCollidersComponents(unsigned int, unsigned int, float) at OpenPL/External/ReactPhysics3D/src/systems/BroadPhaseSystem.cpp:180
    #1	0x000000015184d0fc in reactphysics3d::BroadPhaseSystem::updateCollider(reactphysics3d::Entity, float) at OpenPL/External/ReactPhysics3D/src/systems/BroadPhaseSystem.cpp:122
    #2	0x00000001517b4894 in reactphysics3d::CollisionDetectionSystem::updateCollider(reactphysics3d::Entity, float) at OpenPL/External/ReactPhysics3D/include/reactphysics3d/systems/CollisionDetectionSystem.h:435
    #3	0x00000001517b46de in reactphysics3d::CollisionBody::updateBroadPhaseState(float) const at OpenPL/External/ReactPhysics3D/src/body/CollisionBody.cpp:233
    #4	0x00000001517b543d in reactphysics3d::CollisionBody::setTransform(reactphysics3d::Transform const&) at OpenPL/External/ReactPhysics3D/src/body/CollisionBody.cpp:398
    #5	0x0000000151892065 in PL_SCENE::FillVoxels() at OpenPL/Source/Private/Objects/Private/PL_SCENE.cpp:415
    #6	0x00000001518907b8 in PL_SCENE::Voxelise(PLVector, PLVector, float) at OpenPL/Source/Private/Objects/Private/PL_SCENE.cpp:308
    #7	0x00000001519f7406 in ::PL_Scene_Voxelise(PL_SCENE *, PLVector *, PLVector *, float) at OpenPL/Source/Private/OpenPL.cpp:109
    

    Assertion Stack Trace

    #4	0x0000000156f21aa8 in reactphysics3d::NarrowPhaseInfoBatch::clear() at OpenPL/External/ReactPhysics3D/src/collision/narrowphase/NarrowPhaseInfoBatch.cpp:133
    #5	0x0000000156f2033a in reactphysics3d::NarrowPhaseInfoBatch::~NarrowPhaseInfoBatch() at OpenPL/External/ReactPhysics3D/src/collision/narrowphase/NarrowPhaseInfoBatch.cpp:47
    #6	0x0000000156f20545 in reactphysics3d::NarrowPhaseInfoBatch::~NarrowPhaseInfoBatch() at OpenPL/External/ReactPhysics3D/src/collision/narrowphase/NarrowPhaseInfoBatch.cpp:46
    #7	0x0000000156f87416 in reactphysics3d::NarrowPhaseInput::~NarrowPhaseInput() at OpenPL/External/ReactPhysics3D/include/reactphysics3d/collision/narrowphase/NarrowPhaseInput.h:54
    #8	0x0000000156f86a05 in reactphysics3d::NarrowPhaseInput::~NarrowPhaseInput() at OpenPL/External/ReactPhysics3D/include/reactphysics3d/collision/narrowphase/NarrowPhaseInput.h:54
    #9	0x0000000156f9f7df in reactphysics3d::CollisionDetectionSystem::testOverlap(reactphysics3d::CollisionBody*, reactphysics3d::CollisionBody*) at OpenPL/External/ReactPhysics3D/src/systems/CollisionDetectionSystem.cpp:1478
    #10	0x0000000156f803be in reactphysics3d::PhysicsWorld::testOverlap(reactphysics3d::CollisionBody*, reactphysics3d::CollisionBody*) at OpenPL/External/ReactPhysics3D/src/engine/PhysicsWorld.cpp:303
    #11	0x0000000156fd9068 in PL_SCENE::FillVoxels() at OpenPL/Source/Private/Objects/Private/PL_SCENE.cpp:419
    #12	0x0000000156fd7798 in PL_SCENE::Voxelise(PLVector, PLVector, float) at OpenPL/Source/Private/Objects/Private/PL_SCENE.cpp:308
    #13	0x000000015713e3e6 in ::PL_Scene_Voxelise(PL_SCENE *, PLVector *, PLVector *, float) at OpenPL/Source/Private/OpenPL.cpp:109
    

    My Code The code is slightly stripped down but still contains the core logic.

    // Create box collider at origin. Will get moved later
    CollisionBody* VoxelBody = PhysicsWorld->createCollisionBody(Transform::identity());
    BoxShape* VoxelShape = PhysicsSystem->createBoxShape(Vector3(VoxelHalfSize, VoxelHalfSize, VoxelHalfSize));
    VoxelBody->addCollider(VoxelShape, Transform::identity());
    
    std::unique_ptr<TriangleVertexArray> TriangleArray (new TriangleVertexArray(static_cast<unsigned int>(Mesh.Vertices.cols()),
                                                                         Mesh.Vertices.data(),
                                                                         3 * sizeof(double),
                                                                         static_cast<unsigned int>(Mesh.Indices.cols()),
                                                                         Mesh.Indices.data(),
                                                                         3 * sizeof(int),
                                                                         TriangleVertexArray::VertexDataType::VERTEX_DOUBLE_TYPE,
                                                                         TriangleVertexArray::IndexDataType::INDEX_INTEGER_TYPE));
            
    TriangleMesh* TriangleMesh = PhysicsSystem->createTriangleMesh();
    TriangleMesh->addSubpart(TriangleArray.get());
            
    ConcaveMeshShape* ConcaveMesh = PhysicsSystem->createConcaveMeshShape(TriangleMesh);
            
    CollisionBody* MeshBody = PhysicsWorld->createCollisionBody(Transform::identity());
    MeshBody->addCollider(ConcaveMesh, Transform::identity());
    
    for (int i = 0; i < MeshCells->size(); i++)
    {
        auto& Cell = (*MeshCells.get())[i];
                
        Eigen::Vector3d Pos = Cell->WorldPosition;
        Transform VoxelTransform = Transform::identity();
        VoxelTransform.setPosition(Vector3(Pos.x(), Pos.y(), Pos.z()));
        VoxelBody->setTransform(VoxelTransform);
    
        if (PhysicsWorld->testOverlap(MeshBody, VoxelBody))
        {
            Cell->Absorptivity = 0.75f; // DEBUG. TODO: Fill this with an actual value
        }
    }
    

    I've just done a little more testing and there are no problems if I use a box shape for the mesh body. It seems the concave mesh shape is the problem.

    I understand concave mesh collision is expensive but I was hoping to have a "one size fits all" solution. As time isn't really a concern, I hoped a concave mesh could work for all meshes I throw at it.

    You can view my roughly up to date code at: https://github.com/KarateKidzz/OpenPL

    opened by KarateKidzz 24
  • RayTracing: Does sometimes only work partially or even not at all

    RayTracing: Does sometimes only work partially or even not at all

    Hi @DanielChappuis

    I have created a isolated test, written in TDME2, that shows random behaviour of RayCasting in RP3D. This test uses no multithreading or something, its just a basic single threaded test.

    See here:

    • https://github.com/andreasdr/tdme2/blob/master/src/tdme/tests/RayTracingTest.cpp

    You can build and start with:

    • make clean && make -j hardware_threads mains
    • ./bin/tdme/tests/RayTracingTest (from main tdme2 folder)

    You can find my raytracing logic here:

    • https://github.com/andreasdr/tdme2/blob/master/src/tdme/engine/physics/World.cpp#L355

    Expected would be that interaction table will be raytraced from bottom to top, but sometimes it only works on the upper OBB part or sometimes even not at all We have similar issues with other shapes, but lets start with this one.

    You can change "player" X, Y rotation with mouse dragging and move with A,W,S,D keys.

    If you have any questions or something please tell me. As this happens randomly I suggest no error in TDME2 but I can check deeper if required.

    Many thanx and best regards Andreas

    opened by andreasdr 22
  • NaN quaternion assert, master

    NaN quaternion assert, master

    Hi Daniel

    I am trying a game scene which works using v0.7.0, but when I swap to the latest master I get the following assert.

    The assert originates from a NaN lenght of the quaternion.

    (gdb) frame 4 #4 0x000000000063f22c in reactphysics3d::Quaternion::getUnit (this=0x1462184) at /src/mathematics/Quaternion.h:266 266 assert (lengthQuaternion > MACHINE_EPSILON); (gdb) info locals lengthQuaternion = -nan(0x400000) PRETTY_FUNCTION = "reactphysics3d::Quaternion reactphysics3d::Quaternion::getUnit() const"

    #5 0x000000000063ce05 in reactphysics3d::DynamicsWorld::updateBodiesState (this=0x993820) at /src/engine/DynamicsWorld.cpp:222 222 bodies[b]->mTransform.setOrientation(mConstrainedOrientations[index].getUnit()); (gdb) info locals index = 2 b = 0 bodies = 0x1427e90 islandIndex = 0

    bug 
    opened by aliasdevelopment 22
  • ReactPhysics3D simulation quite unstable

    ReactPhysics3D simulation quite unstable

    It doesnt take many in game ticks before my simulation, which is 15 kinetic bodies attached by simple hinge joints and a floor polygon, to "blow up" and go crazy. Are there any settings or easy tweaks to improve the stability of the simulation?

    Thanks.

    bug 
    opened by ghost 21
  • Creating Polyhedron Mesh

    Creating Polyhedron Mesh

    I am trying to create a square pyramid as a polyhedron mesh - 4 outer triangular faces and two base triangular faces.

    I am able to successfully create the polygon vertex array, but I am having problems with the polyhedron creation stage.

    I am following the progression of shape creation as outlined in the user manual.

    I would appreciate help with this! Thanks

    question 
    opened by auyar1 17
  • Creating Linked List - Contact Manifold

    Creating Linked List - Contact Manifold

    Hi, I am trying to create a linked list of all the contact manifold points using your documentation:

    //add contact manifold to the linked list, IF the two shapes overlap (aabb check) rp3d::List<const rp3d::ContactManifold*> manifolds;

    // Get all the contacts of the world manifolds = dynamicsWorld->getContactsList(); rp3d::List<const rp3d::ContactManifold*>::iterator it;

    // For each contact manifold for (it = manifolds.begin(); it != manifolds.end(); ++it) { const rp3d::ContactManifold* manifold = *it;

    but my team and I are running into an error at this piece:

     error: ‘iterator’ is not a member of ‘reactphysics3d::List<const reactphysics3d::ContactManifold*>’

             rp3d::List<const rp3d::ContactManifold*>::iterator it;

    Any help would be great!

    question 
    opened by ghost 15
  • Question about  solvePositionCorrection

    Question about solvePositionCorrection

    hello, when I test HingeJoint, there are two shapes in the righidbody, and the rigid body connect a static rigid body. the dynamic rigid body rotate around z axis, and anchor point is(-1, 0, 0). it works but the dynamic rigid body's position is wrong, I expect the position is (0,0,0) in original. but the position is (0.5,0,0). it is not the same as the Position in Unity3d.
    So, I do things like below: rp3d::WorldSettings settings; settings.defaultPositionSolverNbIterations = 0; the original(or Init) position is right, but the anchor point has some offset, not I respected.

    All in all , when I export unity physics data, and import the data to my app. the hingeJoint simulate result is not right.

    question 
    opened by liuqiangNetease 15
  • Question about  EventListener

    Question about EventListener

    hello!

    1. How Can I implement OnCollisionEnter(), OnCollisionExit(); OnCollisionStay(), OnTriggerEnter(), OnTriggerExit(); OnTriggerStay() as the same with unity3d?
    enhancement 
    opened by liuqiangNetease 14
  • ubuntu linux installation doesn't place .h files in correct subfolders

    ubuntu linux installation doesn't place .h files in correct subfolders

    On installing on ubuntu linux 18.04 I get the following install messages

    Install the project... -- Install configuration: "Release" -- Installing: /usr/local/lib/libreactphysics3d.so.0.7.1 -- Installing: /usr/local/lib/libreactphysics3d.so.0.7 -- Installing: /usr/local/lib/libreactphysics3d.so -- Installing: /usr/local/include/reactphysics3d/configuration.h -- Installing: /usr/local/include/reactphysics3d/decimal.h -- Installing: /usr/local/include/reactphysics3d/reactphysics3d.h -- Installing: /usr/local/include/reactphysics3d/Body.h -- Installing: /usr/local/include/reactphysics3d/CollisionBody.h -- Installing: /usr/local/include/reactphysics3d/RigidBody.h -- Installing: /usr/local/include/reactphysics3d/ContactPointInfo.h -- Installing: /usr/local/include/reactphysics3d/ContactManifoldInfo.h -- Installing: /usr/local/include/reactphysics3d/BroadPhaseAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/DynamicAABBTree.h -- Installing: /usr/local/include/reactphysics3d/CollisionDispatch.h -- Installing: /usr/local/include/reactphysics3d/DefaultCollisionDispatch.h -- Installing: /usr/local/include/reactphysics3d/VoronoiSimplex.h -- Installing: /usr/local/include/reactphysics3d/GJKAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/SATAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/NarrowPhaseAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/SphereVsSphereAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/CapsuleVsCapsuleAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/SphereVsCapsuleAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/SphereVsConvexPolyhedronAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/CapsuleVsConvexPolyhedronAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/ConvexPolyhedronVsConvexPolyhedronAlgorithm.h -- Installing: /usr/local/include/reactphysics3d/AABB.h -- Installing: /usr/local/include/reactphysics3d/ConvexShape.h -- Installing: /usr/local/include/reactphysics3d/ConvexPolyhedronShape.h -- Installing: /usr/local/include/reactphysics3d/ConcaveShape.h -- Installing: /usr/local/include/reactphysics3d/BoxShape.h -- Installing: /usr/local/include/reactphysics3d/CapsuleShape.h -- Installing: /usr/local/include/reactphysics3d/CollisionShape.h -- Installing: /usr/local/include/reactphysics3d/ConvexMeshShape.h -- Installing: /usr/local/include/reactphysics3d/SphereShape.h -- Installing: /usr/local/include/reactphysics3d/TriangleShape.h -- Installing: /usr/local/include/reactphysics3d/ConcaveMeshShape.h -- Installing: /usr/local/include/reactphysics3d/HeightFieldShape.h -- Installing: /usr/local/include/reactphysics3d/RaycastInfo.h -- Installing: /usr/local/include/reactphysics3d/ProxyShape.h -- Installing: /usr/local/include/reactphysics3d/TriangleVertexArray.h -- Installing: /usr/local/include/reactphysics3d/PolygonVertexArray.h -- Installing: /usr/local/include/reactphysics3d/TriangleMesh.h -- Installing: /usr/local/include/reactphysics3d/PolyhedronMesh.h -- Installing: /usr/local/include/reactphysics3d/HalfEdgeStructure.h -- Installing: /usr/local/include/reactphysics3d/CollisionDetection.h -- Installing: /usr/local/include/reactphysics3d/NarrowPhaseInfo.h -- Installing: /usr/local/include/reactphysics3d/ContactManifold.h -- Installing: /usr/local/include/reactphysics3d/ContactManifoldSet.h -- Installing: /usr/local/include/reactphysics3d/MiddlePhaseTriangleCallback.h -- Installing: /usr/local/include/reactphysics3d/BallAndSocketJoint.h -- Installing: /usr/local/include/reactphysics3d/ContactPoint.h -- Installing: /usr/local/include/reactphysics3d/FixedJoint.h -- Installing: /usr/local/include/reactphysics3d/HingeJoint.h -- Installing: /usr/local/include/reactphysics3d/Joint.h -- Installing: /usr/local/include/reactphysics3d/SliderJoint.h -- Installing: /usr/local/include/reactphysics3d/CollisionWorld.h -- Installing: /usr/local/include/reactphysics3d/ConstraintSolver.h -- Installing: /usr/local/include/reactphysics3d/ContactSolver.h -- Installing: /usr/local/include/reactphysics3d/DynamicsWorld.h -- Installing: /usr/local/include/reactphysics3d/EventListener.h -- Installing: /usr/local/include/reactphysics3d/Island.h -- Installing: /usr/local/include/reactphysics3d/Material.h -- Installing: /usr/local/include/reactphysics3d/OverlappingPair.h -- Installing: /usr/local/include/reactphysics3d/Timer.h -- Installing: /usr/local/include/reactphysics3d/Timer.cpp -- Installing: /usr/local/include/reactphysics3d/CollisionCallback.h -- Installing: /usr/local/include/reactphysics3d/OverlapCallback.h -- Installing: /usr/local/include/reactphysics3d/mathematics.h -- Installing: /usr/local/include/reactphysics3d/mathematics_functions.h -- Installing: /usr/local/include/reactphysics3d/Matrix2x2.h -- Installing: /usr/local/include/reactphysics3d/Matrix3x3.h -- Installing: /usr/local/include/reactphysics3d/Quaternion.h -- Installing: /usr/local/include/reactphysics3d/Transform.h -- Installing: /usr/local/include/reactphysics3d/Vector2.h -- Installing: /usr/local/include/reactphysics3d/Vector3.h -- Installing: /usr/local/include/reactphysics3d/Ray.h -- Installing: /usr/local/include/reactphysics3d/MemoryAllocator.h -- Installing: /usr/local/include/reactphysics3d/DefaultPoolAllocator.h -- Installing: /usr/local/include/reactphysics3d/DefaultSingleFrameAllocator.h -- Installing: /usr/local/include/reactphysics3d/DefaultAllocator.h -- Installing: /usr/local/include/reactphysics3d/MemoryManager.h -- Installing: /usr/local/include/reactphysics3d/Stack.h -- Installing: /usr/local/include/reactphysics3d/LinkedList.h -- Installing: /usr/local/include/reactphysics3d/List.h -- Installing: /usr/local/include/reactphysics3d/Map.h -- Installing: /usr/local/include/reactphysics3d/Set.h -- Installing: /usr/local/include/reactphysics3d/Pair.h -- Installing: /usr/local/include/reactphysics3d/Profiler.h -- Installing: /usr/local/include/reactphysics3d/Logger.h

    However when linking the library into a project it expects the header files in the subdirectories. For example:

    /usr/local/include/reactphysics3d/configuration.h:36:10: fatal error: containers/Pair.h: No such file or directory #include "containers/Pair.h"

    Thanks!

    bug 
    opened by nattydread69 13
  • `setTransform` without adding velocity.

    `setTransform` without adding velocity.

    I'm making a game with a big terrain. If I use absolute position for colliders, everything is fine around the center of the world. But if the player goes far enough, there's not enough precision in float32 to simulate everyting properly. So I came up with dividing the world into chunks and use chunk-relative positioning. When a player moves into a different chunk, I shift all the rigidbodies accordingly by using setTransform. This way collision works fine everywhere, but a different problem appears. If a dynamic body is close to a static body when the player moves into a different chunk, it just gains an insane amount of velocity and flies out of the world. I looked at setTransform implementation and saw that it always changes linear velocity and thought that maybe velocity shouldn't be changed when moving between chunks. I added an optional parameter bool updateLinearVelocity to setTransform which defaults to true, so now it looks like this:

    class RigidBody : public CollisionBody {
        virtual void setTransform(const Transform& transform, bool updateLinearVelocity = true) override;
        ...
    }
    void RigidBody::setTransform(const Transform& transform, bool updateLinearVelocity) {
    
        const Vector3 oldCenterOfMass = mWorld.mRigidBodyComponents.getCenterOfMassWorld(mEntity);
    
        // Compute the new center of mass in world-space coordinates
        const Vector3& centerOfMassLocal = mWorld.mRigidBodyComponents.getCenterOfMassLocal(mEntity);
        mWorld.mRigidBodyComponents.setCenterOfMassWorld(mEntity, transform * centerOfMassLocal);
    
        // Update the linear velocity of the center of mass
        if (updateLinearVelocity) {
            Vector3 linearVelocity = mWorld.mRigidBodyComponents.getLinearVelocity(mEntity);
            const Vector3& angularVelocity = mWorld.mRigidBodyComponents.getAngularVelocity(mEntity);
            const Vector3& centerOfMassWorld = mWorld.mRigidBodyComponents.getCenterOfMassWorld(mEntity);
            linearVelocity += angularVelocity.cross(centerOfMassWorld - oldCenterOfMass);
            mWorld.mRigidBodyComponents.setLinearVelocity(mEntity, linearVelocity);
        }
    
        CollisionBody::setTransform(transform);
    
        // Awake the body if it is sleeping
        setIsSleeping(false);
    }
    
    

    When player moves between chunks I call setTransform with false and it works fine without the issue.

    opened by twixuss 1
  • ConcaveMeshShape/TriangleVertexArray not working?

    ConcaveMeshShape/TriangleVertexArray not working?

    So I tried to use the ConcaveMeshShape for the basic structure of my scene. But it doesn't seem to have the correct dimensions and/or vertices. I'm using Assimp to import my models. My code to create a ConcaveMeshShape looks like this:

    if (entity.HasComponent<ConcaveColliderComponent>() && entity.HasComponent<MeshComponent>())
    {
        auto& concaveCollider = entity.GetComponent<ConcaveColliderComponent>();
        concaveCollider.RuntimeFixture = rigidbody;
    
        auto& meshComponent = entity.GetComponent<MeshComponent>();
    
        // create triangle mesh
        concaveCollider.TriangleMesh = (void*)m_PhysicsCommon.createTriangleMesh();
        for (auto& subMesh : meshComponent.MeshRef->GetSubMeshes())
        {
            const float* vertices = subMesh.Positions.data();
            uint32_t vertexCount = subMesh.VertexCount;
            size_t vertexStride = subMesh.VertexStride;
    
            const uint32_t* uIndices = subMesh.Indices.data();
                        
            int32_t* indices = new int32_t[subMesh.IndexCount];
            for (uint32_t i = 0; i < subMesh.IndexCount; i++)
                indices[i] = (int32_t)uIndices[i];
    
            uint32_t triangeCount = subMesh.TriangleCount;
    
            TriangleVertexArray* triangleArray = new TriangleVertexArray(vertexCount, vertices, vertexStride * sizeof(float),
                triangeCount, indices, 3 * sizeof(int32_t),
                TriangleVertexArray::VertexDataType::VERTEX_FLOAT_TYPE,
                TriangleVertexArray::IndexDataType::INDEX_INTEGER_TYPE);
    
            // add the triangle vertex array to the triangle mesh
            ((TriangleMesh*)concaveCollider.TriangleMesh)->addSubpart(triangleArray);
        }
    
        // create concave mesh shape
        ConcaveMeshShape* concaveMeshShape = m_PhysicsCommon.createConcaveMeshShape((TriangleMesh*)concaveCollider.TriangleMesh, Vector3(transformComponent.Scale.x, transformComponent.Scale.y, transformComponent.Scale.z));
                
        // create collider
        Collider* collider = rigidbody->addCollider(concaveMeshShape, Transform());
        concaveCollider.RuntimeCollider = (void*)collider;
    }
    

    I get the vertex and index data from the different sub meshes directly from Assimp. I didn't know if unsigned integer types were allowed in the TriangleVertexArray constructor so I casted all indices to integers. Would be great if someone could clarify if unsigned integers also work.

    Is there a step I'm missing or something like that. I can't figure out what would be wrong with this implementation from the documentation. There seems to be some kind of collision happening but the scale and/or the vertex positions seem to be off. I checked that my transformComponent.Scale is correct and it is.

    I would really appreciate help with this issue I'm having. :)

    opened by NullJupiter 4
  • Code is working but no window?

    Code is working but no window?

    I have used the CMake extension in vs code and the compiling has no warning or errors but there is just no window when I run the executable, any fixes for this?

    question 
    opened by vinniedaboi 3
  • Build warnings and errors on UWP

    Build warnings and errors on UWP

    When building 0.9.0 on UWP, there's some additional warnings and errors that surface! I am currently trying to switch from calling msbuild directly on Windows (which did work) to calling cmake instead, so I suspect these popped up now for me because of some different flags in use between the two.

    This error pops up in a dozen or so locations, this one should be possible for me to avoid with some arcane cmake, but would be nice if I didn't have to.

    C:\Temp\StereoKitBuild\reactphysics3d\include\reactphysics3d/utils/DefaultLogger.h(109,58): error C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. (compiling source file C:\Temp\StereoKitBuild\reactphysics3d\src\utils\DefaultLogger.cpp) [C:\Temp\StereoKitBuild\reactphysics3d\build_x64_UWP_Release\reactphysics3d.vcxproj ]
    

    And then there's these two errors, which I didn't trace too far, but could be valid complaints.

    C:\Temp\StereoKitBuild\reactphysics3d\src\systems\CollisionDetectionSystem.cpp(537): error C4703: potentially uninitialized local pointer variable 'shape1' used [C:\Temp\StereoKitBuild\reactphysics3d\build_x64_UWP_Release\reactphysics3d.vcxproj]
    C:\Temp\StereoKitBuild\reactphysics3d\src\systems\CollisionDetectionSystem.cpp(537): error C4703: potentially uninitialized local pointer variable 'shape2' used [C:\Temp\StereoKitBuild\reactphysics3d\build_x64_UWP_Release\reactphysics3d.vcxproj]
    

    This warning also pops up a dozen times or so in different places. It does mention a pretty specific solution, but I'm still trying to wrap my head around it, so I'm just sharing it here for completeness.

    C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.32.31326\include\ostream(770,1): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (compiling source file C:\Temp\StereoKitBuild\reactphysics3d\src\utils\DefaultLogger.cpp) [C:\Temp\StereoKitBuild\reactphysics3d\build_x64_UWP_Release\reactphysics3d.vcxproj]
    C:\Temp\StereoKitBuild\reactphysics3d\include\reactphysics3d/utils/DefaultLogger.h(107): message : see reference to function template instantiation 'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const char *)' being compiled (compiling source file C:\Temp\StereoKitBuild\reactphysics3d\src\utils\DefaultLogger.cpp) [C:\Temp\StereoKitBuild\reactphysics3d\build_x64_UWP_Release\reactphysics3d.vcxproj]
    

    And for reference, here's approximately my cmake commands:

    cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=/MP -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -DDYNAMIC_LOADER=OFF .. -Wno-dev
    cmake --build . --config Release -- /m
    
    bug 
    opened by maluoi 1
  • Fix typo, which causes SAT edge VS edge algorithm never generates any real contact point

    Fix typo, which causes SAT edge VS edge algorithm never generates any real contact point

    The value of variable penetrationDepth1 will nevel be smaller than minPenetrationDepth, by the defination of minPenetrationDepth. I think this should be penetrationDepth than penetrationDepth1

    opened by jingqi 1
  • Random assert

    Random assert "Assertion failed: mNodes[nodeID].aabb.contains(newAABB)"

    This happens sometimes, just by random after ~5-50secs of running code that doesn't use anything except static rigidbodies and collisionbodies. Just character controller that uses collide to find extrusion vector and some static geometry. The more rigidbodies I have the more probability of crash (it crashed after about 5 secs after adding ~30 rigidbodies)

    What should I try to check to locate the root of the problem. I mean, this assert fails on broad phase but I don't touch broad phase manually, I only call world.update() then interpolate transforms almost as written in docs...

    opened by caxapexac 2
Releases(v0.9.0)
  • v0.9.0(Jan 4, 2022)

    Added

    • The performance of the collision detection and rigid bodies simulation (PhysicsWorld::update() method) has been improved significantly (1.7x speedup on average measured in PEEL scenes)
    • Method RigidBody::resetForce() to reset the accumulated external force on a rigid body has been added
    • Method RigidBody::resetTorque() to reset the accumulated external torque on a rigid body has been added
    • Constructors with local-space anchor/axis have been added to BallAndSocketJointInfo, HingeJointInfo, FixedJointInfo and SliderJointInfo classes
    • Method HingeJoint::getAngle() to get the current angle of the hinge joint has been added
    • Method Joint::getReactionForce() has been added to retrieve the current reaction force of a joint
    • Method Joint::getReactionTorque() has been added to retrieve the current reaction torque of a joint
    • Method RigidBody::setLinearLockAxisFactor() to lock the translational movement of a body along the world-space x, y and z axes
    • Method RigidBody::setAngularLockAxisFactor() to lock the rotational movement of a body around the world-space x, y and z axes
    • Method RigidBody::applyLocalForceAtWorldPosition() to manually apply a force to a rigid body
    • Method RigidBody::applyLocalForceAtLocalPosition() to manually apply a force to a rigid body
    • Method RigidBody::applyLocalForceToCenterOfMass() to manually apply a force to a rigid body
    • Method RigidBody::applyLocalTorque() to apply a local-space torque to a rigid body
    • Method RigidBody::getForce() to get the total manually applied force on a rigid body
    • Method RigidBody::getTorque() to get the total manually applied torque on a rigid body
    • Method RigidBody::setIsSleeping() is now public in order to wake up or put to sleep a rigid body
    • A cone limit can now be set to the ball-and-socket joint (this is useful for ragdolls)
    • New scenes have been added to the testbed application (Box Tower, Ragdoll, Rope, Ball And Socket Joint, Bridge, Hinge Joint, Hinge Joint chain, Ball and Socket Joint chain, Ball and Socket Joint net, ...)
    • It is now possible to move bodies using the mouse (CTRL + click and drag) in the testbed application

    Changed

    • The PhysicsWorld::setGravity() method now takes a const parameter
    • Rolling resistance constraint is not solved anymore in the solver. Angular damping needs to be used instead to simulate it.
    • The List class has been renamed to Array
    • The default number of iterations for the velocity solver is now 6 instead of 10
    • The default number of iterations for the position solver is now 3 instead of 5
    • Rename method RigidBody::applyForceAtWorldPosition() into RigidBody::applyWorldForceAtWorldPosition()
    • Rename method RigidBody::applyForceAtLocalPosition() into RigidBody::applyWorldForceAtLocalPosition()
    • Rename method RigidBody::applyForceToCenterOfMass() into RigidBody::applyWorldForceAtCenterOfMass()
    • Rename method RigidBody::applyTorque() into RigidBody::applyWorldTorque()
    • The raycasting broad-phase performance has been improved
    • The raycasting performance against HeighFieldShape has been improved (better middle-phase algorithm)
    • Robustness of polyhedron vs polyhedron collision detection has been improved in SAT algorithm (face contacts are favored over edge-edge contacts for better stability)

    Removed

    • Method Material::getRollingResistance() has been removed (angular damping has to be used instead of rolling resistance)
    • Method Material::setRollingResistance() has been removed (angular damping has to be used instead of rolling resistance)

    Fixed

    • Issue #165 with order of contact manifolds in islands creation has been fixed
    • Issue #179 with FixedJoint constraint
    • Issue #195 in RigidBodyComponents
    • Issue with concave vs convex shape collision detection has been fixed
    • Issue with edge vs edge collision has been fixed in SAT algorithm (wrong contact normal was computed)
    • Issue with sphere radius in DebugRenderer
    • Issue where changing the transform of a Collider attached to a sleeping RigidBody caused the body to remain asleep
    • Issue with wrong calculation performed in the ContactSolverSystem
    • Issue with joints when center of mass is not at the center of the rigid body local-space
    • Issue #157 with matrix to quaternion conversion has been fixed
    • Issue #184 with update of mass/inertia properties of static bodies
    • Issue with the computation of the two friction vectors in the contact solver
    • Issue with the rendering of the capsule collision shape in the Debug Renderer (missing triangle faces)
    • Issue with wrong linear velocity update computed in RigidBody::setLocalCenterOfMass() method
    • Issue with wrong linear velocity update computed in RigidBody::updateLocalCenterOfMassFromColliders() method
    • Issue with wrong linear velocity update computed in RigidBody::updateMassPropertiesFromColliders() method
    • Issue in copy-constructors in Map and Set classes
    • A lot of code warnings have been fixed #221, #222, #223 and #224
    • The default warning level is not set anymore in CMakeLists.txt file (Issue #220)
    • Issue #225 with collision not working when setting a body to be static before calling updateMassPropertiesFromColliders()
    Source code(tar.gz)
    Source code(zip)
    reactphysics3d-0.9.0.tar.gz(13.50 MB)
    reactphysics3d-0.9.0.zip(15.48 MB)
  • v0.8.0(May 31, 2020)

    This release contains some public API changes. Please read carefully the following changes before upgrading to this new version and do not hesitate to take a look at the user manual.

    Added

    • It is now possible to change the size of a BoxShape using the BoxShape::setHalfExtents() method
    • It is now possible to change the radius of a SphereShape using the SphereShape::setRadius() method
    • It is now possible to change the height and radius of a CapsuleShape using the CapsuleShape::setHeight() and CapsuleShape::setRadius() methods
    • It is now possible to change the scale of a ConvexMeshShape using the ConvexMeshShape::setScale() method
    • It is now possible to change the scale of a ConcaveMeshShape using the ConcaveMeshShape::setScale() method
    • It is now possible to change the scale of a HeightFieldShape using the HeightFieldShape::setScale() method
    • A method PhysicsWorld::getCollisionBody(uint index) has been added on a physics world to retrieve a given CollisionBody
    • A method PhysicsWorld::getRigidBody(uint index) has been added on a physics world to retrieve a given RigidBody
    • A RigidBody::getLocalCenterOfMass() method has been added to retrieve the current local-space center of mass of a rigid body
    • Add PhysicsCommon class that needs to be instanciated at the beginning and is used as a factory for other objects of the library (see the user manual)
    • The RigidBody::updateLocalCenterOfMassFromColliders() method has been added to compute and set the center of mass of a body using its colliders
    • The RigidBody::updateLocalInertiaTensorFromColliders() method has been added to compute and set the local inertia tensor of a body using its colliders
    • The RigidBody::getLocalInertiaTensor() method has been added to retrieve the local-space inertia tensor of a rigid body
    • The RigidBody::updateMassFromColliders() method has been added to compute and set the mass of a body using its colliders
    • A Material nows has a mass density parameter that can be set using the Material::setMassDensity() method. The mass density is used to compute the mass of a collider when computing the mass of a rigid body
    • A Collider can now be a trigger. This collider will be used to only report collisions with another collider but no collision response will be applied. You can use the Collider::setIsTrigger() method for this.
    • The EventListener class now has a onTrigger() method that is called when a trigger collider is colling with another collider
    • In the EventListener, the onContact() and onTrigger() method now reports the type of event (start, stay, exit) for each contact. This way the user can know whether it's a new contact or not or when two colliders are not in contact anymore
    • A DebugRenderer class has been added in order to display debug info (colliders, AABBs, contacts, ...) in your simulation using graphics primitives (lines, triangles).
    • A RigidBody::applyForceAtLocalPosition() method has been added to apply a force at a given position of the rigid body in local-space
    • A default logger can be instanciated using the PhysicsCommon::createDefaultLogger() method
    • The CMakeLists.txt file of the library has been refactored to use modern CMake. The targets are now exported when you install the library so that you can import the library with the find_package(ReactPhysics3D) function in your own CMakeLists.txt file
    • A Hello World project has been added to show a very simple project that shows how to compile and use the ReactPhysics3D library

    Fixed

    • Issues #125 and #106 with CMake install of the library have been fixed
    • Issue #141 with limits of hinge and slider joints has been fixed
    • Issue #117 in documentation has been fixed
    • Issue #131 in documentation has been fixed
    • Issue #139 in API documentation has been fixed
    • Issue #122 in logger has been fixed

    Changed

    • The CollisionWorld::testCollision() methods do not have the 'categoryMaskBits' parameter anymore
    • The CollisionWorld::testOverlap() methods do not have the 'categoryMaskBits' parameter anymore
    • Many methods in the EventListener class have changed. Check the user manual for more information
    • The way to retrieve contacts has changed. Check the user manual for more information
    • DynamicsWorld and CollisionWorld classes have been merged into a single class called PhysicsWorld
    • The ProxyShape class has been renamed into Collider
    • The Material is now part of the Collider instead of the RigidBody. Therefore, it is now possible to have a RigidBody with multiple colliders and a different material for each Collider
    • The Logger has to be set using the PhysicsCommon::setLogger() method
    • The Box::getExtent() method has been renamed to Box::getHalfExtents()
    • An instance of the BoxShape class cannot be instanciated directly anymore. You need to use the PhysicsCommon::createBoxShape() method
    • An instance of the SphereShape class cannot be instanciated directly anymore. You need to use the PhysicsCommon::createSphereShape() method
    • An instance of the CapsuleShape class cannot be instanciated directly anymore. You need to use the PhysicsCommon::createCapsuleShape() method
    • An instance of the ConvexMeshShape class cannot be instanciated directly anymore. You need to use the PhysicsCommon::createConvexMeshShape() method
    • An instance of the HeightFieldShape class cannot be instanciated directly anymore. You need to use the PhysicsCommon::createHeightFieldShape() method
    • An instance of the ConcaveMeshShape class cannot be instanciated directly anymore. You need to use the PhysicsCommon::createConcaveMeshShape() method
    • An instance of the PolyhedronMesh class cannot be instanciated directly anymore. You need to use the PhysicsCommon::createPolyhedronMesh() method
    • An instance of the TriangleMesh class cannot be instanciated directly anymore. You need to use the PhysicsCommon::createTriangleMesh() method
    • The ProxyShape class has been renamed to Collider. The CollisionBody::addCollider(), RigidBody::addCollider() methods have to be used to create and add a collider to a body. Then methods CollisionBody::removeCollider(), RigidBody::removeCollider() need to be used to remove a collider from a body.
    • The RigidBody::addCollider() method (previously addProxyShape() method) does not take a "mass" parameter anymore - The RigidBody::setCenterOfMassLocal() method has been renamed to RigidBody::setLocalCenterOfMass() - The RigidBody::setInertiaTensorLocal() method has been renamed to RigidBody::setLocalInertiaTensor()
    • Now, the local inertia tensor of a rigid body has to be set using a Vector3 instead of a Matrix3x3. You only need to provide the three diagonal values of the matrix
    • The RigidBody::recomputeMassInformation() method has been renamed to RigidBody::updateMassPropertiesFromColliders.
    • Now, you need to manually call the RigidBody::updateMassPropertiesFromColliders() method after adding colliders to a rigid body to recompute its inertia tensor, center of mass and mass. There are other methods that you can use form that (see the user manual)
    • The RigidBody::applyForce() method has been renamed to RigidBody::applyForceAtWorldPosition()
    • The rendering in the testbed application has been improved
    • Many of the data inside the library have been refactored for better caching and easier parallelization in the future
    • The old Logger class has been renamed to DefaultLogger
    • The Logger class is now an abstract class that you can inherit from in order to receive log events from the library
    • User manual and API documentation have been updated

    Removed

    • The method DynamicsWorld::getContactsList() has been removed. You need to use the EventListener class to retrieve contacts now (see the user manual).
    • The DynamicsWorld::getNbJoints() method has been removed.
    • The EventListener::beginInternalTick() method has been removed (because internal ticks do not exist anymore).
    • The EventListener::endInternalTick() method has been removed (because internal ticks do not exist anymore).
    • The RigidBody::getJointsList() method has been removed.
    • It is not possible anymore to set custom pool and stack frame allocators. Only the base allocator can be customized when creating a PhysicsCommon instance.
    • The RigidBody::setInverseInertiaTensorLocal() method has been removed. The RigidBody::setInertiaTensorLocal() has to be used instead.
    • The RigidBody::getInverseInertiaTensorWorld() method has been removed.
    • The Collider::getMass() method has been removed.
    Source code(tar.gz)
    Source code(zip)
    reactphysics3d-0.8.0.tar.gz(12.15 MB)
    reactphysics3d-0.8.0.zip(14.01 MB)
  • v0.7.1(Jul 1, 2019)

    ReactPhysics3D version 0.7.1

    Added

    • Make possible for the user to get vertices, normals and triangle indices of a ConcaveMeshShape
    • Make possible for the user to get vertices and height values of the HeightFieldShape
    • Make possible for the user to use a custom single frame and pool memory allocator

    Fixed

    • Bug #45 has been fixed.
    • Bug #50 has been fixed.
    • Bug #52 has been fixed.
    • Bug #53 has been fixed.
    • Bug #54 has been fixed.
    • Bug #55 has been fixed.
    • Bug #51 has been fixed.
    • Bug #60 has been fixed.
    • Bug #57 has been fixed.
    • Bug #37 has been fixed.
    • Bug #62 has been fixed.
    • Bug #63 has been fixed.
    • Bug #82 has been fixed.
    • Bug #85 has been fixed.
    • Bug #79 has been fixed.
    • Bug: the free() method was called in PoolAllocator instead of release() method of base allocator.
    Source code(tar.gz)
    Source code(zip)
    reactphysics3d-0.7.1.tar.gz(10.92 MB)
    reactphysics3d-0.7.1.zip(13.37 MB)
  • v0.7.0(May 1, 2018)

    ReactPhysics3D version 0.7.0

    Added

    • Dedicated Sphere vs Capsule collision detection algorithm.
    • Dedicated Capsule vs Capsule collision detection algorithm.
    • Allow a Rigid Body to have zero mass (for static bodies for instance).
    • Add single frame memory allocator for faster memory allocation in a frame.
    • Make possible to have a profiler per DynamicsWorld instead of a unique one.
    • Make possible to use your own allocation/deallocation methods instead of default malloc/free
    • Make possible to display the AABB of the bodies in the testbed application.
    • Add RigidBody::setInverseLocalInertiaTensor() method to directly set the inverse inertia tensor of a rigid body.
    • More unit tests have been added

    Changed

    • Use single-shot contact manifold computation instead of incremental across several frames.
    • Replace the EPA narrow-phase collision detection with SAT algorithm.
    • The collision detection is now faster and more robust.
    • Code has been refactored such that we do not use STL containers anymore.
    • The way to create a ConvexMeshShape has changed (see the user manual)
    • The vertex indices stride has changed in the TriangleVertexArray for ConvexMeshShape (see the API documentation)
    • The raycasting of a ConvexMeshShape does not use GJK algorithm anymore.
    • The test do detect if a point is inside of a ConvexMeshShape does not use GJK algorithm anymore.
    • A lot of optimizations have been performed and the library is now faster.
    • Release code is now compiled with -O2 compiler optimization level (instead of none)
    • Documentation has been updated

    Removed

    • Quaternion constructor with Euler angles has been removed. The Quaternion::fromEulerAngles() method should be used instead.
    • Cylinder and Cone collision shapes have been removed. The ConvexMeshShape collision shape should be used instead.
    • The ProxyShape::setLocalScaling() method has been removed. The ConvexMeshShape, ConcaveMeshShape and HeightFieldShape collision shapes can be scaled directly.

    Fixed

    • Issues with checkboxes in testbed application were fixed.
    • Fix issue with wrong AABB computation that can cause missing collision in broad-phase
    • Bug #26 has been fixed.
    • Bug #30 has been fixed.
    • Bug #32 has been fixed.
    • Bug #24 has been fixed.
    • Issue #31 has been fixed.
    • Issue #34 has been fixed.
    • Issue #37 has been fixed.
    Source code(tar.gz)
    Source code(zip)
    reactphysics3d-0.7.0.tar.gz(11.00 MB)
    reactphysics3d-0.7.0.zip(13.48 MB)
  • v0.6.0(Apr 15, 2016)

    ReactPhysics3D version 0.6.0

    What is new in this version:

    • Add support for static concave triangular mesh collision shape.
    • Add support for height field collision shape.
    • Add support for rolling resistance.
    • The DynamicsWorld::update() method now takes the time step for the next simulation step in parameter.
    • It is now possible to change the local scaling of a collision shape.
    • Add new constructor of ConvexMeshShape that accepts a triangular mesh.
    • It is now easier to use your own narrow-phase collision detection algorithm.
    • The CollisionWorld and DynamicsWorld now automatically destroys bodies and joints that have not been destroyed at the end.
    • New testbed application with demo scenes.
    Source code(tar.gz)
    Source code(zip)
    reactphysics3d-0.6.0.tar.gz(5.37 MB)
    reactphysics3d-0.6.0.zip(7.33 MB)
  • v0.5.0(Mar 15, 2015)

    ReactPhysics3D version 0.5.0

    What is new in this version:

    • It is now possible to use multiple collision shapes per body.
    • Add ray casting support.
    • Replace the Sweep-And-Prune algorithm by a Dynamic AABB Tree for the broad-phase collision detection.
    • Add methods to check if a point is inside a body or a proxy shape.
    • The center of mass of a body is now automatically computed from its collision shapes.
    • Add collision filtering using collision categories (with bit masks).
    • It is possible to attach user data to a body or a proxy shape.
    • It is now possible to create a quaternion using Euler angles.
    • It now possible to activate of deactivate a body.
    • Differentiation between dynamic, kinematic and static bodies.
    • Gravity can now be changed after the creation of the world.
    • The center of mass and inertia tensor of a body can be set manually (center of mass can be different from the body origin).
    • Add a simulation step callback in the EventListener class that is called at each internal physics tick.
    • Add methods to transform points/vectors from/into local-space/world-space coordinates of a body.
    • Add CollisionWorld::testAABBOverlap() method to test overlap between two bodies or two proxy shapes.
    • Fix two issues in the EPA algorithm.
    • Add a ray casting example.
    • Add unit tests for ray casting and collision detection.
    • Use GLFW instead of GLUT/Freeglut for the examples.
    Source code(tar.gz)
    Source code(zip)
    reactphysics3d-0.5.0.tar.gz(3.65 MB)
    reactphysics3d-0.5.0.zip(5.04 MB)
  • v0.4.0(Oct 6, 2013)

    ReactPhysics3D version 0.4.0

    What is new in this version :

    • Add collision shapes (Capsule, Convex Mesh).
    • Add joints (Ball and Socket, Hinge, Slider, Fixed).
    • Add sleeping technique for inactive bodies.
    • Add velocity damping.
    • It is now easier to apply force and torque to a rigid body.
    • Add the EventListener class to allow the user to be notified when some events occur (contacts, ...).
    • Add examples for the joints and collision shapes.
    • Remove the world gravity force from the external force of rigid bodies and allow the user to disable the gravity on a given body.
    • Make possible to modify the collision margin of some collision shapes.
    • Add a Material class to keep track of the properties of a rigid body (friction coefficient, bounciness, ...).
    • Collision shapes now use the internal memory allocator.
    • New internal memory allocator.
    • Add a hierarchical real-time profiler.
    • Reduce the allocated memory of the broad-phase when several bodies are removed from the world.
    • Fix issue in the Sweep-And-Prune broad-phase collision detection (thanks to Aleksi Sapon).
    • Fix issue in the contact solver resulting in less jittering.
    Source code(tar.gz)
    Source code(zip)
    reactphysics3d-0.4.0.tar.gz(1.44 MB)
    reactphysics3d-0.4.0.zip(2.06 MB)
Owner
Daniel Chappuis
M.Sc, Computer Science (EPFL) Senior Software Engineer
Daniel Chappuis
Improved version of real-time physics engine that couples FEM-based deformables and rigid body dynamics

Enhanced version of coupled FEM and constrained rigid body simulation Description This little playground aimed to test our Conjugate Gradients based M

Andrey Voroshilov 25 Apr 11, 2022
Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified source engine as well as their Easy Anti Cheat Implementation.

Apex-Legends-SDK Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified sou

null 86 Jun 24, 2022
2D physics header-only library for videogames developed in C using raylib library.

Physac Physac is a small 2D physics engine written in pure C. The engine uses a fixed time-step thread loop to simluate physics. A physics step contai

Víctor Fisac 218 Jun 24, 2022
Integrate the ZENO node system into Blender for creating robust physics animations!

ZenoBlend Integrate the ZENO node system into Blender for creating robust physics animations! End-user Installation Goto Release page, and click Asset

Zenus Technology 31 Jun 10, 2022
Basic physics simulation of a chain

Basic Chain Simulation Compile using for example $ g++ ChainElement.cpp ChainLink.cpp Chain.cpp Simulation.cpp main.cpp -std=c++11 -o run -O3 The outp

Steffen Richters-Finger 115 May 30, 2022
This repository consists an implementation of the Algorithms encountered in Computer Science, Physics and Mathematics.

All the Algorithms you'll ever need xD This repository contains all the algorithms we have encountered in the fields of Computer Science, Mathematics

ACM VIT 7 Jan 2, 2022
FireDog - Open source cross-platform lightweight virus signature detection engine.

FireDog 开源跨平台轻量级病毒特征检测引擎。Open source cross-platform lightweight virus signature detection engine. 语言 Language C++ 11 LICENSE 是你们喜欢的:MIT License. 让我们搞起

null 38 Jun 21, 2022
Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research

Welcome to AirSim AirSim is a simulator for drones, cars and more, built on Unreal Engine (we now also have an experimental Unity release). It is open

Microsoft 13.2k Jun 28, 2022
Open-source and open-hardware scientific RPN calculator

OpenRPNCalc Open-source and open-hardware scientific RPN calculator Introduction OpenRPNCalc is a scientific calculator based on STM32 microcontroller

Anton Poluektov 135 Jun 21, 2022
A fully-functional open source and open hardware mechanical USB computer keyboard with only three keys!

threeboard threeboard is a fully-functional open source and open hardware mechanical USB computer keyboard with only three keys. It supports multiple

Conor Taylor 97 May 23, 2022
Sourcetrail - free and open-source interactive source explorer

Sourcetrail Important Note: This project was archived by the original autors and maintainers of Sourcetrail by the end of 2021. If you want to know mo

Coati Software 12.7k Jun 27, 2022
Single source file ASTC texture decompression in C++ (derived from Google's open source Android project)

astc_dec astc_dec is a single source file ASTC texture decompressor with the Apache 2.0 license, derived from Google's open source Android sources. Th

Rich Geldreich 28 Apr 11, 2022
This is a helper library to abstract away interfacing with floppy disk drives in a cross-platform and open source library.

Adafruit Floppy This is a helper library to abstract away interfacing with floppy disk drives in a cross-platform and open source library. Adafruit Fl

Adafruit Industries 125 Jun 22, 2022
First open source android modding library for Geometry Dash Based on Hooking-and-Patching-android-template

Android-ML First open source android modding library for Geometry Dash Based on Hooking-and-Patching-android-template Installation Download this githu

BlackTea ML 22 Jun 19, 2022
PRINT++ is a simple, open source print library for C++, the main usage of PRINT++ is printing out "log" messages

note that for now, print++ is using std::cout. In future it will be using own print function. Windows version can be unstable That library is in alpha

Ksawery 3 Jan 23, 2022
Love 6's Regular Expression Engine. Support Concat/Select/Closure Basic function. Hope u can enjoy this tiny engine :)

Regex_Engine Love 6's Blog Website: https://love6.blog.csdn.net/ Love 6's Regular Expression Engine Hope u can love my tiny regex engine :) maybe a fe

Love6 2 May 24, 2022
Sword Engine is a fork of Psych Engine that plans on adding more features and quality of life improvements.

⚠️ WARNING: This README is currently incomplete, This warning will be removed once it's complete. Friday Night Funkin' - Sword Engine Sword Engine is

swordcube 6 Mar 13, 2022
Two Tribes Engine; the engine which we used to create Toki Tori 2+ and RIVE with

Two Tribes Engine We, Two Tribes, have used this engine for over a decade. It started with early development on the Nintendo DS and ultimately resulte

Two Tribes 117 Jun 21, 2022
OpenGL Template Engine - a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects.

OpenGL Template Engine is a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects. This is the template I personally use for my own projects and provides me with the general OpenGL 3D render setup with model import and UI.

Marcus Nesse Madland 2 May 16, 2022