BRL.vec, BRL.matrix

BlitzMax Forums/BlitzMax Programming/BRL.vec, BRL.matrix

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I also use vec4's for planes and colors. That's why I call it a vec4 and not a quat:
Type TEntity

Field color:TVec4=New TVec4

Method SetColor(r,g,b,a=255)
color.x=float(r)/255.0
color.y=float(g)/255.0
color.z=float(b)/255.0
color.w=float(a)/255.0
EndMethod

glLightfv GL_LIGHT0,GL_DIFFUSE,entity.color


All that GLSL makes me think in terms of vectors. My advice is to convert everything to OO vectors, because if you mix OO vectors with a lot of individual floats you won't get the full advantage of how much it shrinks your code.