Implement playable Mac client and rendering validation
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
extends SceneTree
|
||||
const EffectPlayer = preload("res://fx/effect_player.gd")
|
||||
var failures := 0
|
||||
func check(ok: bool, label: String) -> void:
|
||||
if not ok:
|
||||
failures += 1
|
||||
printerr("FAIL: " + label)
|
||||
func _init() -> void:
|
||||
var effect := EffectPlayer.new()
|
||||
var rows := [[0, "MOVING_TYPE_DIRECT", 100, 200, 300], [1, "MOVING_TYPE_DIRECT", 200, 400, 600]]
|
||||
check(effect._position_at(rows, 0).is_equal_approx(Vector3(1, 3, -2)), "source Z goes up and Y goes south")
|
||||
check(effect._position_at(rows, 0.5).is_equal_approx(Vector3(1.5, 4.5, -3)), "movement interpolation uses converted vectors")
|
||||
effect.build({"particles": [{"position": rows, "emitter": {"EmittingDirection": [0, 0, 1], "EmitterShape": 1}}],
|
||||
"lights": [{"position": rows}]})
|
||||
var emitter: GPUParticles3D = effect._emitters[0]
|
||||
check(emitter.position.is_equal_approx(Vector3(1, 3, -2)), "particle spawn shares movement coordinates")
|
||||
check(effect._lights[0].position.is_equal_approx(emitter.position), "light and particle coordinates agree")
|
||||
check(emitter.process_material.direction.is_equal_approx(Vector3.UP), "source upwards emission is upwards")
|
||||
check(emitter.process_material.emission_box_extents.y < 0.01, "ellipse lies on ground plane")
|
||||
effect.free()
|
||||
print("effect_space_test: failures=%d" % failures)
|
||||
quit(1 if failures else 0)
|
||||
Reference in New Issue
Block a user