3D空间中四角的角
问题描述:
答
你想要的是四元组的法线。
Here's an answer that shows you how to get a quad's normal
后你有正常的,你需要计算collision's response的力量。它的方向是四边形的法线,强度是射弹沿四边形方向施加的力量。施加的力是通过使用射弹的速度的点积计算,并逆转四的正常(Here's a wiki link for the dot product)
响应载体应是这样的:
Vector3 responseForce = dot(projectile.vel, -1 * quad.normal) * quad.normal;
projectile.vel += responseForce;