Circular-Studios / Dash

A free and open 3D game engine written in D.
https://circularstudios.com/Dash
MIT License
421 stars 63 forks source link

Port to gfm:math from gl3n #211

Open ColdenCullen opened 10 years ago

ColdenCullen commented 10 years ago

I think switching from gl3n to gfm is the right move for Dash in the long run. Unfortunately, it's going to take a lot of work.

This would be a great project for an external contributor to work on, to get to know the engine. The effort has already started here, so that would be the place to pick up from.

p0nce commented 10 years ago

Is there any feature/aliases/functions to add that would make it less work?

ColdenCullen commented 10 years ago

Damnit, I totally thought I responded to this, my bad. If I miss something like this in the future, feel free to ping it.

Most of the work for this is going to come from renaming vec3s from gl3n to vec3f, of gfm, and the like. I actually prefer this naming convention, as it explains what the type is much more clearly.

That said, there are some things that gfm is missing, mostly in Quaternion. I'll try to make a list here soon, and open issues on GFM. The most obvious things I can think of are I would like an alias of quatf (rather than quaternionf, which is too verbose for my tastes), and also a constructor that takes 4 Ts.

wozniakty commented 10 years ago

Fun fact, I think gl3n's vec3 is an alias for vec3f. Not that that's an argument against moving to gfm haha

ColdenCullen commented 10 years ago

@zeDoctor That's what I thought too, but turns out gl3n doesn't have a vec3f.

p0nce commented 10 years ago

I'm all for quatf, but not for vec3. I know this is the GLSL name, but float is not special.

ColdenCullen commented 10 years ago

I agree with you on the vec3, I think it's just confusing. I'll be glad to not use it anymore.

p0nce commented 10 years ago

Renamed quaternionf to quatf/quatd, added a quaternion constructor with 4 Ts. https://github.com/d-gamedev-team/gfm/issues/86

ColdenCullen commented 10 years ago

Great, thanks for doing that for us!

p0nce commented 10 years ago

Hi, the new fromEulerAngles/toEulerAngles have changed to use a better ordering of axis, this could break your code if you already used it. https://github.com/d-gamedev-team/gfm/commit/f78e23613402f8a082283fb2a5528d104b8aebad

ColdenCullen commented 10 years ago

Thanks for the heads up. I'm running everything through an abstraction layer at this point, so it should be an easy fix.

p0nce commented 9 years ago

Hi again, if upgrading the gfm:sdl2 dependency to 2.0.x, you'll be able to drop some useless code and the dependency to the "colorize" package.

ColdenCullen commented 9 years ago

Does gfm:sdl2 depend on colorize? If so, what does it use it for? Just out of curiosity's sake.

Also, we do actually use colorize, so it don't think it makes sense to drop it.

p0nce commented 9 years ago

Yes before 2.0.x gfm:sdl2 depended on gfm:core which contained a Logger implementation which depended on colorize. This was odd and this is not the case anymore. Cool to see you used colorize anyway.

ColdenCullen commented 9 years ago

Ok, so is the Logger that SDL.this() takes here an std.experimental.logger? If so, I'll definitely send ours in.

p0nce commented 9 years ago

Yes, it is a std.experimental.logger.

(Unrelated: if upgrading to gfm:sdl2 2.0.x, beware because no SDL subsystem will be initialized anymore by SDL.this(). Eg: https://github.com/d-gamedev-team/gfm/blob/master/examples/simpleshader/simpleshader.d#L27 )

ColdenCullen commented 9 years ago

Ahh, good to know. I'll try to do that upgrade this evening. I think we should just need EVENTS and VIDEO like the example.