Author |
Message |
Catalyst
![](http://catalyze.mine.nu/jack_of_spades+100.jpg)
|
Posted: Thu May 08, 2003 10:33 pm Post subject: 2D Vector Class |
|
|
pretty basic but good for 2d movement
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
VectorClass.t |
Filesize: |
923 Bytes |
Downloaded: |
933 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Thu May 08, 2003 10:56 pm Post subject: (No subject) |
|
|
it looks like a good class , but i've got a few problems... :
First of all i dunno what a vector is?
then i dunno what the function normalize and setangle do?
HELP!!!
|
|
|
|
|
![](images/spacer.gif) |
Catalyst
![](http://catalyze.mine.nu/jack_of_spades+100.jpg)
|
Posted: Thu May 08, 2003 11:04 pm Post subject: (No subject) |
|
|
a vector can be thought of in this case as an objects x and y speeds and thus its direction
seting the angle change the speed so that the object would go in the direction of the angle
normalizing reduce the vector down to a size of 1 (still move in the same direction. except slower
|
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Thu May 08, 2003 11:06 pm Post subject: (No subject) |
|
|
aaaaaaah... i c
i've done that in a different method i used boards friction to reduce the speed of ball but i still think yer method is better =/
|
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Thu May 08, 2003 11:11 pm Post subject: (No subject) |
|
|
ok now i understand but which one of the procedures in the class actually moves the vector?
|
|
|
|
|
![](images/spacer.gif) |
Catalyst
![](http://catalyze.mine.nu/jack_of_spades+100.jpg)
|
Posted: Fri May 09, 2003 6:14 am Post subject: (No subject) |
|
|
you dont move the vector, its used to move another object
|
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Fri May 09, 2003 11:55 am Post subject: (No subject) |
|
|
oh ic now i know what it exactly is ...
|
|
|
|
|
![](images/spacer.gif) |
nate
![](http://www.e-lacrosse.com/2004/nll/rock.gif)
|
Posted: Fri May 09, 2003 4:34 pm Post subject: ???? |
|
|
What are you sapposed to do with the code u posted. I am not really fimiliar with class. Is there some code 2 input to make the file do something?
-Nate
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Fri May 09, 2003 4:39 pm Post subject: (No subject) |
|
|
i think there's a tutorial around here on how to use classes... its that thing where you go ClassName -> procedure
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|