Dash icon indicating copy to clipboard operation
Dash copied to clipboard

Port to gfm:math from gl3n

Open ColdenCullen opened this issue 10 years ago • 16 comments

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.

ColdenCullen avatar Aug 23 '14 14:08 ColdenCullen

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

p0nce avatar Aug 24 '14 10:08 p0nce

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.

ColdenCullen avatar Sep 10 '14 17:09 ColdenCullen

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

wozniakty avatar Sep 10 '14 17:09 wozniakty

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

ColdenCullen avatar Sep 10 '14 17:09 ColdenCullen

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

p0nce avatar Sep 10 '14 17:09 p0nce

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

ColdenCullen avatar Sep 10 '14 17:09 ColdenCullen

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

p0nce avatar Sep 10 '14 20:09 p0nce

Great, thanks for doing that for us!

ColdenCullen avatar Sep 10 '14 21:09 ColdenCullen

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

p0nce avatar Nov 02 '14 09:11 p0nce

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

ColdenCullen avatar Nov 02 '14 17:11 ColdenCullen

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.

p0nce avatar Dec 18 '14 12:12 p0nce

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.

ColdenCullen avatar Dec 18 '14 22:12 ColdenCullen

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.

p0nce avatar Dec 18 '14 22:12 p0nce

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

ColdenCullen avatar Dec 18 '14 23:12 ColdenCullen

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 )

p0nce avatar Dec 18 '14 23:12 p0nce

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.

ColdenCullen avatar Dec 18 '14 23:12 ColdenCullen