more collisions

2014 02 06
I’ve been doing the collisions again.. The circle works fine, sort of. I have Three circles drawn. Two of them collide like they are supposed to. The third circle will not collide with any of the two colliding circles.

I also have Three rectangles. Same thing there, only two of the rectangles will collide.

I Think this has something to do with how I check for collisions. I now have two different std::vectors containing colliders, one for rectangle colliders and one for circles. I told you in an earlier post about my overloaded constructors that take in different parameters depending on if you want a circle or a rectangle instead of two different classes of colliders.

In my Attach function, the one you use to push a collider in the vector I added a condision to filter the types of colliders so you won’t have to worry about that yourself. The condision is if the collider’s radius is less than or equal to 0, the collider goes to the rectangular collider vector, else the collider goes to the circle collider vector.
Attach

I did this separation because I Think it is easier to only check for the colliders that matter, for example, in a circle vs circle collision, why would I want to check the rectangular colliders? I have no idea if this is more or less efficiant harware-wise, but it sure is more efficiant for me.

Today we also had a meeting with our programming helper. I asked him about rectangle vs circle collisions and he told me there was a way to check Points in an interval and decide which of the Points are the closest. Then he showed me a funktion to do this. He also showed me a Clamp function used to force a value to stay within an interval.
I tried to implement this in the rectangle vs circle overlap. I first tried with making a line across the right hand side of the rectangle and compare the distance between the Closest Point and the circle’s radius. if the distance is shorter than the circle’s radius, there would be an ovarlap. so I thought. The strangest thing is I Think it did work! only the line was not where I wanted it to be. And there is only one of the circle’s that can “collide” with it. Prepare yourself for Pictures:

The rect vs circle overlap checker and the closest Point function under:
LineSegment

Colliding circle where the line, or what ever it is, is. The circle is colliding a Little to the right and a Little down from the small rectangle.

strange

the other colliding circle at the same place. not colliding. the consol says released, it does so at key released events.
strange2

I cant really say why any of this is happening. Regarding why only two of every collider (except for the last collision type) I Think I do some mistakes when I check for collisions. I tried to go from bottom to top and then top to bottom again to really get every collider but it made no differences. This is how I check for circle vs circle collisions:

upanddown

Not sure what to do.

The SCRUM

We had meeting yesterday which made me realize I had no clue about how this is done and felt confused about the progress of the Project and what must be prioritized. Marcus has told us we must spread the deadlines to not have every detail finished for the course’s own deadlines such as when the Alpha version of the game is due. We also realized we need to have the Design document done as soon sa possible. Whitout it, how will we know what to put in the SCRUM backlog?

There were also confusions about what kind of game we are doing. Mr Mayes put us in the right direction. We are not making an exploration game like we sort of thought, we are making a game about a fish eating other fishes in which the player is pressed to eat fish or his hunger will go down(or up?) and his fish will die. Stressful sensations don’t mix with exploring in most cases. It is supposed to be a straight forward space shooter really. it is the 1st and a half game we make.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s