checkpoint
This commit is contained in:
parent
4a4ade110a
commit
315fe01034
@ -89,13 +89,25 @@ public class DefaultBootstrap extends ServerInitializer {
|
||||
meta.setBlockState(rot.block());
|
||||
meta.setScale(rot.rot());
|
||||
|
||||
var quaternion = Quaternion.DEFAULT // В классе кватерниона уже писать логику для его вычисления
|
||||
.normalize();
|
||||
meta.setLeftRotation(quaternion.toFloatArray());
|
||||
var defaultVector = new Vec(0, 1, 0);
|
||||
|
||||
double t = defaultVector.dot(normal) / 2;
|
||||
|
||||
double x = 1 - Math.cos(t);
|
||||
meta.setLeftRotation(new Quaternion(
|
||||
normal.x(),
|
||||
normal.y(),
|
||||
normal.z(),
|
||||
n(normal.x()) - n(normal.y()) - n(normal.z())
|
||||
).normalize().toFloatArray());
|
||||
|
||||
entity.setInstance(instance, startPos);
|
||||
}
|
||||
var line = new DebugLine("test", startPos, endPos, NamedTextColor.GOLD);
|
||||
line.setInstance(instance, startPos);
|
||||
}
|
||||
|
||||
public static double n(double input) {
|
||||
return Math.sqrt(1 - input * input);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user