SilentPenguin / Sparrow

Sparrow is a game engine framework built in C# for the .net core runtime.
MIT License
6 stars 0 forks source link

Rewrite Numerics #1

Closed SilentPenguin closed 7 years ago

SilentPenguin commented 7 years ago

With the Sparrow.Numerics implementation, the resulting size of a mathematical operation is defined by the largest dimension of the operands.

This sort of behaviour becomes problematic when working with libraries such as OpenGL that expect a fixed size vector. The engine would be quietly creating and discarding data in the background without the coder knowing.

Under a possible new system Sparrow.Numerics would:

Sized objects would:

Unsized objects would:

SilentPenguin commented 7 years ago

I have implemented this as per the above description.

As a side note: Support libraries (such as collision detection) written for sparrow should use the sized versions of these vectors unless variable sizes are permitted. This means any casting error will occur within the programmer's own code. This makes sparrow much easier to consume.