refactor: omit default parameters
This commit is contained in:
parent
48cb88e99c
commit
968966313e
26
src/model.ts
26
src/model.ts
|
@ -81,7 +81,7 @@ export class SkinObject extends Group {
|
||||||
layer2MaterialBiased.polygonOffsetUnits = 1.0;
|
layer2MaterialBiased.polygonOffsetUnits = 1.0;
|
||||||
|
|
||||||
// Head
|
// Head
|
||||||
const headBox = new BoxGeometry(8, 8, 8, 1, 1, 1);
|
const headBox = new BoxGeometry(8, 8, 8);
|
||||||
setVertices(headBox,
|
setVertices(headBox,
|
||||||
toSkinVertices(8, 0, 16, 8),
|
toSkinVertices(8, 0, 16, 8),
|
||||||
toSkinVertices(16, 0, 24, 8),
|
toSkinVertices(16, 0, 24, 8),
|
||||||
|
@ -92,7 +92,7 @@ export class SkinObject extends Group {
|
||||||
);
|
);
|
||||||
const headMesh = new Mesh(headBox, layer1Material);
|
const headMesh = new Mesh(headBox, layer1Material);
|
||||||
|
|
||||||
const head2Box = new BoxGeometry(9, 9, 9, 1, 1, 1);
|
const head2Box = new BoxGeometry(9, 9, 9);
|
||||||
setVertices(head2Box,
|
setVertices(head2Box,
|
||||||
toSkinVertices(40, 0, 48, 8),
|
toSkinVertices(40, 0, 48, 8),
|
||||||
toSkinVertices(48, 0, 56, 8),
|
toSkinVertices(48, 0, 56, 8),
|
||||||
|
@ -110,7 +110,7 @@ export class SkinObject extends Group {
|
||||||
this.add(this.head);
|
this.add(this.head);
|
||||||
|
|
||||||
// Body
|
// Body
|
||||||
const bodyBox = new BoxGeometry(8, 12, 4, 1, 1, 1);
|
const bodyBox = new BoxGeometry(8, 12, 4);
|
||||||
setVertices(bodyBox,
|
setVertices(bodyBox,
|
||||||
toSkinVertices(20, 16, 28, 20),
|
toSkinVertices(20, 16, 28, 20),
|
||||||
toSkinVertices(28, 16, 36, 20),
|
toSkinVertices(28, 16, 36, 20),
|
||||||
|
@ -121,7 +121,7 @@ export class SkinObject extends Group {
|
||||||
);
|
);
|
||||||
const bodyMesh = new Mesh(bodyBox, layer1Material);
|
const bodyMesh = new Mesh(bodyBox, layer1Material);
|
||||||
|
|
||||||
const body2Box = new BoxGeometry(9, 13.5, 4.5, 1, 1, 1);
|
const body2Box = new BoxGeometry(9, 13.5, 4.5);
|
||||||
setVertices(body2Box,
|
setVertices(body2Box,
|
||||||
toSkinVertices(20, 32, 28, 36),
|
toSkinVertices(20, 32, 28, 36),
|
||||||
toSkinVertices(28, 32, 36, 36),
|
toSkinVertices(28, 32, 36, 36),
|
||||||
|
@ -139,7 +139,7 @@ export class SkinObject extends Group {
|
||||||
this.add(this.body);
|
this.add(this.body);
|
||||||
|
|
||||||
// Right Arm
|
// Right Arm
|
||||||
const rightArmBox = new BoxGeometry(1, 1, 1, 1, 1, 1); // w/d/h is model-related
|
const rightArmBox = new BoxGeometry();
|
||||||
const rightArmMesh = new Mesh(rightArmBox, layer1Material);
|
const rightArmMesh = new Mesh(rightArmBox, layer1Material);
|
||||||
this.modelListeners.push(() => {
|
this.modelListeners.push(() => {
|
||||||
rightArmMesh.scale.x = this.slim ? 3 : 4;
|
rightArmMesh.scale.x = this.slim ? 3 : 4;
|
||||||
|
@ -168,7 +168,7 @@ export class SkinObject extends Group {
|
||||||
rightArmBox.elementsNeedUpdate = true;
|
rightArmBox.elementsNeedUpdate = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const rightArm2Box = new BoxGeometry(1, 1, 1, 1, 1, 1); // w/d/h is model-related
|
const rightArm2Box = new BoxGeometry();
|
||||||
const rightArm2Mesh = new Mesh(rightArm2Box, layer2MaterialBiased);
|
const rightArm2Mesh = new Mesh(rightArm2Box, layer2MaterialBiased);
|
||||||
rightArm2Mesh.renderOrder = 1;
|
rightArm2Mesh.renderOrder = 1;
|
||||||
this.modelListeners.push(() => {
|
this.modelListeners.push(() => {
|
||||||
|
@ -212,7 +212,7 @@ export class SkinObject extends Group {
|
||||||
this.add(this.rightArm);
|
this.add(this.rightArm);
|
||||||
|
|
||||||
// Left Arm
|
// Left Arm
|
||||||
const leftArmBox = new BoxGeometry(1, 1, 1, 1, 1, 1); // w/d/h is model-related
|
const leftArmBox = new BoxGeometry();
|
||||||
const leftArmMesh = new Mesh(leftArmBox, layer1Material);
|
const leftArmMesh = new Mesh(leftArmBox, layer1Material);
|
||||||
this.modelListeners.push(() => {
|
this.modelListeners.push(() => {
|
||||||
leftArmMesh.scale.x = this.slim ? 3 : 4;
|
leftArmMesh.scale.x = this.slim ? 3 : 4;
|
||||||
|
@ -241,7 +241,7 @@ export class SkinObject extends Group {
|
||||||
leftArmBox.elementsNeedUpdate = true;
|
leftArmBox.elementsNeedUpdate = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const leftArm2Box = new BoxGeometry(1, 1, 1, 1, 1, 1); // w/d/h is model-related
|
const leftArm2Box = new BoxGeometry();
|
||||||
const leftArm2Mesh = new Mesh(leftArm2Box, layer2MaterialBiased);
|
const leftArm2Mesh = new Mesh(leftArm2Box, layer2MaterialBiased);
|
||||||
leftArm2Mesh.renderOrder = 1;
|
leftArm2Mesh.renderOrder = 1;
|
||||||
this.modelListeners.push(() => {
|
this.modelListeners.push(() => {
|
||||||
|
@ -285,7 +285,7 @@ export class SkinObject extends Group {
|
||||||
this.add(this.leftArm);
|
this.add(this.leftArm);
|
||||||
|
|
||||||
// Right Leg
|
// Right Leg
|
||||||
const rightLegBox = new BoxGeometry(4, 12, 4, 1, 1, 1);
|
const rightLegBox = new BoxGeometry(4, 12, 4);
|
||||||
setVertices(rightLegBox,
|
setVertices(rightLegBox,
|
||||||
toSkinVertices(4, 16, 8, 20),
|
toSkinVertices(4, 16, 8, 20),
|
||||||
toSkinVertices(8, 16, 12, 20),
|
toSkinVertices(8, 16, 12, 20),
|
||||||
|
@ -296,7 +296,7 @@ export class SkinObject extends Group {
|
||||||
);
|
);
|
||||||
const rightLegMesh = new Mesh(rightLegBox, layer1Material);
|
const rightLegMesh = new Mesh(rightLegBox, layer1Material);
|
||||||
|
|
||||||
const rightLeg2Box = new BoxGeometry(4.5, 13.5, 4.5, 1, 1, 1);
|
const rightLeg2Box = new BoxGeometry(4.5, 13.5, 4.5);
|
||||||
setVertices(rightLeg2Box,
|
setVertices(rightLeg2Box,
|
||||||
toSkinVertices(4, 32, 8, 36),
|
toSkinVertices(4, 32, 8, 36),
|
||||||
toSkinVertices(8, 32, 12, 36),
|
toSkinVertices(8, 32, 12, 36),
|
||||||
|
@ -320,7 +320,7 @@ export class SkinObject extends Group {
|
||||||
this.add(this.rightLeg);
|
this.add(this.rightLeg);
|
||||||
|
|
||||||
// Left Leg
|
// Left Leg
|
||||||
const leftLegBox = new BoxGeometry(4, 12, 4, 1, 1, 1);
|
const leftLegBox = new BoxGeometry(4, 12, 4);
|
||||||
setVertices(leftLegBox,
|
setVertices(leftLegBox,
|
||||||
toSkinVertices(20, 48, 24, 52),
|
toSkinVertices(20, 48, 24, 52),
|
||||||
toSkinVertices(24, 48, 28, 52),
|
toSkinVertices(24, 48, 28, 52),
|
||||||
|
@ -331,7 +331,7 @@ export class SkinObject extends Group {
|
||||||
);
|
);
|
||||||
const leftLegMesh = new Mesh(leftLegBox, layer1Material);
|
const leftLegMesh = new Mesh(leftLegBox, layer1Material);
|
||||||
|
|
||||||
const leftLeg2Box = new BoxGeometry(4.5, 13.5, 4.5, 1, 1, 1);
|
const leftLeg2Box = new BoxGeometry(4.5, 13.5, 4.5);
|
||||||
setVertices(leftLeg2Box,
|
setVertices(leftLeg2Box,
|
||||||
toSkinVertices(4, 48, 8, 52),
|
toSkinVertices(4, 48, 8, 52),
|
||||||
toSkinVertices(8, 48, 12, 52),
|
toSkinVertices(8, 48, 12, 52),
|
||||||
|
@ -395,7 +395,7 @@ export class CapeObject extends Group {
|
||||||
|
|
||||||
// back = outside
|
// back = outside
|
||||||
// front = inside
|
// front = inside
|
||||||
const capeBox = new BoxGeometry(10, 16, 1, 1, 1, 1);
|
const capeBox = new BoxGeometry(10, 16, 1);
|
||||||
setVertices(capeBox,
|
setVertices(capeBox,
|
||||||
toCapeVertices(1, 0, 11, 1),
|
toCapeVertices(1, 0, 11, 1),
|
||||||
toCapeVertices(11, 0, 21, 1),
|
toCapeVertices(11, 0, 21, 1),
|
||||||
|
|
Loading…
Reference in New Issue