glovemaster

04-13-2008, 11:10 AM

AngleToVector Calculator (http://knightsoftheoldrepublic.filefront.com/file/Angle_to_Vector_Calculator;98733)

This tool will calculate the Orientation X and Y from an angle that you specify, I have also implemented a "VectorToAngle" function, which you can specify the X and Y coordinates and it will calculate the angle.

Click on the title to download ^.

Using the Calculator

I must also note how the calculator works in relation to KotOR.

KotOR uses an orientation system like so:

The angle is expressed as anticlockwise degrees from Due East. DIRECTION_EAST, DIRECTION_NORTH, DIRECTION_WEST and DIRECTION_SOUTH are predefined. (0.0f=East, 90.0f=North, 180.0f=West, 270.0f=South)

Therefore, if you want your character to face north then the angle you need to enter is 90*, and for North-East 45*.

v1.4

Added an "Angle Chooser" where you can choose an angle from a wheel.

Automated it, so you don't have to click a "calculate" button.

Pratted around with the interface, since I'm arkward =P

Fixed the code so it doesn't crash when you type in letters because you think its funny.

v1.3

Numbers rounded to 6dp, also slight bug fix, where VectorToAngle will show angles > 180 as a negative angle.

v1.2

Calcalator now can convert a Bearing to an Angle.

v1.1

Calculator now also generates a bearing.

v1.0

First Release, program can calculate AngleToVector and VectorToAngle.

Any suggestions are welcome.

This tool will calculate the Orientation X and Y from an angle that you specify, I have also implemented a "VectorToAngle" function, which you can specify the X and Y coordinates and it will calculate the angle.

Click on the title to download ^.

Using the Calculator

I must also note how the calculator works in relation to KotOR.

KotOR uses an orientation system like so:

The angle is expressed as anticlockwise degrees from Due East. DIRECTION_EAST, DIRECTION_NORTH, DIRECTION_WEST and DIRECTION_SOUTH are predefined. (0.0f=East, 90.0f=North, 180.0f=West, 270.0f=South)

Therefore, if you want your character to face north then the angle you need to enter is 90*, and for North-East 45*.

v1.4

Added an "Angle Chooser" where you can choose an angle from a wheel.

Automated it, so you don't have to click a "calculate" button.

Pratted around with the interface, since I'm arkward =P

Fixed the code so it doesn't crash when you type in letters because you think its funny.

v1.3

Numbers rounded to 6dp, also slight bug fix, where VectorToAngle will show angles > 180 as a negative angle.

v1.2

Calcalator now can convert a Bearing to an Angle.

v1.1

Calculator now also generates a bearing.

v1.0

First Release, program can calculate AngleToVector and VectorToAngle.

Any suggestions are welcome.