Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7409785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:08:07+00:00 2026-05-29T06:08:07+00:00

I made an app with Ogre3D, having already spawned bullet’s objects, all I need

  • 0

I made an app with Ogre3D, having already spawned bullet’s objects, all I need for now is to detect collisions between objects.

I looked at the CollisionInterfaceDemo demo, and it doesn’t really match with my needs.

What are the required steps to detect collisions between let us say 3 spheres, only to know if it collides (I don’t care about the point of collision) ?

I only know that I can move an CollisionObject by setting its transform.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:08:08+00:00Added an answer on May 29, 2026 at 6:08 am

    If you’re using Bullet there are several demos you can look at to get you going.

    But basically, here’s the rundown (much of this is taken from their examples):

    In your header or where ever your physics system is:

    btDefaultCollisionConfiguration*        mPhysicsConfig;
    btCollisionDispatcher*                  mPhysicsDispatcher;
    btBroadphaseInterface*                  mPhysicsCache;
    btSequentialImpulseConstraintSolver*    mPhysicsSolver;
    btDiscreteDynamicsWorld*                mPhysicsWorld;
    btAlignedObjectArray<btCollisionShape*> mPhysicsShapes;
    

    First (initialization):

    ///collision configuration contains default setup for memory, collision setup.
    mPhysicsConfig = new btDefaultCollisionConfiguration();
    
    ///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
    mPhysicsDispatcher = new    btCollisionDispatcher(mPhysicsConfig);
    
    ///btDbvtBroadphase is a good general purpose broadphase. You can also try out btAxis3Sweep.
    mPhysicsCache = new btDbvtBroadphase();
    
    ///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
    mPhysicsSolver = new btSequentialImpulseConstraintSolver;
    mPhysicsWorld = new btDiscreteDynamicsWorld(mPhysicsDispatcher,mPhysicsCache,mPhysicsSolver,mPhysicsConfig);
    mPhysicsWorld->setGravity(btVector3(0,-9.81f,0));
    

    Each frame (this usually goes in an Update function):

    mPhysicsWorld->stepSimulation( timestep , 10 );
    

    Add a sphere (the pointer is just returned to make access easier after creation):

    btRigidBody* MyPhysicsSystem::CreateSphere(float sx, float px, float py, float pz, float mass)
    {
        btCollisionShape* colShape = new btSphereShape(btScalar(sx));
        mPhysicsShapes.push_back(colShape);
    
        btTransform startTransform;
        startTransform.setIdentity();
    
        btScalar    tMass(mass);
    
        //rigidbody is dynamic if and only if mass is non zero, otherwise static
        bool isDynamic = (tMass != 0.f);
    
        btVector3 localInertia(0,0,0);
        if (isDynamic)
            colShape->calculateLocalInertia(tMass,localInertia);
    
        startTransform.setOrigin(btVector3(px,py,pz));
    
        //using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
        btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
        btRigidBody::btRigidBodyConstructionInfo rbInfo(tMass,myMotionState,colShape,localInertia);
        btRigidBody* body = new btRigidBody(rbInfo);
        mPhysicsWorld->addRigidBody(body);
        return body;
    }
    

    And that’s about it!

    To reiterate:

    1. Initialize the things bullet needs for a simulation.
    2. Create an object and add it to bullet’s “world”.
    3. Update that world each frame by some timestep.

    Bullet will take care of the collisions for you. If you need some way to have functionality done when a collision happens, I believe you can assign a custom callback as the collision behavior that will happen.

    • Here’s the link to the bullet reference:
      http://bulletphysics.com/Bullet/BulletFull/
    • A full rundown on
      detecting and responding to collisions with bullet:
      http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Collision_Callbacks_and_Triggers

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the Java Swing app I made it seems to me that all the
Made an app targeting API8 and it's running fine on all emulator images all
I have made an app as a Page Tab. I need to redirect to
I made an app in Ruby on Rails and now I want to get
I have made an app which will be a FB page tab. Now I
I recently made an app on a Mac running OS X 10.6. I now
So I made an app, And it runs on all possible platforms except the
I have made an app, now I want to send it to the App
I made an app for parents to put on Their kids phones but need
A desktop app (made in Delphi) is started by User A. Let's call it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.