Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

[3.0] Tips

Yuya Matsuo edited this page Sep 23, 2016 · 7 revisions

Let Entity look at me

Quaternionf q = new Quaternionf();
Vector3f dir = new Vector3f();
Vector3f up = new Vector3f(0, 1, 0);

entity.getPosition().mul(-1, dir);
q.lookRotate(dir, up).invert();
entity.setRotation(q);
Clone this wiki locally