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

  • Home
  • SEARCH
  • 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 8286079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:37:25+00:00 2026-06-08T11:37:25+00:00

I have several circles on the screen, placed on different locations (all dynamic box2d

  • 0

I have several circles on the screen, placed on different locations (all dynamic box2d bodies).

I want to add another circle, with an initial velocity of say x, y. I want this body to move freely, as if there’s no gravity. Make all it’s collisions 100% elastic.

I tried setting elasticity to 1, but if I drop it from the top, it doesn’t touch the ceiling again. I want it to just keep moving in the direction it was set to, unless a collision changes its direction.

To explain this further, a simple implementation of what I want would be this, in a square container, with a circular body.

when collides ->
  set body.velocityX to -body.velocityX
  set body.velocityY to -body.velocityY

Of course this doesn’t work if I have bodies in between.

Suggestions in any language with box2d framework or pseudocode would be appreciated.

  • 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-08T11:37:26+00:00Added an answer on June 8, 2026 at 11:37 am

    In addition to setting the elasticity, you need to set the damping of the body to 0 to eliminate the velocity reduction effect that you’re seeing now.

    From the Box2d manual:

    Damping is used to reduce the world velocity of bodies. Damping is different than friction because friction only occurs with contact.
    Damping is not a replacement for friction and the two effects should
    be used together.

    Damping parameters should be between 0 and infinity, with 0 meaning no damping, and infinity meaning full damping.

    …

    bodyDef.linearDamping = 0.0f;
    
    bodyDef.angularDamping = 0.01f;
    

    Damping is approximated for stability and performance. At small damping values the damping effect is mostly independent of the time
    step. At larger damping values, the damping effect will vary with the
    time step. This is not an issue if you use a fixed time step
    (recommended).

    Additionally, as mentioned in the manual, damping is not the same as friction… so you’ll probably want to set the friction of the body to 0 as well.

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

Sidebar

Related Questions

I have several xml files with different node structure. I want to extract xml
I have some triples that represent the locations of several cities. I want to
i have several circles drawn programmatically on the screen . I then work out
I have tried several different solutions but no luck so far. - (CGPoint)contractLineTemp:(CGPoint)point :(CGPoint)circle
I have several ListViewItems i want to order it in different way using its
On my web page, I'd like to have a group of several concentric circles
I have several different numbers in a group that range in sizes and would
I have an SVG file that contains several elements (like path, circles, rectangles, etc.).
I have a simple solid modeling application in which I want to implement several
I have several binary images and my task is to segment circle-like shape. The

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.