34 lines
970 B
GDScript
34 lines
970 B
GDScript
class_name VehicleTestEnvironment
|
|
extends Node3D
|
|
|
|
|
|
func _ready() -> void:
|
|
var particles := GPUParticles3D.new()
|
|
particles.name = "SuspendedParticles"
|
|
particles.position = Vector3(0.0, -34.0, -42.0)
|
|
particles.amount = 360
|
|
particles.lifetime = 14.0
|
|
particles.preprocess = 14.0
|
|
particles.visibility_aabb = AABB(
|
|
Vector3(-50.0, -35.0, -78.0),
|
|
Vector3(100.0, 70.0, 156.0)
|
|
)
|
|
|
|
var motion := ParticleProcessMaterial.new()
|
|
motion.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_BOX
|
|
motion.emission_box_extents = Vector3(45.0, 28.0, 70.0)
|
|
motion.direction = Vector3(0.1, 0.04, 0.0)
|
|
motion.spread = 180.0
|
|
motion.initial_velocity_min = 0.02
|
|
motion.initial_velocity_max = 0.09
|
|
motion.gravity = Vector3.ZERO
|
|
motion.scale_min = 0.025
|
|
motion.scale_max = 0.08
|
|
particles.process_material = motion
|
|
|
|
var particle_mesh := SphereMesh.new()
|
|
particle_mesh.radius = 0.035
|
|
particle_mesh.height = 0.07
|
|
particles.draw_pass_1 = particle_mesh
|
|
add_child(particles)
|