问题:我有 3 个游戏对象,它们具有 PhysicShape 和 PhysicBody(static) 组件。我将其转换为实体并进入场景。我不认为物体会相互碰撞,所以我尝试让 Ray cast 在它们碰撞之前处理另一个物体。但似乎我做错了什么,Ray cast 没有“看到”其他对象(它们都在一层,都是实体)。
我的雷演员代码
var input = new RaycastInput() {
Start = translationVal,
End = translationVal + localToWorld[i].Forward * 2f,
Filter = new CollisionFilter {
BelongsTo = ~0u,
CollidesWith = ~0u, // all 1s, so all layers, collide with everything
GroupIndex = 0
}
};
if (CollisionWorld.CastRay(input, out var hit)) return; //always false :(