Is it okay to extend the Vector* / Box2d structs and post a SVN patch here? I need some functionality , which I would like to implement directly and contribute to the project.
Posted Friday, 14 March, 2008 - 22:25 by georgwaechter
@teichgraf There is already the property 'Perpendicular' .. i think this is want you want (but without the distinction between right an left normal)
------
A few days ago a added a Rotate function to Vector2. There is already a Rotate function in Vector2d, but there is one big difference: Functions within Vector2d and Vector3d always expect angles (in degrees), but imo the angle parameters should always expect it to be in radians. This is the standard approch for math libraries. In any case this should be consistent.
Then i added the functions RotateX, RotateZ and RotateY to Vector3. All functions have a static alternative.
Posted Saturday, 15 March, 2008 - 08:37 by teichgraf
@georg:
Thanks for the info and the extension.
I agree, that all angles should be handled consistent in radians.
For my project I am using the binaries of OTK 0.9.0 and there was no Perpendicular property. The comment for this prop should be more obviously
/// <summary>/// Gets the perpendicular vector on the right side of this vector./// </summary>publicVector2 Perpendicular
instead of
/// <summary>/// Gets the perpendicular vector./// </summary>publicVector2 Perpendicular
@Fiddler:
To avoid double stuff, I'll wait with my patch until you managed to add georgs patches. Please give me an info when you commited it to the repository.
Comments
Re: Extend OpenTK
@teichgraf There is already the property 'Perpendicular' .. i think this is want you want (but without the distinction between right an left normal)
------
A few days ago a added a Rotate function to Vector2. There is already a Rotate function in Vector2d, but there is one big difference: Functions within Vector2d and Vector3d always expect angles (in degrees), but imo the angle parameters should always expect it to be in radians. This is the standard approch for math libraries. In any case this should be consistent.
Then i added the functions RotateX, RotateZ and RotateY to Vector3. All functions have a static alternative.
New is the method CalculateAngle for Vector3 ...
here are the changes: http://trackplanner.de/files/Math.patch
Re: Extend OpenTK
@georg:
Thanks for the info and the extension.
I agree, that all angles should be handled consistent in radians.
For my project I am using the binaries of OTK 0.9.0 and there was no
Perpendicularproperty. The comment for this prop should be more obviouslyinstead of
@Fiddler:
To avoid double stuff, I'll wait with my patch until you managed to add georgs patches. Please give me an info when you commited it to the repository.
Re: Extend OpenTK
Oki.