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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:32:08+00:00 2026-05-16T15:32:08+00:00

The balls are defined as a circles with a radius, a position and a

  • 0

The balls are defined as a circles with a radius, a position and a velocity, which is a 2D vector. The walls are defined by a start point and end point.

I am able to detect the collision between the ball and the wall and know how to reflect it about the normal. However the same collision can be detected AGAIN and the change of direction is repeatedly flipped, meaning essentially the ball stops moving.

So really need a simple way to say that a ball is moving away from the line already so I can ignore any additional collisions.

  • 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-16T15:32:09+00:00Added an answer on May 16, 2026 at 3:32 pm

    You need to have a normal vector on the wall to know its orientation. Take a dot product between the ball velocity vector and the wall normal. If the result of the dot product is greater than zero, the ball is moving away from the wall. If it is zero, then the ball is moving parallel and if it is less than zero, then the ball is moving towards the wall.

    Additional explanation: 2010-08-29 18:17

    A question has come up about the case of when the wall supports collisions from both sides. To handle collisions properly, you have to answer two questions: which side of the wall is the ball currently on (‘inside’ or ‘outside’) and which way is it moving relative to the wall normal? How to determine the answer to the second question is answered above.

    To answer the question about whether the ball is ‘inside’ or ‘outside’ of the wall, you start by calculating the vector from the ball to the wall (a point on the wall – center of the ball). Take the dot product of that vector with the wall normal vector. If the result is less than zero then the ball is ‘outside’ the wall. Equal to zero is on the wall and greater than zero is ‘inside’ the wall.

    You then have the answer to your two questions. Is the ball currently ‘inside’ or ‘outside’ the wall and is it currently moving towards the ‘inside’ or ‘outside’ of the wall.

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

Sidebar

Related Questions

If i had a list of balls each of which has a color property.
I want to be able to draw an array of balls, I can push
I have an Object, Ball, which belongs_to a Girl, which can have_many balls. Everything
I have defined the following record: type Ball = { center : Vector3<m> radius
I'm making a game in which balls bounce around the inside of a much
I am trying to add eventListener for each of the balls i created in
I am developing a sprite experiment that involves moving set of balls around the
So, I'm drawing 3 balls on the top of screen. I'm using surfaceView. Here
I have this methods getParam public int getParam(String paramName){ if(paramName.equals(Balls and net)){ expressionParam=1; }
Has anyone created a custom Silverlight Splash screen to replace the blue balls circular

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.