clouds parallax and can drift in 3D

This commit is contained in:
minjaesong
2023-08-22 09:48:38 +09:00
parent da8d620766
commit 0a8b5f33f4
5 changed files with 42 additions and 7 deletions

View File

@@ -33,9 +33,8 @@ class WeatherObjectCloud(private val texture: TextureRegion, private val flipW:
* Resulting vector: (x + dX, y + dY, scale * dScale)
*/
fun update(flowVector: Vector3, gait: Float) {
posX += flowVector.x * gait * scale
posY += flowVector.y * gait * scale
scale *= flowVector.z
val vecMult = Vector3(1f, 1f, 1f / (2f * App.scr.hf * 0.35f))
pos.add(flowVector.cpy().scl(vecMult).scl(gait))
}
/**