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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:31:11+00:00 2026-06-05T05:31:11+00:00

I want to have items (dynamic bodies) that collide with the floor (static body)

  • 0

I want to have items (dynamic bodies) that collide with the floor (static body) due to gravity. But I don’t want the player to collide with the items on the floor though I need to have a callback when the player overlaps an item (as if the item isSensor property was set to true).

Is it possible?
I tried some configurations with the category bits and mask bits with no success.

I didn’t have this problem before because items had a gravityScale set to 0 so they didn’t fall on the floor. But now they need to respond to gravity.

Thanks.

  • 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-05T05:31:13+00:00Added an answer on June 5, 2026 at 5:31 am

    You have to implement a class that extends b2ContactListener. You can choose to reject the collision in PreSolve() virtual function. In the b2Contact object that is passed to PreSolve(), you can get the 2 fixtures, from which you can derive what it actually collides with if you have stored a pointer to the user data before.

    Before you start the game engine, create new object of the subclass of b2ContactListener, then call method SetContactListener() of the game world object to set up the listener.

    Sample code

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

Sidebar

Related Questions

I have some items in my .emacs that I don't want to run if
I want to remove all items that have Tag set to string Dynamic :
I want to sort the items that have been previously selected with checkboxes. If
I have a Stackpanel and want that the items automatically set their sizes regarding
I have a dynamic select that needs to be driven off another select, but
i have some dynamic code that will make a list of divs. i want
I have used XmlSource file for fetching dynamic menu items i also want to
I have 4 items in and I want to assign 4 different background-color to
Desired Outcome I want to have Vertical List with custom items on the left/right
I use a QTreeWidget to display multicolumn items, and I want to have a

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.