1、The function of sin and cos are are inside out.
2、The LBoxCollider’s size is strange.
public void GetUniFormCell(FVector2 Tmin, FVector2 Tmax, LList<Cell> TArray )
{
{
TArray.Clear();
int nMinx = LPhysicsUtil.IFloor(Tmin.x / m_cellSize) - 1;
int nMiny = LPhysicsUtil.IFloor(Tmin.y / m_cellSize) - 1;
int nMaxx = LPhysicsUtil.ICeil(Tmax.x / m_cellSize) + 1;
int nMaxy = LPhysicsUtil.ICeil(Tmax.y / m_cellSize) + 1;
}
...
}
本文介绍了一个Unity中针对物理网格进行碰撞检测的方法。通过使用FVector2T来定义最小和最大范围,并利用LList和Cell数据结构来实现碰撞区域内的单元格检索。此方法涉及到坐标转换、范围计算等步骤。
434

被折叠的 条评论
为什么被折叠?



