It is currently 7:38 pm 09/07/10


Post a new topicPost a reply Page 1 of 1   [ 5 posts ]
Author Message
 Post subject: Hit and Hittee
PostPosted: 3:48 am 07/29/10 
FRB Rookie
FRB Rookie

Joined: 9:29 pm 07/28/10
Posts: 12
[code][/code]
i am new with FRB and i dont know what kind of search key i am going to use :)

i have a collection of circles and i am looping in each one to determine collision
is there a way to determine who is the bumper and the bumpee :)

thanks

_________________
Everything is possible, the impossible really just takes longer :) [Digital Fortress - Dan Brown]
-M-


Top
 Profile E-mail  
 
 Post subject: Re: Hit and Hittee
PostPosted: 7:55 am 07/29/10 
FRB Founder
FRB Founder
User avatar

Joined: 6:48 pm 01/17/05
Posts: 4290
Location: South Ogden, UT
Not sure what you mean by that. There really is no such thing as bumper and bumpee if you don't have a frame of reference. If two asteroids hit in outer space, which one hit which one? Could certainly change depending on which one you were "attached" to.

On Earth if we talk about cars hitting each other, we generally have a set of rules - if you get hit from behind, you're the one who got hit. If you pull out of a parking spot unexpectedly, then you're the one who hit the other person...and so on.

So really, the question is not as much a programming question as a question of what you're trying to establish when you set this up - what's the purpose of knowing who is the "bumper" and "bumpee"?

_________________
--Vic--


Top
 Profile E-mail  
 
 Post subject: Re: Hit and Hittee
PostPosted: 7:17 pm 07/29/10 
FRB Rookie
FRB Rookie

Joined: 9:29 pm 07/28/10
Posts: 12
thanks for the response

we will use the asteroids :)
an asteroid named aster1 is moving to another asteroid named aster2
and made contact so aster1 hits aster2 making aster one the hitter
and aster2 the hittee.
so the life of aster2 lets say they have a life :) will be the one that is going to be decremented
and not aster1
and we are going to use it on a loop of asteroid collection
currently i have a nested loop and i dont know if its the best practice that will iterate to the collection
and each item will iterate again on the same collection
checking if they collide and i am using the following code to check for collision
http://img708.imageshack.us/i/68813932.png/

dont know if i make it clear this time :)
thanks

_________________
Everything is possible, the impossible really just takes longer :) [Digital Fortress - Dan Brown]
-M-


Top
 Profile E-mail  
 
 Post subject: Re: Hit and Hittee
PostPosted: 11:04 pm 07/29/10 
FRB Founder
FRB Founder
User avatar

Joined: 6:48 pm 01/17/05
Posts: 4290
Location: South Ogden, UT
Well, I'm not sure, but my guess would be to check the velocity of the objects and see which one is greater. Then you know which one hit the other.

_________________
--Vic--


Top
 Profile E-mail  
 
 Post subject: Re: Hit and Hittee
PostPosted: 1:35 am 07/30/10 
FRB Rookie
FRB Rookie

Joined: 9:29 pm 07/28/10
Posts: 12
didn't thought of that one :)
thanks for you help

dont know how to do that comparing velocity so i try this one, somehow its doing what i thought of it
(float)fallingPiece.Velocity.Length() < (float)peg.Velocity.Length() and vice versa

its working better from the previous :)

i think i need to explore more

_________________
Everything is possible, the impossible really just takes longer :) [Digital Fortress - Dan Brown]
-M-


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 5 posts ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
twilightBB Style by Daniel St. Jules of Gamexe.net