我目前正試圖實現自己的SAT(分離軸定理)碰撞檢測系統,但遇到了問題。上線34我收到此錯誤信息: line 34, in collision axis = (v[1], -v[0]) TypeError: 'int' object is not subscriptable 奇怪的是v不是一個整數,這是一個元組。 下面的代碼 import math
import pygame
WIDTH =
我有三個OBJ文件,Cone, Sphere and Cube。我如何找到這些對象的維度,以便我可以在我的碰撞檢測類中使用它? 即如何找到Radius, Length of Cube and Radius and Height of cone?還是有更好的碰撞檢測方法,我在我的遊戲中有數百個隨機粒子,可能會或可能不會與這些物體發生碰撞。