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 8280361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:39:02+00:00 2026-06-08T09:39:02+00:00

EDIT: After spending a bit of time understanding the code I wrote I still

  • 0

EDIT: After spending a bit of time understanding the code I wrote I still don’t know what is wrong with it. This is the base class from which I derived my class:

///ContactResultCallback is used to report contact points
struct  ContactResultCallback
{
    short int   m_collisionFilterGroup;
    short int   m_collisionFilterMask;

    ContactResultCallback()
        :m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),
        m_collisionFilterMask(btBroadphaseProxy::AllFilter)
    {
    }

    virtual ~ContactResultCallback()
    {
    }

    virtual bool needsCollision(btBroadphaseProxy* proxy0) const
    {
        bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;
        collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);
        return collides;
    }

    virtual btScalar    addSingleResult(btManifoldPoint& cp,    const btCollisionObjectWrapper* colObj0Wrap,int partId0,int index0,const btCollisionObjectWrapper* colObj1Wrap,int partId1,int index1) = 0;
};

Now here is my derived class:

class DisablePairCollision : public btCollisionWorld::ContactResultCallback
{
public:
    virtual btScalar addSingleResult(btManifoldPoint& cp, const btCollisionObject* colObj0, int32_t partId0, int32_t index0, const btCollisionObject* colObj1, int32_t partId1, int32_t index1);

    btDiscreteDynamicsWorld* DynamicsWorld;
};

And below is where I implement the main function. Still not sure why I’m getting this error.

I was using the code below on windows with both vc2010 and code blocks without a problem:

btScalar DisablePairCollision::addSingleResult(btManifoldPoint& cp, const btCollisionObject* colObj0, int32_t partId0, int32_t index0, const btCollisionObject* colObj1, int32_t partId1, int32_t index1)
{
    // Create an identity matrix.
    btTransform frame;
    frame.setIdentity();

    // Create a constraint between the two bone shapes which are contacting each other.
    btGeneric6DofConstraint* Constraint;
    Constraint = new btGeneric6DofConstraint( *(btRigidBody*)colObj0, *(btRigidBody*)colObj1, frame, frame, true );

    // Set limits to be limitless.
    Constraint->setLinearLowerLimit( btVector3(1, 1, 1 ) );
    Constraint->setLinearUpperLimit( btVector3(0, 0, 0 ) );
    Constraint->setAngularLowerLimit( btVector3(1, 1, 1 ) );
    Constraint->setAngularUpperLimit( btVector3(0, 0, 0 ) );

    // Add constraint to scene.
    DynamicsWorld->addConstraint(Constraint, true);
    return 0;
}

Now I’m trying to compile my project on Ubuntu but I am getting this error when I try to use that class:

/home/steven/Desktop/ovgl/src/OvglScene.cpp:211: error: cannot declare variable ‘Callback’ to be of abstract type ‘Ovgl::DisablePairCollision’
  • 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-06-08T09:39:04+00:00Added an answer on June 8, 2026 at 9:39 am

    The reason the base class is abstract is this pure virtual function:

    virtual btScalar addSingleResult(
      btManifoldPoint& cp,
      const btCollisionObjectWrapper* colObj0Wrap,
      int partId0,
      int index0,
      const btCollisionObjectWrapper* colObj1Wrap,
      int partId1,
      int index1) = 0;
    

    The derived class DisablePairCollision attempts to define that function, but it does not do it correctly:

    virtual btScalar addSingleResult(
       btManifoldPoint& cp,
       const btCollisionObject* colObj0,
       int32_t partId0,
       int32_t index0,
       const btCollisionObject* colObj1,
       int32_t partId1,
       int32_t index1);
    

    As you can see, some of the arguments have different types. E.g. colObj0 is of type const btCollisionObject*, but it should be of type const btCollisionObjectWrapper*.

    Therefore, the derived class defines a new function with different arguments, but it does not define the pure virtual function from the base class, hence the derived class is still abstract.

    You need to define the function with the exact same argument types as in the base class.

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

Sidebar

Related Questions

EDIT: After spending several hours researching this, I don't think I'm going to find
EDIT: a few weeks after I posted this question Evan Coury wrote an excellent
EDIT 1 I apologize but after reading the 2 suggested articles I still don't
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
[EDIT] I am changing this to more concisely explain what my problem was, after
After spending hours I still cant figure it out. I'm trying to validate an
EDIT: SOLVED IT :( AFTER SPENDING HOURS ON IT, IT WAS THE SIMPLEST OF
I've just started looking at PHP Frameworks after spending loads of wasted time doing
FINAL EDIT: After following the answer from Darin Dimitrov, I have found that the
Edit note: After a seemingly enourmous amount of bad feedback MS got from their

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.