You are viewing our Forum Archives. To view or take place in current topics click here.
C# Vector2 Class [need help]
Posted:

C# Vector2 Class [need help]Posted:

Xsplay
  • Prospect
Status: Offline
Joined: Apr 29, 201113Year Member
Posts: 682
Reputation Power: 23
Status: Offline
Joined: Apr 29, 201113Year Member
Posts: 682
Reputation Power: 23
Coding in C#

so I'm writting out a Vector2 Class
i'm now doing angles and stuff I need to convert Vector Units into Degrees and Radians.

my problem with programming is I know what to do it just writing it out.

(need help with some other stuff too)

All to do with Physics in a game
#2. Posted:
Starzz-UK
  • New Member
Status: Offline
Joined: Jun 27, 201211Year Member
Posts: 36
Reputation Power: 1
Status: Offline
Joined: Jun 27, 201211Year Member
Posts: 36
Reputation Power: 1
Try using pseudo code to help you, helps me at university when developing large applications.
#3. Posted:
-Deano
  • PC Master Race
Status: Offline
Joined: Aug 19, 201013Year Member
Posts: 5,238
Reputation Power: 532
Status: Offline
Joined: Aug 19, 201013Year Member
Posts: 5,238
Reputation Power: 532
I don't really understand what you are asking here..
Converting from degrees to radians is done by multiplying the angle by pi/180.
Converting from radians to degrees is done by multiplying the angle by 180/pi.

A Vector2 class should just have two values, x and y, not an angle.
You would need to multiply each component by the angle to get the new location.
You should look into matrices if you are handling game physics.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.