Transform is uniform if not present

This commit is contained in:
John Alanbrook 2024-05-21 09:33:17 -05:00
parent 0a318c56e5
commit 39442c10af
2 changed files with 12 additions and 27 deletions

View file

@ -357,11 +357,6 @@ render.point = function(pos,size,color = Color.blue) {
render.circle(pos,size,size,color); render.circle(pos,size,size,color);
}; };
var tmpline = render.line;
render.line = function(points, color = Color.white, thickness = 1) {
// tmpline(points,color,thickness);
};
render.cross = function(pos, size, color = Color.red) { render.cross = function(pos, size, color = Color.red) {
var a = [ var a = [
pos.add([0,size]), pos.add([0,size]),
@ -371,7 +366,6 @@ render.cross = function(pos, size, color = Color.red) {
pos.add([size,0]), pos.add([size,0]),
pos.add([-size,0]) pos.add([-size,0])
]; ];
render.line(a,color); render.line(a,color);
render.line(b,color); render.line(b,color);
}; };
@ -400,15 +394,6 @@ render.boundingbox = function(bb, color = Color.white) {
render.poly(bbox.topoints(bb), color); render.poly(bbox.topoints(bb), color);
} }
render.poly = function(points, color)
{
return;
render.setpipeline(render.polyshader.pipe);
var poly = render.poly_prim(points);
render.shader_apply_material(render.polyshader, {shade:color});
render.spdraw(render.sg_bind(render.polyshader, poly));
}
render.rectangle = function(lowerleft, upperright, color) { render.rectangle = function(lowerleft, upperright, color) {
var points = [lowerleft, lowerleft.add([upperright.x-lowerleft.x,0]), upperright, lowerleft.add([0,upperright.y-lowerleft.y])]; var points = [lowerleft, lowerleft.add([upperright.x-lowerleft.x,0]), upperright, lowerleft.add([0,upperright.y-lowerleft.y])];
render.poly(points, color); render.poly(points, color);

View file

@ -923,7 +923,7 @@ JSC_CCALL(render_setunim4,
m = HMM_MulM4(p,m); m = HMM_MulM4(p,m);
} }
} }
} else } else if (!JS_IsUndefined(argv[2]))
m = transform2mat(*js2transform(argv[2])); m = transform2mat(*js2transform(argv[2]));
sg_apply_uniforms(js2number(argv[0]), js2number(argv[1]), SG_RANGE_REF(m.e)); sg_apply_uniforms(js2number(argv[0]), js2number(argv[1]), SG_RANGE_REF(m.e));