Skip to content

Commit

Permalink
fix: blending
Browse files Browse the repository at this point in the history
  • Loading branch information
leaftail1880 committed Oct 30, 2024
1 parent 41ea7be commit f4c7165
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/world-edit/utils/blending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ export function skipForBlending(
const distance = ~~Vector.distance(vector, center)

if (blending === 0) {
// Circle
// Outside of circle, skip
if (distance > radius) return true
} else {
// Blending
if (blending < radius) {
const toBlend = radius - blending
if (radius < toBlend) {
const vectorId = Vector.string(vector)
if (blendStorage.has(vectorId)) return true

const blendingFactor = 1 + factor * 0.01
if (Math.randomInt(radius - blending, radius) < distance * blendingFactor) {
if (Math.randomInt(toBlend, radius) < distance * blendingFactor) {
blendStorage.add(vectorId)
return true
}
Expand Down

0 comments on commit f4c7165

Please sign in to comment.