Search in sources :

Example 1 with ParticleDataWithVelocity

use of io.xol.chunkstories.api.particles.ParticleDataWithVelocity in project chunkstories by Hugobros3.

the class ClientParticlesRenderer method spawnParticleAtPositionWithVelocity.

public void spawnParticleAtPositionWithVelocity(String particleTypeName, Vector3dc location, Vector3dc velocity) {
    ParticleTypeHandler particleType = store.getParticleType(particleTypeName);
    if (particleType == null || location == null)
        return;
    ParticleData particleData = particleType.createNew(world, (float) (double) location.x(), (float) (double) location.y(), (float) (double) location.z());
    if (velocity != null && particleData instanceof ParticleDataWithVelocity)
        ((ParticleDataWithVelocity) particleData).setVelocity(new Vector3f((float) velocity.x(), (float) velocity.y(), (float) velocity.z()));
    addParticle(particleType, particleData);
}
Also used : ParticleData(io.xol.chunkstories.api.particles.ParticleTypeHandler.ParticleData) ParticleDataWithVelocity(io.xol.chunkstories.api.particles.ParticleDataWithVelocity) ParticleTypeHandler(io.xol.chunkstories.api.particles.ParticleTypeHandler) Vector3f(org.joml.Vector3f)

Aggregations

ParticleDataWithVelocity (io.xol.chunkstories.api.particles.ParticleDataWithVelocity)1 ParticleTypeHandler (io.xol.chunkstories.api.particles.ParticleTypeHandler)1 ParticleData (io.xol.chunkstories.api.particles.ParticleTypeHandler.ParticleData)1 Vector3f (org.joml.Vector3f)1