Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
感谢您阅读我的帖子。我正在使用 box2d 灯,除了 1 个问题外,它大部分都运行良好。当锥形光照射到光碰撞的物体上时,光会越过物体。我想这样做,如果锥光与身体碰撞,它不会越过对象,而是不会渲染。再次感谢!
你试过 light.setXray(false) 吗?
Box2dLights 使用 RayCasting 来检查某个对象是否必须投下阴影。由于此光线投射会忽略其起点上的形状,因此您光线下的物体将永远不会投下阴影。相反,你必须自己询问这个世界并关掉你的灯,如果那个点上有一个形状。