chunk.gd 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. extends Spatial
  2. # Declare member variables here. Examples:
  3. # var a = 2
  4. # var b = "text"
  5. var latMin:float = 0
  6. var latMax:float = 1
  7. var lonMin:float = 0.0
  8. var lonMax:float = 1.0
  9. var resolution:int = 512
  10. var radius:float = 10
  11. var scaleFact:int = 1
  12. var origin:Vector3
  13. var center:Vector3
  14. var initialized = false
  15. func setParams(latMinIN, latMaxIN, lonMinIN, lonMaxIN, resolutionIN, radiusIN:float, scaleFactIN):
  16. latMin = latMinIN
  17. latMax = latMaxIN
  18. lonMin = lonMinIN
  19. lonMax = lonMaxIN
  20. resolution = resolutionIN
  21. radius = radiusIN
  22. scaleFact = scaleFactIN
  23. # Called when the node enters the scene tree for the first time.
  24. func _ready():
  25. initialize()
  26. #.translate(.get_node("Mesh").origin)
  27. func initialize():
  28. print("chunk %s,%s initializing" %[latMin, lonMin])
  29. yield(Messenger, "meshLoaded")
  30. .get_node("Origin").transform.origin = .get_node("Mesh").origin
  31. .get_node("Center").transform.origin = .get_node("Mesh").center
  32. print("chunk %s,%s ready" %[latMin, lonMin])
  33. # Called every frame. 'delta' is the elapsed time since the previous frame.
  34. #func _process(delta):
  35. # pass