Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function skin3D(a, b) {
- this.width = 267, this.height = 250, this.radius = 30, this.alpha = 0, this.delta = -0.8, this.beta = 0.3, this.fps = 60, this.autoTurnAround = 0.005, this.animSpeed = 0.011, this.animDistanceK = 0.7, this.pause = !1, this.stop = !1, this.sensitivity = 1, this.backgroundColor = 16316664, this.zoom = [15, 60], this.maxBeta = Math.PI, this.img, this.skinTexture, this.cloakTexture, this.blockTexture, this.context, this.canvas, this.material1, this.material2, this.camera, this.scene, this.rendered, this.init = function() {
- this.camera = new THREE.PerspectiveCamera(75, this.width / this.height, 1, 1e4), this.scene = new THREE.Scene, cloakMesh = null, this.createSkinImage(a)
- }, this.createSkinImage = function(a) {
- var b = this;
- this.img = new Image, this.img.crossOrigin = "", this.img.src = a, this.img.onload = function() {
- if (b.write("Loaded Image " + b.img.src), null == b.skinTexture) {
- if (b.canvas = document.getElementById(canvas), b.canvas.width = b.img.width, b.canvas.height = b.img.width, b.skinTexture = new THREE.Texture(b.canvas), b.skinTexture.magFilter = THREE.NearestFilter, b.skinTexture.minFilter = THREE.NearestMipMapNearestFilter, b.material1 = new THREE.MeshBasicMaterial({
- map: b.skinTexture,
- side: THREE.FrontSide
- }), b.material2 = new THREE.MeshBasicMaterial({
- map: b.skinTexture,
- transparent: !0,
- opacity: 1,
- alphaTest: 0.5,
- side: THREE.DoubleSide
- }), b.context = b.GetCTX(b.canvas), !b.context) {
- return b.loadFail(1)
- };
- b.context.clearRect(0, 0, b.img.width, b.img.width), b.context.drawImage(b.img, 0, 0), b.skin2D.complete(b.context, b), b.callMethods(), b.write("Init end.")
- } else {
- b.canvas.width = b.img.width, b.canvas.height = b.img.width, b.context.clearRect(0, 0, b.img.width, b.img.width), b.context.drawImage(b.img, 0, 0), b.skin2D.complete(b.context, b), b.needsUpdates()
- }
- }, this.img.onerror = function() {
- b.GetSkinName() != default ? b.changeSkinName(default) : (b.write("Failed loading " + b.img.src), b.loadFail(2))
- }
- }, this.changeSkin = function(a) {
- this.img.src = a
- }, this.GetSkinName = function() {
- var a = this.img.src.split("/"),
- b = a[a.length - 1].split(".");
- return b[0]
- }, this.changeSkinName = function(a) {
- for (var b = this.img.src.split("/"), d = "", c = 0; c < b.length - 1; c++) {
- d += b[c] + "/"
- };
- d = d + a + ".png", this.img.src = d
- }, this.changeCloak = function(a) {
- return this.IsCloak() ? (this.removeCloak(), void((this)).createCloak(a)) : !1
- }, this.updateSkin = function() {
- this.changeSkin(this.img.src + ?update= + Math.random())
- }, this.updateCloak = function() {
- this.IsCloak() && this.changeCloak(this.cloakTexture.image.src + ?update= + Math.random())
- }, this.needsUpdates = function() {
- this.skinTexture.needsUpdate = !0, this.material1.needsUpdate = !0, this.material2.needsUpdate = !0
- }, this.callMethods = function() {
- this.needsUpdates();
- try {
- this.render()
- } catch (a) {
- return this.loadFail(3)
- };
- this.addEvents(), this.addToElement(b), this.animate()
- }, this.addEvents = function() {
- var a = this,
- b = this.rendered.domElement;
- b.onmousedown = function(b) {
- var d = a.MouseCoords.getX(b),
- c = a.MouseCoords.getY(b),
- g = a.delta,
- h = a.beta;
- a.pause = !0, document.onmousemove = function(b) {
- b || (b = window.event), a.delta = g + (a.MouseCoords.getX(b) - d) / a.width * Math.PI * a.sensitivity, a.beta = h + (a.MouseCoords.getY(b) - c) / a.height * Math.PI * a.sensitivity, a.beta > a.maxBeta / 2 ? a.beta = a.maxBeta / 2 : a.beta < -a.maxBeta / 2 && (a.beta = -a.maxBeta / 2)
- }, document.onmouseup = function() {
- document.onmousemove = null, document.onmouseup = null, a.stop || (a.pause = !1)
- }
- }, b.onwheel = function(b) {
- b = b || window.event;
- var d = b.deltaY || b.detail || b.wheelDelta;
- a.radius += (d > 0 ? 2 : -2) * a.sensitivity, a.radius > a.zoom[1] ? a.radius = a.zoom[1] : a.radius < a.zoom[0] && (a.radius = a.zoom[0])
- }, b.oncontextmenu = function() {
- return a.stop ? a.startAnimate() : a.stopAnimate(), !1
- }
- }, this.addToElement = function(a) {
- a.appendChild(this.rendered.domElement), this.""(a)
- }, this."" = function(a) {
- var b = document.createElement(div),
- d = this.codeDE("");
- b.innerHTML = d, b.align = center, b.style.position = relative, b.style.fontFamily = tahoma, b.style.fontSize = 8px, b.style.color = #000000, b.title = this.codeDE(""), b.onselectstart = function() {
- return !1
- };
- var c = this;
- setInterval(function() {
- null != b && c.IsVisibleElem(b) && b.innerHTML == d
- }, 5e3), a.appendChild(b)
- }, this.IsVisibleElem = function(a) {
- for (; null != a && a != b;) {
- if (a.style.display == none || null != a.style.fontSize && a.style.fontSize != 8px || null != a.style.color && a.style.color != "rgb(0, 0, 0)" || null != a.style.fontFamily && a.style.fontFamily != tahoma) {
- return !1
- };
- a = a.parentElement
- };
- return !0
- }, this.codeEN = function(a) {
- return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g, function(a, b) {
- return String.fromCharCode(0x + b)
- }))
- }, this.codeDE = function(a) {
- return decodeURIComponent(Array.prototype.map.call(atob(a), function(a) {
- return % + (00 + a.charCodeAt(0).toString(16)).slice(-2)
- }).join(""))
- }, this.startAnimate = function() {
- this.pause = !1, this.stop = !1
- }, this.stopAnimate = function() {
- this.pause = !0, this.stop = !0
- }, this.animate = function() {
- var a = this;
- setInterval(function() {
- a.pause || (a.alpha += a.animSpeed * (90 / a.fps), a.delta += a.autoTurnAround * (90 / a.fps), leftLeg2Mesh.rotation.x = leftLegMesh.rotation.x = Math.cos(4 * a.alpha) * a.animDistanceK, leftLeg2Mesh.position.z = leftLegMesh.position.z = 0 - 6 * Math.sin(leftLegMesh.rotation.x), leftLeg2Mesh.position.y = leftLegMesh.position.y = -16 - 6 * Math.abs(Math.cos(leftLegMesh.rotation.x)), rightLeg2Mesh.rotation.x = rightLegMesh.rotation.x = Math.cos(4 * a.alpha + Math.PI) * a.animDistanceK, rightLeg2Mesh.position.z = rightLegMesh.position.z = 0 - 6 * Math.sin(rightLegMesh.rotation.x), rightLeg2Mesh.position.y = rightLegMesh.position.y = -16 - 6 * Math.abs(Math.cos(rightLegMesh.rotation.x)), leftArm2Mesh.rotation.x = leftArmMesh.rotation.x = Math.cos(4 * a.alpha + Math.PI) * a.animDistanceK, leftArm2Mesh.position.z = leftArmMesh.position.z = 0 - 6 * Math.sin(leftArmMesh.rotation.x), leftArm2Mesh.position.y = leftArmMesh.position.y = -4 - 6 * Math.abs(Math.cos(leftArmMesh.rotation.x)), rightArm2Mesh.rotation.x = rightArmMesh.rotation.x = Math.cos(4 * a.alpha) * a.animDistanceK, rightArm2Mesh.position.z = rightArmMesh.position.z = 0 - 6 * Math.sin(rightArmMesh.rotation.x), rightArm2Mesh.position.y = rightArmMesh.position.y = -4 - 6 * Math.abs(Math.cos(rightArmMesh.rotation.x)), headMesh.rotation.y = head2Mesh.rotation.y = Math.cos(2 * a.alpha) / 2, headMesh.rotation.x = head2Mesh.rotation.x = Math.cos(1.5 * a.alpha) / 8, a.IsCloak() && (cloakMesh.position.y = -4.5, cloakMesh.position.z = -2.5, cloakMesh.translateY(-7.5), cloakMesh.rotation.x = 0.2 + Math.cos(3 * a.alpha) / 6));
- var b = a.radius * Math.cos(a.beta);
- a.camera.position.z = b * Math.cos(-a.delta), a.camera.position.x = b * Math.sin(-a.delta), a.camera.position.y = -12 + a.radius * Math.sin(a.beta), a.camera.lookAt(bodyMesh.position), a.rendered.render(a.scene, a.camera)
- }, 1e3 / this.fps)
- }, this.render = function() {
- var a = [new THREE.Vector2(0.125, 0.875), new THREE.Vector2(0.25, 0.875), new THREE.Vector2(0.25, 1), new THREE.Vector2(0.125, 1)],
- b = [new THREE.Vector2(0.25, 0.875), new THREE.Vector2(0.375, 0.875), new THREE.Vector2(0.375, 1), new THREE.Vector2(0.25, 1)],
- d = [new THREE.Vector2(0, 0.75), new THREE.Vector2(0.125, 0.75), new THREE.Vector2(0.125, 0.875), new THREE.Vector2(0, 0.875)],
- c = [new THREE.Vector2(0.125, 0.75), new THREE.Vector2(0.25, 0.75), new THREE.Vector2(0.25, 0.875), new THREE.Vector2(0.125, 0.875)],
- g = [new THREE.Vector2(0.25, 0.75), new THREE.Vector2(0.375, 0.75), new THREE.Vector2(0.375, 0.875), new THREE.Vector2(0.25, 0.875)],
- h = [new THREE.Vector2(0.375, 0.75), new THREE.Vector2(0.5, 0.75), new THREE.Vector2(0.5, 0.875), new THREE.Vector2(0.375, 0.875)];
- headBox = new THREE.BoxGeometry(8, 8, 8, 0, 0, 0), headBox.faceVertexUvs[0] = [], headBox.faceVertexUvs[0][0] = [g[3], g[0], g[2]], headBox.faceVertexUvs[0][1] = [g[0], g[1], g[2]], headBox.faceVertexUvs[0][2] = [d[3], d[0], d[2]], headBox.faceVertexUvs[0][3] = [d[0], d[1], d[2]], headBox.faceVertexUvs[0][4] = [a[3], a[0], a[2]], headBox.faceVertexUvs[0][5] = [a[0], a[1], a[2]], headBox.faceVertexUvs[0][6] = [b[0], b[3], b[1]], headBox.faceVertexUvs[0][7] = [b[3], b[2], b[1]], headBox.faceVertexUvs[0][8] = [c[3], c[0], c[2]], headBox.faceVertexUvs[0][9] = [c[0], c[1], c[2]], headBox.faceVertexUvs[0][10] = [h[3], h[0], h[2]], headBox.faceVertexUvs[0][11] = [h[0], h[1], h[2]], headMesh = new THREE.Mesh(headBox, this.material1), headMesh.name = head, this.scene.add(headMesh);
- var G = [new THREE.Vector2(0.3125, 0.6875), new THREE.Vector2(0.4375, 0.6875), new THREE.Vector2(0.4375, 0.75), new THREE.Vector2(0.3125, 0.75)],
- cf = [new THREE.Vector2(0.4375, 0.6875), new THREE.Vector2(0.5625, 0.6875), new THREE.Vector2(0.5625, 0.75), new THREE.Vector2(0.4375, 0.75)],
- U = [new THREE.Vector2(0.25, 0.5), new THREE.Vector2(0.3125, 0.5), new THREE.Vector2(0.3125, 0.6875), new THREE.Vector2(0.25, 0.6875)],
- bJ = [new THREE.Vector2(0.3125, 0.5), new THREE.Vector2(0.4375, 0.5), new THREE.Vector2(0.4375, 0.6875), new THREE.Vector2(0.3125, 0.6875)],
- A = [new THREE.Vector2(0.4375, 0.5), new THREE.Vector2(0.5, 0.5), new THREE.Vector2(0.5, 0.6875), new THREE.Vector2(0.4375, 0.6875)],
- D = [new THREE.Vector2(0.5, 0.5), new THREE.Vector2(0.625, 0.5), new THREE.Vector2(0.625, 0.6875), new THREE.Vector2(0.5, 0.6875)];
- bodyBox = new THREE.BoxGeometry(8, 12, 4, 0, 0, 0), bodyBox.faceVertexUvs[0] = [], bodyBox.faceVertexUvs[0][0] = [A[3], A[0], A[2]], bodyBox.faceVertexUvs[0][1] = [A[0], A[1], A[2]], bodyBox.faceVertexUvs[0][2] = [U[3], U[0], U[2]], bodyBox.faceVertexUvs[0][3] = [U[0], U[1], U[2]], bodyBox.faceVertexUvs[0][4] = [G[3], G[0], G[2]], bodyBox.faceVertexUvs[0][5] = [G[0], G[1], G[2]], bodyBox.faceVertexUvs[0][6] = [cf[0], cf[3], cf[1]], bodyBox.faceVertexUvs[0][7] = [cf[3], cf[2], cf[1]], bodyBox.faceVertexUvs[0][8] = [bJ[3], bJ[0], bJ[2]], bodyBox.faceVertexUvs[0][9] = [bJ[0], bJ[1], bJ[2]], bodyBox.faceVertexUvs[0][10] = [D[3], D[0], D[2]], bodyBox.faceVertexUvs[0][11] = [D[0], D[1], D[2]], bodyMesh = new THREE.Mesh(bodyBox, this.material1), bodyMesh.name = body, bodyMesh.position.y = -10, this.scene.add(bodyMesh);
- var k = [new THREE.Vector2(0.6875, 0.6875), new THREE.Vector2(0.75, 0.6875), new THREE.Vector2(0.75, 0.75), new THREE.Vector2(0.6875, 0.75)],
- H = [new THREE.Vector2(0.75, 0.6875), new THREE.Vector2(0.8125, 0.6875), new THREE.Vector2(0.8125, 0.75), new THREE.Vector2(0.75, 0.75)],
- O = [new THREE.Vector2(0.625, 0.5), new THREE.Vector2(0.6875, 0.5), new THREE.Vector2(0.6875, 0.6875), new THREE.Vector2(0.625, 0.6875)],
- W = [new THREE.Vector2(0.6875, 0.5), new THREE.Vector2(0.75, 0.5), new THREE.Vector2(0.75, 0.6875), new THREE.Vector2(0.6875, 0.6875)],
- z = [new THREE.Vector2(0.75, 0.5), new THREE.Vector2(0.8125, 0.5), new THREE.Vector2(0.8125, 0.6875), new THREE.Vector2(0.75, 0.6875)],
- X = [new THREE.Vector2(0.8125, 0.5), new THREE.Vector2(0.875, 0.5), new THREE.Vector2(0.875, 0.6875), new THREE.Vector2(0.8125, 0.6875)];
- rightArmBox = new THREE.BoxGeometry(4, 12, 4, 0, 0, 0), rightArmBox.faceVertexUvs[0] = [], rightArmBox.faceVertexUvs[0][0] = [z[3], z[0], z[2]], rightArmBox.faceVertexUvs[0][1] = [z[0], z[1], z[2]], rightArmBox.faceVertexUvs[0][2] = [O[3], O[0], O[2]], rightArmBox.faceVertexUvs[0][3] = [O[0], O[1], O[2]], rightArmBox.faceVertexUvs[0][4] = [k[3], k[0], k[2]], rightArmBox.faceVertexUvs[0][5] = [k[0], k[1], k[2]], rightArmBox.faceVertexUvs[0][6] = [H[0], H[3], H[1]], rightArmBox.faceVertexUvs[0][7] = [H[3], H[2], H[1]], rightArmBox.faceVertexUvs[0][8] = [W[3], W[0], W[2]], rightArmBox.faceVertexUvs[0][9] = [W[0], W[1], W[2]], rightArmBox.faceVertexUvs[0][10] = [X[3], X[0], X[2]], rightArmBox.faceVertexUvs[0][11] = [X[0], X[1], X[2]], rightArmMesh = new THREE.Mesh(rightArmBox, this.material1), rightArmMesh.name = rightArm, rightArmMesh.position.y = -10, rightArmMesh.position.x = -6, this.scene.add(rightArmMesh);
- var cg = [new THREE.Vector2(0.5625, 0.1875), new THREE.Vector2(0.625, 0.1875), new THREE.Vector2(0.625, 0.25), new THREE.Vector2(0.5625, 0.25)],
- bX = [new THREE.Vector2(0.625, 0.1875), new THREE.Vector2(0.6875, 0.1875), new THREE.Vector2(0.6875, 0.25), new THREE.Vector2(0.625, 0.25)],
- j = [new THREE.Vector2(0.5, 0), new THREE.Vector2(0.5625, 0), new THREE.Vector2(0.5625, 0.1875), new THREE.Vector2(0.5, 0.1875)],
- ca = [new THREE.Vector2(0.5625, 0), new THREE.Vector2(0.625, 0), new THREE.Vector2(0.625, 0.1875), new THREE.Vector2(0.5625, 0.1875)],
- cd = [new THREE.Vector2(0.625, 0), new THREE.Vector2(0.6875, 0), new THREE.Vector2(0.6875, 0.1875), new THREE.Vector2(0.625, 0.1875)],
- bZ = [new THREE.Vector2(0.6875, 0), new THREE.Vector2(0.75, 0), new THREE.Vector2(0.75, 0.1875), new THREE.Vector2(0.6875, 0.1875)];
- leftArmBox = new THREE.BoxGeometry(4, 12, 4, 0, 0, 0), leftArmBox.faceVertexUvs[0] = [], leftArmBox.faceVertexUvs[0][0] = [cd[3], cd[0], cd[2]], leftArmBox.faceVertexUvs[0][1] = [cd[0], cd[1], cd[2]], leftArmBox.faceVertexUvs[0][2] = [j[3], j[0], j[2]], leftArmBox.faceVertexUvs[0][3] = [j[0], j[1], j[2]], leftArmBox.faceVertexUvs[0][4] = [cg[3], cg[0], cg[2]], leftArmBox.faceVertexUvs[0][5] = [cg[0], cg[1], cg[2]], leftArmBox.faceVertexUvs[0][6] = [bX[0], bX[3], bX[1]], leftArmBox.faceVertexUvs[0][7] = [bX[3], bX[2], bX[1]], leftArmBox.faceVertexUvs[0][8] = [ca[3], ca[0], ca[2]], leftArmBox.faceVertexUvs[0][9] = [ca[0], ca[1], ca[2]], leftArmBox.faceVertexUvs[0][10] = [bZ[3], bZ[0], bZ[2]], leftArmBox.faceVertexUvs[0][11] = [bZ[0], bZ[1], bZ[2]], leftArmMesh = new THREE.Mesh(leftArmBox, this.material1), leftArmMesh.name = leftArm, leftArmMesh.position.y = -10, leftArmMesh.position.x = 6, this.scene.add(leftArmMesh);
- var ce = [new THREE.Vector2(0.0625, 0.6875), new THREE.Vector2(0.125, 0.6875), new THREE.Vector2(0.125, 0.75), new THREE.Vector2(0.0625, 0.75)],
- bM = [new THREE.Vector2(0.125, 0.6875), new THREE.Vector2(0.1875, 0.6875), new THREE.Vector2(0.1875, 0.75), new THREE.Vector2(0.125, 0.75)],
- K = [new THREE.Vector2(0, 0.5), new THREE.Vector2(0.0625, 0.5), new THREE.Vector2(0.0625, 0.6875), new THREE.Vector2(0, 0.6875)],
- Z = [new THREE.Vector2(0.0625, 0.5), new THREE.Vector2(0.125, 0.5), new THREE.Vector2(0.125, 0.6875), new THREE.Vector2(0.0625, 0.6875)],
- M = [new THREE.Vector2(0.125, 0.5), new THREE.Vector2(0.1875, 0.5), new THREE.Vector2(0.1875, 0.6875), new THREE.Vector2(0.125, 0.6875)],
- bO = [new THREE.Vector2(0.1875, 0.5), new THREE.Vector2(0.25, 0.5), new THREE.Vector2(0.25, 0.6875), new THREE.Vector2(0.1875, 0.6875)];
- rightLegBox = new THREE.BoxGeometry(4, 12, 4, 0, 0, 0), rightLegBox.faceVertexUvs[0] = [], rightLegBox.faceVertexUvs[0][0] = [M[3], M[0], M[2]], rightLegBox.faceVertexUvs[0][1] = [M[0], M[1], M[2]], rightLegBox.faceVertexUvs[0][2] = [K[3], K[0], K[2]], rightLegBox.faceVertexUvs[0][3] = [K[0], K[1], K[2]], rightLegBox.faceVertexUvs[0][4] = [ce[3], ce[0], ce[2]], rightLegBox.faceVertexUvs[0][5] = [ce[0], ce[1], ce[2]], rightLegBox.faceVertexUvs[0][6] = [bM[0], bM[3], bM[1]], rightLegBox.faceVertexUvs[0][7] = [bM[3], bM[2], bM[1]], rightLegBox.faceVertexUvs[0][8] = [Z[3], Z[0], Z[2]], rightLegBox.faceVertexUvs[0][9] = [Z[0], Z[1], Z[2]], rightLegBox.faceVertexUvs[0][10] = [bO[3], bO[0], bO[2]], rightLegBox.faceVertexUvs[0][11] = [bO[0], bO[1], bO[2]], rightLegMesh = new THREE.Mesh(rightLegBox, this.material1), rightLegMesh.name = rightLeg, rightLegMesh.position.y = -22, rightLegMesh.position.x = -2, this.scene.add(rightLegMesh);
- var p = [new THREE.Vector2(0.3125, 0.1875), new THREE.Vector2(0.375, 0.1875), new THREE.Vector2(0.375, 0.25), new THREE.Vector2(0.3125, 0.25)],
- bK = [new THREE.Vector2(0.375, 0.1875), new THREE.Vector2(0.4375, 0.1875), new THREE.Vector2(0.4375, 0.25), new THREE.Vector2(0.375, 0.25)],
- q = [new THREE.Vector2(0.25, 0), new THREE.Vector2(0.3125, 0), new THREE.Vector2(0.3125, 0.1875), new THREE.Vector2(0.25, 0.1875)],
- bT = [new THREE.Vector2(0.3125, 0), new THREE.Vector2(0.375, 0), new THREE.Vector2(0.375, 0.1875), new THREE.Vector2(0.3125, 0.1875)],
- w = [new THREE.Vector2(0.375, 0), new THREE.Vector2(0.4375, 0), new THREE.Vector2(0.4375, 0.1875), new THREE.Vector2(0.375, 0.1875)],
- bS = [new THREE.Vector2(0.4375, 0), new THREE.Vector2(0.5, 0), new THREE.Vector2(0.5, 0.1875), new THREE.Vector2(0.4375, 0.1875)];
- leftLegBox = new THREE.BoxGeometry(4, 12, 4, 0, 0, 0), leftLegBox.faceVertexUvs[0] = [], leftLegBox.faceVertexUvs[0][0] = [w[3], w[0], w[2]], leftLegBox.faceVertexUvs[0][1] = [w[0], w[1], w[2]], leftLegBox.faceVertexUvs[0][2] = [q[3], q[0], q[2]], leftLegBox.faceVertexUvs[0][3] = [q[0], q[1], q[2]], leftLegBox.faceVertexUvs[0][4] = [p[3], p[0], p[2]], leftLegBox.faceVertexUvs[0][5] = [p[0], p[1], p[2]], leftLegBox.faceVertexUvs[0][6] = [bK[0], bK[3], bK[1]], leftLegBox.faceVertexUvs[0][7] = [bK[3], bK[2], bK[1]], leftLegBox.faceVertexUvs[0][8] = [bT[3], bT[0], bT[2]], leftLegBox.faceVertexUvs[0][9] = [bT[0], bT[1], bT[2]], leftLegBox.faceVertexUvs[0][10] = [bS[3], bS[0], bS[2]], leftLegBox.faceVertexUvs[0][11] = [bS[0], bS[1], bS[2]], leftLegMesh = new THREE.Mesh(leftLegBox, this.material1), leftLegMesh.name = leftLeg, leftLegMesh.position.y = -22, leftLegMesh.position.x = 2, this.scene.add(leftLegMesh);
- var bL = [new THREE.Vector2(0.625, 0.875), new THREE.Vector2(0.75, 0.875), new THREE.Vector2(0.75, 1), new THREE.Vector2(0.625, 1)],
- ch = [new THREE.Vector2(0.75, 0.875), new THREE.Vector2(0.875, 0.875), new THREE.Vector2(0.875, 1), new THREE.Vector2(0.75, 1)],
- cc = [new THREE.Vector2(0.5, 0.75), new THREE.Vector2(0.625, 0.75), new THREE.Vector2(0.625, 0.875), new THREE.Vector2(0.5, 0.875)],
- E = [new THREE.Vector2(0.625, 0.75), new THREE.Vector2(0.75, 0.75), new THREE.Vector2(0.75, 0.875), new THREE.Vector2(0.625, 0.875)],
- R = [new THREE.Vector2(0.75, 0.75), new THREE.Vector2(0.875, 0.75), new THREE.Vector2(0.875, 0.875), new THREE.Vector2(0.75, 0.875)],
- r = [new THREE.Vector2(0.875, 0.75), new THREE.Vector2(1, 0.75), new THREE.Vector2(1, 0.875), new THREE.Vector2(0.875, 0.875)];
- head2Box = new THREE.BoxGeometry(9, 9, 9, 0, 0, 0), head2Box.faceVertexUvs[0] = [], head2Box.faceVertexUvs[0][0] = [R[3], R[0], R[2]], head2Box.faceVertexUvs[0][1] = [R[0], R[1], R[2]], head2Box.faceVertexUvs[0][2] = [cc[3], cc[0], cc[2]], head2Box.faceVertexUvs[0][3] = [cc[0], cc[1], cc[2]], head2Box.faceVertexUvs[0][4] = [bL[3], bL[0], bL[2]], head2Box.faceVertexUvs[0][5] = [bL[0], bL[1], bL[2]], head2Box.faceVertexUvs[0][6] = [ch[0], ch[3], ch[1]], head2Box.faceVertexUvs[0][7] = [ch[3], ch[2], ch[1]], head2Box.faceVertexUvs[0][8] = [E[3], E[0], E[2]], head2Box.faceVertexUvs[0][9] = [E[0], E[1], E[2]], head2Box.faceVertexUvs[0][10] = [r[3], r[0], r[2]], head2Box.faceVertexUvs[0][11] = [r[0], r[1], r[2]], head2Mesh = new THREE.Mesh(head2Box, this.material2), head2Mesh.name = head2, this.scene.add(head2Mesh);
- var l = [new THREE.Vector2(0.3125, 0.4375), new THREE.Vector2(0.4375, 0.4375), new THREE.Vector2(0.4375, 0.5), new THREE.Vector2(0.3125, 0.5)],
- L = [new THREE.Vector2(0.4375, 0.4375), new THREE.Vector2(0.5625, 0.4375), new THREE.Vector2(0.5625, 0.5), new THREE.Vector2(0.4375, 0.5)],
- bP = [new THREE.Vector2(0.25, 0.25), new THREE.Vector2(0.3125, 0.25), new THREE.Vector2(0.3125, 0.4375), new THREE.Vector2(0.25, 0.4375)],
- t = [new THREE.Vector2(0.3125, 0.25), new THREE.Vector2(0.4375, 0.25), new THREE.Vector2(0.4375, 0.4375), new THREE.Vector2(0.3125, 0.4375)],
- s = [new THREE.Vector2(0.4375, 0.25), new THREE.Vector2(0.5, 0.25), new THREE.Vector2(0.5, 0.4375), new THREE.Vector2(0.4375, 0.4375)],
- N = [new THREE.Vector2(0.5, 0.25), new THREE.Vector2(0.625, 0.25), new THREE.Vector2(0.625, 0.4375), new THREE.Vector2(0.5, 0.4375)];
- body2Box = new THREE.BoxGeometry(9, 13.5, 4.5, 0, 0, 0), body2Box.faceVertexUvs[0] = [], body2Box.faceVertexUvs[0][0] = [s[3], s[0], s[2]], body2Box.faceVertexUvs[0][1] = [s[0], s[1], s[2]], body2Box.faceVertexUvs[0][2] = [bP[3], bP[0], bP[2]], body2Box.faceVertexUvs[0][3] = [bP[0], bP[1], bP[2]], body2Box.faceVertexUvs[0][4] = [l[3], l[0], l[2]], body2Box.faceVertexUvs[0][5] = [l[0], l[1], l[2]], body2Box.faceVertexUvs[0][6] = [L[0], L[3], L[1]], body2Box.faceVertexUvs[0][7] = [L[3], L[2], L[1]], body2Box.faceVertexUvs[0][8] = [t[3], t[0], t[2]], body2Box.faceVertexUvs[0][9] = [t[0], t[1], t[2]], body2Box.faceVertexUvs[0][10] = [N[3], N[0], N[2]], body2Box.faceVertexUvs[0][11] = [N[0], N[1], N[2]], body2Mesh = new THREE.Mesh(body2Box, this.material2), body2Mesh.name = body2, body2Mesh.position.y = -10, this.scene.add(body2Mesh);
- var v = [new THREE.Vector2(0.6875, 0.4375), new THREE.Vector2(0.75, 0.4375), new THREE.Vector2(0.75, 0.5), new THREE.Vector2(0.6875, 0.5)],
- bR = [new THREE.Vector2(0.75, 0.4375), new THREE.Vector2(0.8125, 0.4375), new THREE.Vector2(0.8125, 0.5), new THREE.Vector2(0.75, 0.5)],
- m = [new THREE.Vector2(0.625, 0.25), new THREE.Vector2(0.6875, 0.25), new THREE.Vector2(0.6875, 0.4375), new THREE.Vector2(0.625, 0.4375)],
- P = [new THREE.Vector2(0.6875, 0.25), new THREE.Vector2(0.75, 0.25), new THREE.Vector2(0.75, 0.4375), new THREE.Vector2(0.6875, 0.4375)],
- bV = [new THREE.Vector2(0.75, 0.25), new THREE.Vector2(0.8125, 0.25), new THREE.Vector2(0.8125, 0.4375), new THREE.Vector2(0.75, 0.4375)],
- u = [new THREE.Vector2(0.8125, 0.25), new THREE.Vector2(0.875, 0.25), new THREE.Vector2(0.875, 0.4375), new THREE.Vector2(0.8125, 0.4375)],
- V = new THREE.BoxGeometry(4.5, 13.5, 4.5, 0, 0, 0);
- V.faceVertexUvs[0] = [], V.faceVertexUvs[0][0] = [bV[3], bV[0], bV[2]], V.faceVertexUvs[0][1] = [bV[0], bV[1], bV[2]], V.faceVertexUvs[0][2] = [m[3], m[0], m[2]], V.faceVertexUvs[0][3] = [m[0], m[1], m[2]], V.faceVertexUvs[0][4] = [v[3], v[0], v[2]], V.faceVertexUvs[0][5] = [v[0], v[1], v[2]], V.faceVertexUvs[0][6] = [bR[0], bR[3], bR[1]], V.faceVertexUvs[0][7] = [bR[3], bR[2], bR[1]], V.faceVertexUvs[0][8] = [P[3], P[0], P[2]], V.faceVertexUvs[0][9] = [P[0], P[1], P[2]], V.faceVertexUvs[0][10] = [u[3], u[0], u[2]], V.faceVertexUvs[0][11] = [u[0], u[1], u[2]], rightArm2Mesh = new THREE.Mesh(V, this.material2), rightArm2Mesh.name = rightArm2, rightArm2Mesh.position.y = -10, rightArm2Mesh.position.x = -6, this.scene.add(rightArm2Mesh);
- var bU = [new THREE.Vector2(0.8125, 0.1875), new THREE.Vector2(0.875, 0.1875), new THREE.Vector2(0.875, 0.25), new THREE.Vector2(0.8125, 0.25)],
- bQ = [new THREE.Vector2(0.875, 0.1875), new THREE.Vector2(0.9375, 0.1875), new THREE.Vector2(0.9375, 0.25), new THREE.Vector2(0.875, 0.25)],
- T = [new THREE.Vector2(0.75, 0), new THREE.Vector2(0.8125, 0), new THREE.Vector2(0.8125, 0.1875), new THREE.Vector2(0.75, 0.1875)],
- bW = [new THREE.Vector2(0.8125, 0), new THREE.Vector2(0.875, 0), new THREE.Vector2(0.875, 0.1875), new THREE.Vector2(0.8125, 0.1875)],
- bY = [new THREE.Vector2(0.875, 0), new THREE.Vector2(0.9375, 0), new THREE.Vector2(0.9375, 0.1875), new THREE.Vector2(0.875, 0.1875)],
- I = [new THREE.Vector2(0.9375, 0), new THREE.Vector2(1, 0), new THREE.Vector2(1, 0.1875), new THREE.Vector2(0.9375, 0.1875)],
- i = new THREE.BoxGeometry(4.5, 13.5, 4.5, 0, 0, 0);
- i.faceVertexUvs[0] = [], i.faceVertexUvs[0][0] = [bY[3], bY[0], bY[2]], i.faceVertexUvs[0][1] = [bY[0], bY[1], bY[2]], i.faceVertexUvs[0][2] = [T[3], T[0], T[2]], i.faceVertexUvs[0][3] = [T[0], T[1], T[2]], i.faceVertexUvs[0][4] = [bU[3], bU[0], bU[2]], i.faceVertexUvs[0][5] = [bU[0], bU[1], bU[2]], i.faceVertexUvs[0][6] = [bQ[0], bQ[3], bQ[1]], i.faceVertexUvs[0][7] = [bQ[3], bQ[2], bQ[1]], i.faceVertexUvs[0][8] = [bW[3], bW[0], bW[2]], i.faceVertexUvs[0][9] = [bW[0], bW[1], bW[2]], i.faceVertexUvs[0][10] = [I[3], I[0], I[2]], i.faceVertexUvs[0][11] = [I[0], I[1], I[2]], leftArm2Mesh = new THREE.Mesh(i, this.material2), leftArm2Mesh.name = leftArm2, leftArm2Mesh.position.y = -10, leftArm2Mesh.position.x = 6, this.scene.add(leftArm2Mesh);
- var Y = [new THREE.Vector2(0.0625, 0.4375), new THREE.Vector2(0.125, 0.4375), new THREE.Vector2(0.125, 0.5), new THREE.Vector2(0.0625, 0.5)],
- bN = [new THREE.Vector2(0.125, 0.4375), new THREE.Vector2(0.1875, 0.4375), new THREE.Vector2(0.1875, 0.5), new THREE.Vector2(0.125, 0.5)],
- C = [new THREE.Vector2(0, 0.25), new THREE.Vector2(0.0625, 0.25), new THREE.Vector2(0.0625, 0.4375), new THREE.Vector2(0, 0.4375)],
- F = [new THREE.Vector2(0.0625, 0.25), new THREE.Vector2(0.125, 0.25), new THREE.Vector2(0.125, 0.4375), new THREE.Vector2(0.0625, 0.4375)],
- o = [new THREE.Vector2(0.125, 0.25), new THREE.Vector2(0.1875, 0.25), new THREE.Vector2(0.1875, 0.4375), new THREE.Vector2(0.125, 0.4375)],
- J = [new THREE.Vector2(0.1875, 0.25), new THREE.Vector2(0.25, 0.25), new THREE.Vector2(0.25, 0.4375), new THREE.Vector2(0.1875, 0.4375)];
- rightLeg2Box = new THREE.BoxGeometry(4.5, 13.5, 4.5, 0, 0, 0), rightLeg2Box.faceVertexUvs[0] = [], rightLeg2Box.faceVertexUvs[0][0] = [o[3], o[0], o[2]], rightLeg2Box.faceVertexUvs[0][1] = [o[0], o[1], o[2]], rightLeg2Box.faceVertexUvs[0][2] = [C[3], C[0], C[2]], rightLeg2Box.faceVertexUvs[0][3] = [C[0], C[1], C[2]], rightLeg2Box.faceVertexUvs[0][4] = [Y[3], Y[0], Y[2]], rightLeg2Box.faceVertexUvs[0][5] = [Y[0], Y[1], Y[2]], rightLeg2Box.faceVertexUvs[0][6] = [bN[0], bN[3], bN[1]], rightLeg2Box.faceVertexUvs[0][7] = [bN[3], bN[2], bN[1]], rightLeg2Box.faceVertexUvs[0][8] = [F[3], F[0], F[2]], rightLeg2Box.faceVertexUvs[0][9] = [F[0], F[1], F[2]], rightLeg2Box.faceVertexUvs[0][10] = [J[3], J[0], J[2]], rightLeg2Box.faceVertexUvs[0][11] = [J[0], J[1], J[2]], rightLeg2Mesh = new THREE.Mesh(rightLeg2Box, this.material2), rightLeg2Mesh.name = rightLeg2, rightLeg2Mesh.position.y = -22, rightLeg2Mesh.position.x = -2, this.scene.add(rightLeg2Mesh);
- var Q = [new THREE.Vector2(0.0625, 0.1875), new THREE.Vector2(0.125, 0.1875), new THREE.Vector2(0.125, 0.25), new THREE.Vector2(0.0625, 0.25)],
- bH = [new THREE.Vector2(0.125, 0.1875), new THREE.Vector2(0.1875, 0.1875), new THREE.Vector2(0.1875, 0.25), new THREE.Vector2(0.125, 0.25)],
- B = [new THREE.Vector2(0, 0), new THREE.Vector2(0.0625, 0), new THREE.Vector2(0.0625, 0.1875), new THREE.Vector2(0, 0.1875)],
- bI = [new THREE.Vector2(0.0625, 0), new THREE.Vector2(0.125, 0), new THREE.Vector2(0.125, 0.1875), new THREE.Vector2(0.0625, 0.1875)],
- S = [new THREE.Vector2(0.125, 0), new THREE.Vector2(0.1875, 0), new THREE.Vector2(0.1875, 0.1875), new THREE.Vector2(0.125, 0.1875)],
- cb = [new THREE.Vector2(0.1875, 0), new THREE.Vector2(0.25, 0), new THREE.Vector2(0.25, 0.1875), new THREE.Vector2(0.1875, 0.1875)],
- n = new THREE.BoxGeometry(4.5, 13.5, 4.5, 0, 0, 0);
- n.faceVertexUvs[0] = [], n.faceVertexUvs[0][0] = [S[3], S[0], S[2]], n.faceVertexUvs[0][1] = [S[0], S[1], S[2]], n.faceVertexUvs[0][2] = [B[3], B[0], B[2]], n.faceVertexUvs[0][3] = [B[0], B[1], B[2]], n.faceVertexUvs[0][4] = [Q[3], Q[0], Q[2]], n.faceVertexUvs[0][5] = [Q[0], Q[1], Q[2]], n.faceVertexUvs[0][6] = [bH[0], bH[3], bH[1]], n.faceVertexUvs[0][7] = [bH[3], bH[2], bH[1]], n.faceVertexUvs[0][8] = [bI[3], bI[0], bI[2]], n.faceVertexUvs[0][9] = [bI[0], bI[1], bI[2]], n.faceVertexUvs[0][10] = [cb[3], cb[0], cb[2]], n.faceVertexUvs[0][11] = [cb[0], cb[1], cb[2]], leftLeg2Mesh = new THREE.Mesh(n, this.material2), leftLeg2Mesh.name = leftLeg2, leftLeg2Mesh.position.y = -22, leftLeg2Mesh.position.x = 2, this.scene.add(leftLeg2Mesh), this.rendered = new THREE.WebGLRenderer({
- alpha: !0
- }), this.rendered.setSize(this.width, this.height), this.rendered.setClearColor(this.backgroundColor)
- }, this.createCloak = function(a) {
- this.cloakTexture = new THREE.ImageUtils.loadTexture(a), this.cloakTexture.magFilter = THREE.NearestFilter, this.cloakTexture.minFilter = THREE.NearestMipMapNearestFilter;
- var b = new THREE.BoxGeometry(10, 16, 1, 0, 0, 0),
- d = this;
- this.cloakTexture.image.onload = function() {
- var a = 22,
- c = 17,
- g = 0;
- 22 == d.cloakTexture.image.width && 17 == d.cloakTexture.image.height || (a = 64, c = 32, g = 15 / c);
- var h = [new THREE.Vector2(0, g), new THREE.Vector2(1 / a, g), new THREE.Vector2(1 / a, 16 / c + g), new THREE.Vector2(0, 16 / c + g)],
- G = [new THREE.Vector2(1 / a + 10 / a, g), new THREE.Vector2(2 / a + 10 / a, g), new THREE.Vector2(2 / a + 10 / a, 16 / c + g), new THREE.Vector2(1 / a + 10 / a, 16 / c + g)],
- cf = [new THREE.Vector2(1 / a, 16 / c + g), new THREE.Vector2(1 / a + 10 / a, 16 / c + g), new THREE.Vector2(1 / a + 10 / a, 17 / c + g), new THREE.Vector2(1 / a, 17 / c + g)],
- U = [new THREE.Vector2(1 / a + 10 / a, 16 / c + g), new THREE.Vector2(21 / a, 16 / c + g), new THREE.Vector2(21 / a, 17 / c + g), new THREE.Vector2(1 / a + 10 / a, 17 / c + g)],
- bJ = [new THREE.Vector2(2 / a + 10 / a, g), new THREE.Vector2(22 / a, g), new THREE.Vector2(22 / a, 16 / c + g), new THREE.Vector2(2 / a + 10 / a, 16 / c + g)],
- A = [new THREE.Vector2(1 / a, g), new THREE.Vector2(1 / a + 10 / a, g), new THREE.Vector2(1 / a + 10 / a, 16 / c + g), new THREE.Vector2(1 / a, 16 / c + g)];
- b.faceVertexUvs[0] = [], b.faceVertexUvs[0][0] = [h[3], h[0], h[2]], b.faceVertexUvs[0][1] = [h[0], h[1], h[2]], b.faceVertexUvs[0][2] = [G[3], G[0], G[2]], b.faceVertexUvs[0][3] = [G[0], G[1], G[2]], b.faceVertexUvs[0][4] = [cf[3], cf[0], cf[2]], b.faceVertexUvs[0][5] = [cf[0], cf[1], cf[2]], b.faceVertexUvs[0][6] = [U[3], U[0], U[2]], b.faceVertexUvs[0][7] = [U[0], U[1], U[2]], b.faceVertexUvs[0][8] = [bJ[3], bJ[0], bJ[2]], b.faceVertexUvs[0][9] = [bJ[0], bJ[1], bJ[2]], b.faceVertexUvs[0][10] = [A[3], A[0], A[2]], b.faceVertexUvs[0][11] = [A[0], A[1], A[2]], cloakMesh = new THREE.Mesh(b, new THREE.MeshBasicMaterial({
- map: d.cloakTexture,
- transparent: !0,
- side: THREE.FrontSide
- })), cloakMesh.name = cloak, cloakMesh.position.y = -4.5, cloakMesh.position.z = -2.5, cloakMesh.translateY(-7.5), d.scene.add(cloakMesh)
- }, this.cloakTexture.image.onerror = function() {
- d.cloakTexture = null
- }
- }, this.removeCloak = function() {
- return this.IsCloak() ? (this.scene.remove(cloakMesh), this.cloakTexture.image = null, this.cloakTexture = null, void(((cloakMesh = null)))) : !1
- }, this.IsCloak = function() {
- return null != cloakMesh
- }, this.skin2D = {
- complete: function(a, b) {
- this.that = b, this.k = this.that.img.width / 64, this.Convert6432To6464(a), this.FixNonVisible(a), this.FixOverlay(a)
- },
- FixOverlay: function(a) {
- this.FixHead2(a), this.FixBody2(a), this.FixRightArm2(a), this.FixLeftArm2(a), this.FixRightLeg2(a), this.FixLeftLeg2(a)
- },
- FixHead2: function(a) {
- this.HasTransparency(a, 40, 8, 8, 8) || this.HasTransparency(a, 40, 0, 8, 8) || this.HasTransparency(a, 48, 0, 8, 8) || this.HasTransparency(a, 32, 8, 8, 8) || this.HasTransparency(a, 48, 8, 8, 8) || this.HasTransparency(a, 56, 8, 8, 8) || (a.clearRect(40, 0, 8, 8), a.clearRect(48, 0, 8, 8), a.clearRect(32, 8, 8, 8), a.clearRect(40, 8, 8, 8), a.clearRect(48, 8, 8, 8), a.clearRect(56, 8, 8, 8))
- },
- FixBody2: function(a) {
- this.HasTransparency(a, 20, 36, 8, 12) || this.HasTransparency(a, 20, 32, 8, 4) || this.HasTransparency(a, 28, 32, 8, 4) || this.HasTransparency(a, 16, 36, 4, 12) || this.HasTransparency(a, 28, 36, 4, 12) || this.HasTransparency(a, 32, 36, 8, 12) || (a.clearRect(20, 32, 8, 4), a.clearRect(28, 32, 8, 4), a.clearRect(16, 36, 4, 12), a.clearRect(20, 36, 8, 12), a.clearRect(28, 36, 4, 12), a.clearRect(32, 36, 8, 12))
- },
- FixRightArm2: function(a) {
- this.HasTransparency(a, 44, 36, 4, 12) || this.HasTransparency(a, 44, 32, 4, 4) || this.HasTransparency(a, 48, 32, 4, 4) || this.HasTransparency(a, 40, 36, 4, 12) || this.HasTransparency(a, 48, 36, 4, 12) || this.HasTransparency(a, 52, 36, 4, 12) || (a.clearRect(44, 32, 4, 4), a.clearRect(48, 32, 4, 4), a.clearRect(40, 36, 4, 12), a.clearRect(44, 36, 4, 12), a.clearRect(48, 36, 4, 12), a.clearRect(52, 36, 4, 12))
- },
- FixLeftArm2: function(a) {
- this.HasTransparency(a, 52, 52, 4, 12) || this.HasTransparency(a, 52, 48, 4, 4) || this.HasTransparency(a, 56, 48, 4, 4) || this.HasTransparency(a, 48, 52, 4, 12) || this.HasTransparency(a, 56, 52, 4, 12) || this.HasTransparency(a, 60, 52, 4, 12) || (a.clearRect(52, 48, 4, 4), a.clearRect(56, 48, 4, 4), a.clearRect(48, 52, 4, 12), a.clearRect(52, 52, 4, 12), a.clearRect(56, 52, 4, 12), a.clearRect(60, 52, 4, 12))
- },
- FixRightLeg2: function(a) {
- this.HasTransparency(a, 4, 36, 4, 12) || this.HasTransparency(a, 4, 32, 4, 4) || this.HasTransparency(a, 8, 32, 4, 4) || this.HasTransparency(a, 0, 36, 4, 12) || this.HasTransparency(a, 8, 36, 4, 12) || this.HasTransparency(a, 12, 36, 4, 12) || (a.clearRect(4, 32, 4, 4), a.clearRect(8, 32, 4, 4), a.clearRect(0, 36, 4, 12), a.clearRect(4, 36, 4, 12), a.clearRect(8, 36, 4, 12), a.clearRect(12, 36, 4, 12))
- },
- FixLeftLeg2: function(a) {
- this.HasTransparency(a, 4, 52, 4, 12) || this.HasTransparency(a, 4, 48, 4, 4) || this.HasTransparency(a, 8, 48, 4, 4) || this.HasTransparency(a, 0, 52, 4, 12) || this.HasTransparency(a, 8, 52, 4, 12) || this.HasTransparency(a, 12, 52, 4, 12) || (a.clearRect(4, 48, 4, 4), a.clearRect(8, 48, 4, 4), a.clearRect(0, 52, 4, 12), a.clearRect(4, 52, 4, 12), a.clearRect(8, 52, 4, 12), a.clearRect(12, 52, 4, 12))
- },
- Convert6432To6464: function(a) {
- this.Copy(a, 4, 16, 4, 4, 20, 48, !0), this.Copy(a, 8, 16, 4, 4, 24, 48, !0), this.Copy(a, 0, 20, 4, 12, 24, 52, !0), this.Copy(a, 4, 20, 4, 12, 20, 52, !0), this.Copy(a, 8, 20, 4, 12, 16, 52, !0), this.Copy(a, 12, 20, 4, 12, 28, 52, !0), this.Copy(a, 44, 16, 4, 4, 36, 48, !0), this.Copy(a, 48, 16, 4, 4, 40, 48, !0), this.Copy(a, 40, 20, 4, 12, 40, 52, !0), this.Copy(a, 44, 20, 4, 12, 36, 52, !0), this.Copy(a, 48, 20, 4, 12, 32, 52, !0), this.Copy(a, 52, 20, 4, 12, 44, 52, !0)
- },
- FixNonVisible: function(a) {
- a.clearRect(0, 0, 8, 8), a.clearRect(24, 0, 16, 8), a.clearRect(56, 0, 8, 8), a.clearRect(0, 16, 4, 4), a.clearRect(12, 16, 8, 4), a.clearRect(36, 16, 8, 4), a.clearRect(52, 16, 4, 4), a.clearRect(56, 16, 8, 32), a.clearRect(0, 32, 4, 4), a.clearRect(12, 32, 8, 4), a.clearRect(36, 32, 8, 4), a.clearRect(52, 32, 4, 4), a.clearRect(0, 48, 4, 4), a.clearRect(12, 48, 8, 4), a.clearRect(28, 48, 8, 4), a.clearRect(44, 48, 8, 4), a.clearRect(60, 48, 8, 4)
- },
- HasTransparency: function(a, b, d, $, g) {
- b *= this.k, d *= this.k, $ *= this.k, g *= this.k;
- var h = a.getImageData(b, d, $, g);
- for (d = 0; g > d; d++) {
- for (b = 0; $ > b; b++) {
- var G = 4 * (b + d * $);
- if (0 == h.data[G + 3]) {
- return !0
- }
- }
- };
- return !1
- },
- Copy: function(a, b, d, $, g, h, G, cf) {
- b *= this.k, d *= this.k, $ *= this.k, g *= this.k, h *= this.k, G *= this.k;
- var U = a.getImageData(b, d, $, g);
- if (cf) {
- for (y = 0; y < g; y++) {
- for (x = 0; x < $ / 2; x++) {
- index = 4 * (x + y * $), index2 = 4 * ($ - x - 1 + y * $);
- var bJ = U.data[index],
- A = U.data[index + 1],
- D = U.data[index + 2],
- k = U.data[index + 3],
- H = U.data[index2],
- O = U.data[index2 + 1],
- W = U.data[index2 + 2],
- z = U.data[index2 + 3];
- U.data[index] = H, U.data[index + 1] = O, U.data[index + 2] = W, U.data[index + 3] = z, U.data[index2] = bJ, U.data[index2 + 1] = A, U.data[index2 + 2] = D, U.data[index2 + 3] = k
- }
- }
- };
- a.putImageData(U, h, G)
- }
- }, this.MouseCoords = {
- getX: function(a) {
- return a.pageX ? a.pageX - (document.documentElement.scrollLeft || document.body.scrollLeft) : a.clientX ? a.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft : 0
- },
- getY: function(a) {
- return a.pageY ? a.pageY - (document.documentElement.scrollTop || document.body.scrollTop) : a.clientY ? a.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop : 0
- }
- }, this.write = function(a) {
- console.log("3D skin viewer: " + a)
- }, this.GetCTX = function(a) {
- if (null == a) {
- return !1
- };
- for (var b = [2d, webgl, experimental-webgl, webkit-3d, moz-webgl], d = null, c = 0; c < b.length; ++c) {
- try {
- d = a.getContext(b[c])
- } catch (e) {};
- if (d) {
- break
- }
- };
- return null == d ? !1 : d
- }, this.loadFail = function(a) {
- this.write("do not work 3D skin viewer. Use the 2D. Error code " + a)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement