cocos-enhance-kit/jsb-adapter/engine/assemblers/assembler-3d.js
2022-06-25 00:23:03 +08:00

35 lines
978 B
JavaScript

(function(){
if(!cc.Assembler3D) return;
cc.Assembler3D.updateWorldVerts = function (comp) {
let local = this._local;
let world = this._renderData.vDatas[0];
let vl = local[0], vr = local[2], vb = local[1], vt = local[3];
// left bottom
let floatsPerVert = this.floatsPerVert;
let offset = 0;
world[offset] = vl;
world[offset+1] = vb;
world[offset+2] = 0;
offset += floatsPerVert;
// right bottom
world[offset] = vr;
world[offset+1] = vb;
world[offset+2] = 0;
offset += floatsPerVert;
// left top
world[offset] = vl;
world[offset+1] = vt;
world[offset+2] = 0;
offset += floatsPerVert;
// right top
world[offset] = vr;
world[offset+1] = vt;
world[offset+2] = 0;
}
})()