Java Code Examples for org.lwjgl.util.vector.Vector3f#getX()

The following examples show how to use org.lwjgl.util.vector.Vector3f#getX() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ParametricEmitter.java    From tribaltrouble with GNU General Public License v2.0 6 votes vote down vote up
protected int initParticle(ParametricFunction function, float velocity_u, float velocity_v, Vector4f color, Vector4f delta_color, Vector3f particle_radius, Vector3f growth_rate, float energy) {

		Vector3f offset = randomOffset(area_xy, area_xy, area_z);
		ParametricParticle particle = new ParametricParticle(function, random.nextFloat()*(float)StrictMath.PI*2f, random.nextFloat()*(float)StrictMath.PI*2f,
				offset.getX(), offset.getY(), offset.getZ());
		offset = randomOffset(velocity_random_margin, velocity_random_margin, 0f);
		particle.setVelocity(velocity_u + offset.getX(), velocity_v + offset.getY());
		particle.setColor(color.getX(), color.getY(), color.getZ(), color.getW());
		particle.setDeltaColor(delta_color.getX(), delta_color.getY(), delta_color.getZ(), delta_color.getW());
		particle.setRadius(particle_radius.getX(), particle_radius.getY(), particle_radius.getZ());
		particle.setGrowthRate(growth_rate.getX(), growth_rate.getY(), growth_rate.getZ());
		particle.setEnergy(energy);
		particle.setType(random.nextInt(getTypes()));
		particle.update(0);
		add(particle);
		return 1;
	}
 
Example 2
Source File: RandomAccelerationEmitter.java    From tribaltrouble with GNU General Public License v2.0 5 votes vote down vote up
private RandomAccelerationEmitter(World world, Vector3f position, float offset_z,
			   float emitter_radius, float emitter_height, float angle_bound, float angle_max_jump,
			   int num_particles, float particles_per_second,
			   Vector3f velocity, Vector3f acceleration, float acceleration_factor,
			   Vector4f color, Vector4f delta_color,
			   Vector3f particle_radius, Vector3f growth_rate, float energy, float friction,
			   int src_blend_func, int dst_blend_func,
			   TextureKey[] textures, SpriteKey[] sprite_renderers, int types,
			   AnimationManager manager) {
	super(world, position,
			offset_z,
			emitter_radius,
			emitter_height,
			num_particles,
			particles_per_second,
			velocity,
			acceleration,
			color,
			delta_color,
			particle_radius,
			growth_rate,
			energy,
			friction,
			src_blend_func,
			dst_blend_func,
			textures,
			sprite_renderers,
			types,
			manager);
	this.random = world.getRandom();
	this.acceleration = acceleration;
	offset_acceleration = new Vector3f(acceleration.getX(), acceleration.getY(), acceleration.getZ());
	this.angle_bound = angle_bound;
	this.angle_max_jump = angle_max_jump;
	this.acceleration_factor = acceleration_factor;
}
 
Example 3
Source File: LinearEmitter.java    From tribaltrouble with GNU General Public License v2.0 5 votes vote down vote up
protected LinearEmitter(World world, Vector3f position, float offset_z,
			   float emitter_radius, float emitter_height,
			   int num_particles, float particles_per_second,
			   Vector3f velocity, Vector3f acceleration,
			   Vector4f color, Vector4f delta_color,
			   Vector3f particle_radius, Vector3f growth_rate, float energy, float friction,
			   int src_blend_func, int dst_blend_func,
			   TextureKey[] textures, SpriteKey[] sprite_renderers, int types,
			   AnimationManager manager) {
	super(world, position, src_blend_func, dst_blend_func, textures, sprite_renderers, types, manager);
	this.offset_z = offset_z;
	this.emitter_radius = emitter_radius;
	this.emitter_height = emitter_height;
	this.num_particles = num_particles;
	this.particles_per_second = particles_per_second;
	this.velocity = velocity;
	this.acceleration = acceleration;
	this.color = color;
	this.delta_color = delta_color;
	this.particle_radius = particle_radius;
	this.growth_rate = growth_rate;
	this.energy = energy;
	this.friction = friction;
	random = new Random((long)(position.getX() * position.getY() * position.getZ()));
	position.setZ(position.getZ() + offset_z);

	register();
}
 
Example 4
Source File: RandomVelocityEmitter.java    From tribaltrouble with GNU General Public License v2.0 5 votes vote down vote up
private RandomVelocityEmitter(World world, Vector3f position, float offset_z, float uv_angle,
			   float emitter_radius, float emitter_height, float angle_bound, float angle_max_jump,
			   int num_particles, float particles_per_second,
			   Vector3f velocity, Vector3f acceleration,
			   Vector4f color, Vector4f delta_color,
			   Vector3f particle_radius, Vector3f growth_rate, float energy, float friction,
			   int src_blend_func, int dst_blend_func,
			   TextureKey[] textures, SpriteKey[] sprite_renderers, int types,
			   AnimationManager manager) {
	super(world, position,
			offset_z,
			emitter_radius,
			emitter_height,
			num_particles,
			particles_per_second,
			velocity,
			acceleration,
			color,
			delta_color,
			particle_radius,
			growth_rate,
			energy,
			friction,
			src_blend_func,
			dst_blend_func,
			textures,
			sprite_renderers,
			types,
			manager);
	this.random = world.getRandom();
	this.uv_angle = uv_angle;
	this.velocity = velocity;
	offset_velocity = new Vector3f(velocity.getX(), velocity.getY(), velocity.getZ());
	this.angle_bound = angle_bound;
	this.angle_max_jump = angle_max_jump;
}