[英]Libgdx implementing shooting (collision between bullet and objects)
I am new to 3D programming, just started yesterday. 我是3D编程的新手,昨天才开始。
I am just trying to create a simple game, where i move in 3D space, but collision detection works in 2D top down space, cause my character can't jump. 我只是尝试创建一个简单的游戏,在3D空间中移动,但是碰撞检测在2D自上而下的空间中起作用,导致角色无法跳跃。 So collision happens only on X and Z axis.
因此,碰撞仅发生在X和Z轴上。
But now i think about implementing shooting, where the bullet flies in the direction my camera is pointing (first person camera). 但是现在我考虑实施射击,子弹朝着我的相机指向的方向(第一人称相机)飞行。 But i have no idea how shooting is normaly implemented in 3D games?
但是我不知道在3D游戏中通常如何进行拍摄? Is a
Bullet
an object, which is drawn, like in many 2D games, and moved at high speed? Bullet
是像许多2D游戏中一样绘制并高速移动的对象吗? Or is it just a line, which isn't even shown sometimes? 还是只是一条线,有时甚至没有显示? And how can i check for collision with that line without iterating throught all walls and mobs?
我如何在不遍历所有墙壁和生物的情况下检查与那条线的碰撞? I know you can find the areas throught which the bullet flies, but isn't this a big calculation when the line can go in every direction in 3D space?
我知道您可以找到子弹飞过的区域,但是当线可以在3D空间中的各个方向上走时,这不是一个很大的计算吗?
Depends if you want to show the bullet, then you can make a bullet model and make it move very fast. 取决于是否要显示项目符号,则可以创建项目符号模型并使它移动得非常快。
These are good options each one better than the previous 这些都是不错的选择,每一个都比以前更好
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.