
Add Vector[234]i structs
Posted Monday, 6 July, 2009 - 20:33 by sharoz| Project: | The Open Toolkit library |
| Version: | 1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | open |
Description
Per Fiddler's suggestion, the struct will be a minimal implementation like Vector[234]h.
The purpose for adding these structs is to make storing and passing shader uniforms consitent for ints and floats.


Comments
#11
It's mostly a matter of reducing duplication and simplifying maintenance. Keeping the documentation and code in sync is already a nightmare (fixes have to be kept in sync between Vector2, Vector3, Vector4, Vector2d, Vector3d, Vector4d, two overloads each) and I don't want to imagine how things would be with twice as many structures...
#12
I have pruned the multiply/divide/dot functionality, copied and expanded for 3/4 versions. Plus, i have attached a file named IntegerVectors which contains the no-operators version of the vectors
note: I need; equatable for generic equals functionality, ToString method for ease of debugging (VS parameter preview), GetHashCode for dictionary usage. So I kept them. I was not sure about static fields, but they were really nice for floating point versions by ease of initialization.