updated TODOs, canceled cone & cylinder SDF :(
This commit is contained in:
@@ -34,20 +34,28 @@ import org.joml.Vector2f
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
// TODO:
|
// TODO: (future additions)
|
||||||
// Allowing the use of regular Minecraft particles instead of just BDEs.
|
// Allowing the use of regular Minecraft particles instead of just BDEs.
|
||||||
// not implementing in v1.0. Maybe in v2.0.
|
// not implementing in v1.0. Maybe in v2.0.
|
||||||
|
|
||||||
// Better command auto-completion. (and change names of args)
|
// Better command auto-completion. (and change names of args)
|
||||||
// force field "config" option
|
// force field "config" option
|
||||||
|
|
||||||
// Custom curve equation command args (parse from strings)
|
// Custom curve equation command args (parse from strings)
|
||||||
|
|
||||||
// Cylinder and cone force field shape.
|
// Cylinder and cone force field shape.
|
||||||
// Better particle performance.
|
// not implementing in v1.0. Maybe in v2.0.
|
||||||
|
|
||||||
// Emitter groups (multiple emitters for EmitterTool)
|
// Emitter groups (multiple emitters for EmitterTool)
|
||||||
|
|
||||||
// Private functions/classes
|
// Private functions/classes
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: (project)
|
||||||
|
// fix ManageEmitter command
|
||||||
|
// add SpawnEmitter command for spawning emitters via commands
|
||||||
|
|
||||||
|
|
||||||
var ALL_PARTICLE_EMITTERS: Array<ParticleEmitter> = emptyArray()
|
var ALL_PARTICLE_EMITTERS: Array<ParticleEmitter> = emptyArray()
|
||||||
var LIVING_PARTICLE_COUNT: Int = 0
|
var LIVING_PARTICLE_COUNT: Int = 0
|
||||||
val SESSION_UUID: UUID = UUID.randomUUID()
|
val SESSION_UUID: UUID = UUID.randomUUID()
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ class Particle(
|
|||||||
val sdfVal = sdfSphere(forceField.pos, shape.radius, pos)
|
val sdfVal = sdfSphere(forceField.pos, shape.radius, pos)
|
||||||
val normalizedSdf = normalizeSdf(sdfVal, shape.radius)
|
val normalizedSdf = normalizeSdf(sdfVal, shape.radius)
|
||||||
val velDir = Vector3f(pos).sub(forceField.pos).normalize()
|
val velDir = Vector3f(pos).sub(forceField.pos).normalize()
|
||||||
val velMul = if (sdfVal > 0) { 0.0f }
|
val velMul = if (sdfVal > 0) { 0.0f }
|
||||||
else { lerp(shape.force.second, shape.force.second, 1 - normalizedSdf) }
|
else { lerp(shape.force.second, shape.force.second, 1 - normalizedSdf) }
|
||||||
|
|
||||||
return velDir.mul(velMul)
|
return velDir.mul(velMul)
|
||||||
@@ -202,7 +202,6 @@ class Particle(
|
|||||||
|
|
||||||
return velDir
|
return velDir
|
||||||
}
|
}
|
||||||
// TODO: cone & cylinder SDF
|
|
||||||
|
|
||||||
|
|
||||||
private fun calcRot(t: Float) : Vector3f {
|
private fun calcRot(t: Float) : Vector3f {
|
||||||
|
|||||||
@@ -126,14 +126,4 @@ sealed class ForceFieldShape {
|
|||||||
val dir: Vector3f = Vector3f(0.0f, 1.0f, 0.0f),
|
val dir: Vector3f = Vector3f(0.0f, 1.0f, 0.0f),
|
||||||
val force: Float = 0.02f
|
val force: Float = 0.02f
|
||||||
) : ForceFieldShape()
|
) : ForceFieldShape()
|
||||||
data class Cone(
|
|
||||||
val size: Vector2f = Vector2f(1.0f, 1.0f),
|
|
||||||
val dir: Vector3f = Vector3f(0.0f, 1.0f, 0.0f),
|
|
||||||
val force: Pair<Float, Float> = Pair(0.0f, 0.02f)
|
|
||||||
)
|
|
||||||
data class Cylinder(
|
|
||||||
val size: Vector3f = Vector3f(1.0f, 1.0f, 1.0f),
|
|
||||||
val dir: Vector3f = Vector3f(0.0f, 1.0f, 0.0f),
|
|
||||||
val force: Float = 0.02f
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user