asdf state

This commit is contained in:
Evert Prants 2024-02-22 22:13:13 +02:00
parent 7060e9a397
commit 0a06d7970d
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 7 additions and 4 deletions

View File

@ -36,8 +36,8 @@ export class ThreeBuilder {
static planeFaceNormals: Record<MsonFace, Vector3> = {
up: new Vector3(0, 1, 0),
down: new Vector3(0, -1, 0),
east: new Vector3(1, 0, 0),
west: new Vector3(-1, 0, 0),
east: new Vector3(-1, 0, 0),
west: new Vector3(1, 0, 0),
south: new Vector3(0, 0, 1),
north: new Vector3(0, 0, -1),
};
@ -317,7 +317,7 @@ export class ThreeBuilder {
);
planeGeom.lookAt(axisNormal);
planeGeom.translate(
adjustedTranslate.x,
-adjustedTranslate.x,
adjustedTranslate.y,
adjustedTranslate.z,
);
@ -430,7 +430,7 @@ export class ThreeBuilder {
if (component?.rotate) {
rotate.fromArray(
(component.rotate as Vec3).map((entry, index) =>
MathUtils.degToRad(index !== 1 ? entry * -1 : entry),
MathUtils.degToRad(index !== 2 ? entry * -1 : entry),
),
);
}
@ -440,6 +440,7 @@ export class ThreeBuilder {
if (component?.pivot) {
pos.fromArray(component.pivot as Vec3);
}
pos.setX(pos.x * -1);
pos.setY(pos.y * -1);
wrapper.position.copy(pos);
wrapper.updateMatrix();

View File

@ -244,6 +244,8 @@ export class UVMapper {
: [mirror, mirror]
: [false, false];
if (['up', 'down'].includes(face)) mirroring[0] = !mirroring[0];
for (let i = 0; i < index!.count; i += 3) {
const triIndex = Math.ceil((i / 6) % 1);
const sizeU = size[UVMapper.planeWidthSide[face]];