// Provides rotating gear objects for tick tock clock
// by RHY3756547
//
// includes:
// render stuff idk
//
window.ObjGear=function(obji,scene){
varobji=obji;
varres=[];
vart=this;
t.collidable=true;
t.colMode=0;
t.colRad=512;
t.getCollision=getCollision;
t.moveWith=moveWith;
t.pos=vec3.clone(obji.pos);
//t.angle = vec3.clone(obji.angle);
t.scale=vec3.clone(obji.scale);
t.requireRes=requireRes;
t.provideRes=provideRes;
t.update=update;
t.draw=draw;
t.speed=(obji.setting1&0xFFFF)/8192;
t.duration=obji.setting1>>16;
t.rampDur=obji.setting2&0xFFFF;
t.statDur=obji.setting2>>16;
t.wB1=obji.setting3&0xFFFF;//ONE of these flips direction, the other makes the gear use the black model. Not sure which is which, but for tick tock clock there is no need to get this right.
functionmoveWith(obj){//used for collidable objects that move.
//the most general way to move something with an object is to multiply its position by the inverse mv matrix of that object, and then the new mv matrix.