Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - danijmn

Pages: [1]
1
General / Re: C++ SFML, Circular Movement - Help!
« on: September 23, 2013, 09:58:35 pm »
Balls getting stuck is a typical problem in this kind of game. Basically you have to make sure that the ball is headed towards a certain object before trying to calculate a collision against it. If the ball is not even headed against the object you can simply ignore the rest of the computation.

So, if the ball's velocity vector and the normal of the surface are less than 90 degress apart, there can be no collision (beware, there are two normals for a line segment in 2D, you need the one pointing "inside" the circular world, but I suppose you already figured that out). This is a fairly simple check.

To do it, you need to find the cosine of the angle between the two vectors (ball velocity and surface normal) and if it is equal to or more than zero (angle is between -90 and 90 deg) there can be no collision. You can compute this using the dot product. Here's an explanation for 3D vectors: http://www.wikihow.com/Find-the-Angle-Between-Two-Vectors

2
General / Re: C++ SFML, Circular Movement - Help!
« on: September 20, 2013, 02:11:30 pm »
I saw this post and I immediately recalled one of my academic projects not so long ago in which I had to develop a pinball game in Java for Android.
Circular physics are a pain in the a**.

Fortunately, I managed to find a fantastic reference which explained how to handle collisions betweens different types of objects (but I still had to figure out how to make the flippers work ;D). It includes an explanation of the physics in collisions of balls within circular containers, which is precisely what you want. A fully working example is also provided as well as the source code (in Java, though).

Here is the link (scroll down to example 6a):
http://www.ntu.edu.sg/home/ehchua/programming/java/J8a_GameIntro-BouncingBalls.html

3
General discussions / Re: SFML 2 and its new website released
« on: April 29, 2013, 08:34:17 pm »
Many thanks, you've done some wonderful work!

Pages: [1]
anything