小编Dis*_*ser的帖子

如何让子弹朝 3 维空间中的一点移动

我目前正在使用 java LWJGL 制作 3D 第一人称射击游戏。我想转动子弹并将其移向世界上的指定点。我设法使子弹在 Y 轴上转动,但不能在 X 和 Z 轴上转动。如何使子弹在 Z 和 X 轴上转动,然后向该点移动?

这是我的子弹类:

package entities;

import org.lwjgl.util.vector.Vector3f;

import models.TexturedModel;
import renderEngine.DisplayManager;
import toolbox.MousePicker;

public class Bullet extends Entity{

private static Vector3f currentRay = new Vector3f();
private static final float RAY_RANGE = 600;
public static boolean reset = true;
public Bullet(TexturedModel model, Vector3f position, float rotX, float rotY, float rotZ, float scale) {
    super(model, position, rotX, rotY, rotZ, scale);

}
public void move(Bullet b){
    float distance = …
Run Code Online (Sandbox Code Playgroud)

java math 3d lwjgl

5
推荐指数
1
解决办法
197
查看次数

标签 统计

3d ×1

java ×1

lwjgl ×1

math ×1