Add leaves particle concept

This commit is contained in:
austin 2021-10-15 17:43:33 -04:00
parent f7309d4f15
commit 50efed4b69
5 changed files with 11 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

View File

@ -24,6 +24,7 @@ import electrosphere.entity.types.structure.StructureUtils;
import electrosphere.game.collision.PhysicsUtils;
import electrosphere.game.collision.collidable.Collidable;
import electrosphere.game.server.ai.creature.MindlessAttacker;
import electrosphere.game.server.effects.ParticleEffects;
import electrosphere.game.server.terrain.models.TerrainModification;
import electrosphere.game.server.town.Town;
import electrosphere.game.server.world.datacell.DataCellManager;
@ -561,6 +562,11 @@ public class LoadingThread extends Thread {
Entity fallOak = FoliageUtils.spawnBasicFoliage("FallOak1");
EntityUtils.getPosition(fallOak).set(1,0,3);
Entity spark = ParticleUtils.spawnBillboardParticle("Textures/animetree1leaves1.png", 150000, new Vector3f(0,0,0), 0, 0);
EntityUtils.getPosition(spark).set(new Vector3f(3,3,3));
EntityUtils.getScale(spark).mul(1f);
// CollisionObjUtils.positionCharacter(fallOak, new Vector3f(1, 0, 3));
//
//

View File

@ -49,6 +49,9 @@ public class FoliageUtils {
break;
case "BLENDER_ROTATION":
ActorUtils.applyBlenderRotation(rVal);
break;
case "PARTICLE_SPAWNER":
break;
}
}

View File

@ -20,7 +20,7 @@ public class ParticleUtils {
public static Entity spawnParticle(String texture, int maxLife, Vector3f destination, float velocity, float acceleration){
public static Entity spawnBillboardParticle(String texture, int maxLife, Vector3f destination, float velocity, float acceleration){
Entity rVal = EntityUtils.spawnDrawableEntity(Globals.particleBillboardModel);
EntityUtils.getActor(rVal).setTextureOverride(texture);
Globals.assetManager.addTexturePathtoQueue(texture);

View File

@ -20,7 +20,7 @@ public class ParticleEffects {
Vector3f direction = new Vector3f(rand.nextFloat() - 0.5f,rand.nextFloat() - 0.5f,rand.nextFloat() - 0.5f).normalize();
float velocity = rand.nextFloat() * 0.01f;
float acceleration = 0.005f;
Entity spark = ParticleUtils.spawnParticle("Textures/spark1.png", 15, direction, velocity, acceleration);
Entity spark = ParticleUtils.spawnBillboardParticle("Textures/spark1.png", 15, direction, velocity, acceleration);
EntityUtils.getPosition(spark).set(position);
EntityUtils.getScale(spark).mul(0.03f);
}