Skip to content

Commits from old repo and finished 2 TODOs #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
EffectLib - Manage your effects the nice way.
=========


You have no idea what a vector or matrix is, but you want to give your users some nice effects with particles? No problem. this library comes with a load of effects for you. It handles rotation, text-parsing, and creation of 3D objects with particles in Minecraft.

- Text-Parsing
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/de/slikey/effectlib/util/ParticleEffect.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,10 @@ public enum ParticleEffect {
BUBBLE_COLUMN_UP("bubble_column_up"),

/**
* TODO: Document me!
* A particle effect which is generated by conduits
* <ul>
* <li>It looks like a small blue orb with a brown center</li>
* </ul>
*/
NAUTILUS("nautilus"),

Expand Down
28 changes: 14 additions & 14 deletions src/main/java/de/slikey/effectlib/util/VectorUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ public static final Vector rotateAroundAxisZ(Vector v, double angle) {
}

public static final Vector rotateVector(Vector v, double angleX, double angleY, double angleZ) {
// double x = v.getX(), y = v.getY(), z = v.getZ();
// double cosX = Math.cos(angleX), sinX = Math.sin(angleX), cosY =
// Math.cos(angleY), sinY = Math.sin(angleY), cosZ = Math.cos(angleZ),
// sinZ = Math.sin(angleZ);
// double nx, ny, nz;
// nx = (x * cosY + z * sinY) * (x * cosZ - y * sinZ);
// ny = (y * cosX - z * sinX) * (x * sinZ + y * cosZ);
// nz = (y * sinX + z * cosX) * (-x * sinY + z * cosY);
// return v.setX(nx).setY(ny).setZ(nz);
// Having some strange behavior up there.. Have to look in it later. TODO
rotateAroundAxisX(v, angleX);
rotateAroundAxisY(v, angleY);
rotateAroundAxisZ(v, angleZ);
return v;
double x = v.getX(), y = v.getY(), z = v.getZ();
double cosX = Math.cos(angleX), sinX = Math.sin(angleX),
cosY = Math.cos(angleY), sinY = Math.sin(angleY),
cosZ = Math.cos(angleZ), sinZ = Math.sin(angleZ);
double nx, ny, nz;
ny = y * cosX - z * sinX;
nz = y * sinX + z * cosX;
y = ny; z = nz;
nx = x * cosY + z * sinY;
nz = x * -sinY + z* cosY;
x = nx;
nx = x * cosZ - y * sinZ;
ny = x * sinZ + y * cosZ;
return v.setX(nx).setY(ny).setZ(nz);
}

/**
Expand Down