Jump to content

Particle Move with Player View Port


Seimouun

Recommended Posts

Greetings everyone!

I want all of my particles to follow the player viewport and not be created in world space. I'm kinda new to Minecraft modding so i don't know if this would be a hard task to achieve.

All i have for now is a simple method that spawns particles in a helix infront of the player in world space.

Vector3d lookVector = player.getLookVec().normalize();
final double pitch = (player.getPitch(1) + 90.0F) * 0.017453292F;
final double yaw = -player.getYaw(1) * 0.017453292F;
double x = radius * Math.cos(tickCount / 3D);
double z = radius * Math.sin(tickCount / 3D);
Vector3d vec = new Vector3d(x, 0, z);
vec = Util.rotateAroundAxisX(vec, pitch);
vec = Util.rotateAroundAxisY(vec, yaw);
player.world.addParticle(ParticleTypes.FLAME, player.getPosX() + vec.getX() + lookVector.getX(), player.getPosY() + vec.getY() + lookVector.getY() + player.getEyeHeight(), player.getPosZ() + vec.getZ() + lookVector.getZ(), 0, 0, 0);

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.