mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Fix GPUParticles3D generate AABB
This commit is contained in:
		
							parent
							
								
									46cc0af5c5
								
							
						
					
					
						commit
						dd70daafba
					
				
					 2 changed files with 2 additions and 5 deletions
				
			
		|  | @ -4352,10 +4352,8 @@ AABB RendererStorageRD::particles_get_current_aabb(RID p_particles) { | |||
| 		total_amount *= particles->trail_bind_poses.size(); | ||||
| 	} | ||||
| 
 | ||||
| 	Vector<ParticleData> data; | ||||
| 	data.resize(total_amount); | ||||
| 
 | ||||
| 	Vector<uint8_t> buffer = RD::get_singleton()->buffer_get_data(particles->particle_buffer); | ||||
| 	ERR_FAIL_COND_V(buffer.size() != (int)(total_amount * sizeof(ParticleData)), AABB()); | ||||
| 
 | ||||
| 	Transform3D inv = particles->emission_transform.affine_inverse(); | ||||
| 
 | ||||
|  | @ -4363,7 +4361,7 @@ AABB RendererStorageRD::particles_get_current_aabb(RID p_particles) { | |||
| 	if (buffer.size()) { | ||||
| 		bool first = true; | ||||
| 
 | ||||
| 		const ParticleData *particle_data = (const ParticleData *)data.ptr(); | ||||
| 		const ParticleData *particle_data = reinterpret_cast<const ParticleData *>(buffer.ptr()); | ||||
| 		for (int i = 0; i < total_amount; i++) { | ||||
| 			if (particle_data[i].active) { | ||||
| 				Vector3 pos = Vector3(particle_data[i].xform[12], particle_data[i].xform[13], particle_data[i].xform[14]); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 CaptainProton42
						CaptainProton42