Click here to Skip to main content
15,896,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt17-May-06 5:06
Stephen Hewitt17-May-06 5:06 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen17-May-06 5:15
Cedric Moonen17-May-06 5:15 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt17-May-06 14:04
Stephen Hewitt17-May-06 14:04 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen17-May-06 21:26
Cedric Moonen17-May-06 21:26 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt18-May-06 0:52
Stephen Hewitt18-May-06 0:52 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen18-May-06 1:52
Cedric Moonen18-May-06 1:52 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt18-May-06 2:42
Stephen Hewitt18-May-06 2:42 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen18-May-06 2:58
Cedric Moonen18-May-06 2:58 
Stephen Hewitt wrote:
I don't think I need to go over this further given that the article I posted a link to explains it better than I could.


Yes sure,I agree. Thanks for article though.


Stephen Hewitt wrote:
If you've got n objects there are (n*(n-1))/2 = (n^2-n)/2 pairs to test: so it's probably a good idea to limit the size on n since the growth is quadratic.


I solved this in another way: there are only three "teams": players (ship and bullets), ennemies (ships and bullets) and neutral (bonus, and other things that doesn't have any impact on the game). So, basically this reduce a lot the pairs of collisions. And anyway these 'Resolving collisions' are done in the derived classes themselves (so, you can neglected certain pairs).


Stephen Hewitt wrote:
I don't want to get into too much of a debate however, as a lot of this is all theoretical


Yes sure. But anyway thanks for exposing your point of vue Smile | :) . I find this always interesting to see how other programmers solve design 'problems' (that's what I'm doing here also, just showing you how I do that, absolutely not saying that it's the best solution Roll eyes | :rolleyes: ). But I agree with you, we won't dig into more details as it requires a concrete example and some time to spend on it.




Cédric Moonen
Software developer

Charting control
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt18-May-06 3:44
Stephen Hewitt18-May-06 3:44 
AnswerRe: Polymorphic pointer points to what? Pin
Sarath C17-May-06 1:23
Sarath C17-May-06 1:23 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen17-May-06 1:37
Cedric Moonen17-May-06 1:37 
GeneralRe: Polymorphic pointer points to what? Pin
markkuk17-May-06 3:18
markkuk17-May-06 3:18 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen17-May-06 3:46
Cedric Moonen17-May-06 3:46 
AnswerRe: Polymorphic pointer points to what? Pin
Sarath C17-May-06 1:35
Sarath C17-May-06 1:35 
QuestionRe: Polymorphic pointer points to what? Pin
David Crow17-May-06 3:13
David Crow17-May-06 3:13 
AnswerRe: Polymorphic pointer points to what? Pin
SimonSays17-May-06 10:47
SimonSays17-May-06 10:47 
GeneralRe: Polymorphic pointer points to what? Pin
G_urr_A17-May-06 11:49
G_urr_A17-May-06 11:49 
GeneralRe: Polymorphic pointer points to what? Pin
G_urr_A17-May-06 13:14
G_urr_A17-May-06 13:14 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt17-May-06 13:52
Stephen Hewitt17-May-06 13:52 
QuestionWSAGetLastError() 10061 with connect() Pin
Just Baballa17-May-06 1:12
Just Baballa17-May-06 1:12 
JokeRe: WSAGetLastError() 10061 with connect() Pin
RicoH17-May-06 4:11
RicoH17-May-06 4:11 
QuestionRegarding timers Pin
Raja Bose C Leo17-May-06 1:04
Raja Bose C Leo17-May-06 1:04 
AnswerRe: Regarding timers Pin
Cedric Moonen17-May-06 1:11
Cedric Moonen17-May-06 1:11 
AnswerRe: Regarding timers Pin
Sarath C17-May-06 1:15
Sarath C17-May-06 1:15 
GeneralRe: Regarding timers Pin
Raja Bose C Leo17-May-06 2:06
Raja Bose C Leo17-May-06 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.