Comments (7)
The order of the matrix elements should match OpenGL as far as i know, for anything else it would be enough to just transpose them before doing calculations.
Another way to make this less painful is to add an implicit cast to/from System.Numerics vectors.
from raylib-cs.
@sbarisic There is now a numerics branch for this feature. I discussed it with @9ParsonsB and we decided that keeping this feature compatible is not possible so it is being tested as a breaking change. So far Vector2, Vector3 and Vector4 have been replaced.
Matrix4x4 has a different layout but transposing the matrix works for going from the numerics layout to the raymath and vice versa.
from raylib-cs.
@sbarisic That sounds interesting though I don't plan to change the vector and matrix types at the moment. Ideally a feature like this would be optional for those who want it.
from raylib-cs.
I have looked into this feature but I am currently unsure on the best way to proceed.
I tried to use System.Numerics in a test project to see how what users need to do to switch to it.
-
Add using System.Numerics in every file that uses these types.
-
Change fields like .x, .y, .z etc to .X, .Y, .Z etc.
This is a pain to do especially in a larger project so I looked to see if there was a easier way to make this a optional/non breaking change.
The only possible solution I found is to wrap the System.Numerics types in my own types and provide properties for access. This "might" work but I feel that defeats the idea of it as you need to convert/access the type manually when using external code that uses System.Numerics.
Another possible concern is with the Matrix. I need to look into the ordering of the fields to see if conflicts with how the raylib Matrix works. I do not think it makes sense to add System.Numerics only for Vector types but not Matrices as that will just make things more confusing for new users.
from raylib-cs.
It would be possible to create a wrapper over System.Numerics types and use implicit casts to automatically return internal type, but that pretty much defeats the purpose and makes it slower.
from raylib-cs.
@ChrisDill I Wouldn't too much about adding/chaning using
s in every file - I believe VS can do it now for you anyway.
from raylib-cs.
I'm undecided on the switch to the standard System.Numerics
types (not sure of the benefits), but as far as breaking changes go, that shouldn't be a problem, should you decide to make the switch. It takes just minutes, maybe tens of minutes to adjust a project.
from raylib-cs.
Related Issues (20)
- Some constants are missing from rlgl HOT 2
- Make fields in 'RenderBatch' struct public HOT 1
- MeasureText always returns 0 HOT 1
- Missing Vector3 definition? HOT 2
- IsMaterialReady doesn't contain Material argument HOT 1
- CameraPitch and CameraYaw don't allow passing a Camera3D as ref HOT 5
- [Feature Request] Safe pathway to LoadFontFromMemory HOT 4
- Update to Raylib-5.0.0 HOT 1
- Invalid signature for "GenImageText"
- Add a managed version as a separated package HOT 1
- Suggestion: pin GitHub Action to most recent LTS version of Ubuntu HOT 2
- raylib drawline & alpha HOT 2
- [BUG] `DllImport` makes problems on some pcs HOT 1
- Building for WebAssembly
- [Feature] Repackage Raylib-cs. HOT 2
- feature request - LoadFontEx / LoadFont HOT 1
- Hide console HOT 2
- RayGui support HOT 2
- Add wayland support? HOT 1
- Option to remove Console Debug window HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib-cs.