mirror of
https://github.com/LucasDower/ObjToSchematic.git
synced 2024-11-27 02:19:58 +08:00
Fix failing test
This commit is contained in:
parent
6c1325d8e6
commit
79a5dbf9ce
@ -87,12 +87,14 @@ export class VoxelMesh {
|
||||
const pos = inPos.copy().round();
|
||||
const voxel = this._voxels.get(pos.hash());
|
||||
|
||||
if (voxel !== undefined && this._voxelMeshParams.voxelOverlapRule === 'average') {
|
||||
voxel.colour.r = ((voxel.colour.r * voxel.collisions) + colour.r) / (voxel.collisions + 1);
|
||||
voxel.colour.g = ((voxel.colour.g * voxel.collisions) + colour.g) / (voxel.collisions + 1);
|
||||
voxel.colour.b = ((voxel.colour.b * voxel.collisions) + colour.b) / (voxel.collisions + 1);
|
||||
voxel.colour.a = ((voxel.colour.a * voxel.collisions) + colour.a) / (voxel.collisions + 1);
|
||||
++voxel.collisions;
|
||||
if (voxel !== undefined) {
|
||||
if (this._voxelMeshParams.voxelOverlapRule === 'average') {
|
||||
voxel.colour.r = ((voxel.colour.r * voxel.collisions) + colour.r) / (voxel.collisions + 1);
|
||||
voxel.colour.g = ((voxel.colour.g * voxel.collisions) + colour.g) / (voxel.collisions + 1);
|
||||
voxel.colour.b = ((voxel.colour.b * voxel.collisions) + colour.b) / (voxel.collisions + 1);
|
||||
voxel.colour.a = ((voxel.colour.a * voxel.collisions) + colour.a) / (voxel.collisions + 1);
|
||||
++voxel.collisions;
|
||||
}
|
||||
} else {
|
||||
this._voxels.set(pos.hash(), {
|
||||
position: pos,
|
||||
|
Loading…
Reference in New Issue
Block a user