私はlibgdxフレームワークを使用しています。私は、文字modelInstanceとVector3オブジェクトの配列を持っています。文字modelInstanceは、配列内の各Vector3オブジェクト間で変換されます。私が問題を抱えているのは、modelInstanceを、それが向いているベクトルに向けるように回転させることです。どのようにこれを一度達成することができますか?ベクトルを指すように変換を回転
public void move(float delta){
Vector3 start = new Vector3();
modelInstance.transform.getTranslation(start);
Vector3 end = pathVectors.get(0);
float distance = start.dst(end);
Vector3 direction = new Vector3(end);
direction.sub(start).nor();
modelInstance.transform.trn(direction.x * moveSpeed * delta, direction.y * moveSpeed * delta, direction.z * moveSpeed * delta);
Vector3 currentPosition = new Vector3();
modelInstance.transform.getTranslation(currentPosition);
if(start.dst(currentPosition) >= distance){
modelInstance.transform.setTranslation(end);
pathVectors.remove(0);
if(pathVectors.isEmpty()){
isMoving = false;
}
}
}