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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:22:29+00:00 2026-06-07T03:22:29+00:00

I am new to box2d. I have started a new game in box2d and

  • 0

I am new to box2d. I have started a new game in box2d and created 5 dynamic bodies in the world. Initially I need to prevent collision between them. so i set group index of all bodies negative. After touching a body i want to allow the collision with that body. How to reset the group index. Please help..

  • 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-07T03:22:30+00:00Added an answer on June 7, 2026 at 3:22 am

    Sounds like you’re looking for something like

    b2Body *body = world->GetBodyList();
    b2Filter filter = body->GetFilterData();
    filter.maskBits = filter.maskBits | THE_RELEVANT_CATEGORY_BITS;
    body->SetFilterData(&filter);
    

    The idea here is that you can get the collision filtering data for any object, use some boolean logic to assign collision data to the maskBits field, and then use SetFilterData to apply that new collision data to the body. THE_RELEVANT_CATEGORY_BITS should be an element of an enumerated type in which each collision filtering category is represented by a unique binary integer.

    Check out the box2D tutorial for more on this http://www.iforce2d.net/b2dtut/collision-filtering

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

Sidebar

Related Questions

I have a main character in my Box2d game that has a b2PolygonShape collision.
I am new to Box2d and have a situation where I have two bodies.
I am new to Box2d, and I have just learned that it does not
I'm pretty new to the Objective-C world and I have a long history with
I have installed Python 2.6.6 and Box2D 2.0.2b1. And can't create box2d world -
I have a physics simulation (using Box2D) where bodies with identical integer IDs do
I'm working on a Cocos2D and Box2D game. I just created a class for
Recently I have a new project that uses Box2D as physics engine. And I
New to PHP and MySQL, have heard amazing things about this website from Leo
Can someone explain the in what way works the collision detection using box2d for

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.