Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 2D Vector Class
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Catalyst




PostPosted: Thu May 08, 2003 10:33 pm   Post subject: 2D Vector Class

pretty basic but good for 2d movement


VectorClass.t
 Description:

Download
 Filename:  VectorClass.t
 Filesize:  923 Bytes
 Downloaded:  692 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: 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!!!
Catalyst




PostPosted: 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
Homer_simpson




PostPosted: 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 =/
Homer_simpson




PostPosted: 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?
Catalyst




PostPosted: Fri May 09, 2003 6:14 am   Post subject: (No subject)

you dont move the vector, its used to move another object
Homer_simpson




PostPosted: Fri May 09, 2003 11:55 am   Post subject: (No subject)

oh ic now i know what it exactly is ...
nate




PostPosted: 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
Tony




PostPosted: 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: