vec3 c; // coords
float end = a_start + a_loops/a_fps*a_n_frames;
- if (a_loops == -1.0 || time < end) {
+ if (a_fps != 0.0 && (a_loops == -1.0 || time < end)) {
// in animation
float frame = mod(floor((time-a_start)*a_fps), a_n_frames);
v_coord = a_tex_coord + a_tex_diff*frame;
data[o+36] = tc[v*2+1]
# a_tex_diff
- var dx = animation.frames[1].texture_coords[0] - animation.frames[0].texture_coords[0]
- var dy = animation.frames[1].texture_coords[1] - animation.frames[0].texture_coords[1]
+ var dx = 0.0
+ var dy = 0.0
+ if animation.frames.length > 1 then
+ dx = animation.frames[1].texture_coords[0] - animation.frames[0].texture_coords[0]
+ dy = animation.frames[1].texture_coords[1] - animation.frames[0].texture_coords[1]
+ end
data[o+37] = dx
data[o+38] = dy