chunk.gd 1012 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. func setParams(latMinIN, latMaxIN, lonMinIN, lonMaxIN, resolutionIN, radiusIN:float, scaleFactIN):
  15. latMin = latMinIN
  16. latMax = latMaxIN
  17. lonMin = lonMinIN
  18. lonMax = lonMaxIN
  19. resolution = resolutionIN
  20. radius = radiusIN
  21. scaleFact = scaleFactIN
  22. # Called when the node enters the scene tree for the first time.
  23. func _ready():
  24. .get_node("Mesh").setParams(latMin, latMax, lonMin, lonMax, resolution, radius, scaleFact)
  25. .get_node("Mesh").genMesh()
  26. .get_node("Origin").transform.origin = .get_node("Mesh").origin
  27. .get_node("Center").transform.origin = .get_node("Mesh").center
  28. #.translate(.get_node("Mesh").origin)
  29. # Called every frame. 'delta' is the elapsed time since the previous frame.
  30. #func _process(delta):
  31. # pass