Farseer 物理 XNA Geom “绊倒”

发布于 2024-08-13 00:19:18 字数 701 浏览 10 评论 0原文

我有一个类似于 http://farseerphysicals.codeplex.com/Thread/ 的问题View.aspx?ThreadId=72364

我有一个矩形播放器几何图形,并且许多矩形平铺几何图形彼此相邻排列。

有时,当玩家几何图形在它们之间穿过时,他似乎会夹到瓷砖几何图形的角上,从而旋转过来。

即使将惯性矩切换到无穷大以防止旋转,玩家几何体也会在夹住边缘时“跳跃”。

这是geoms的屏幕截图绊倒图像http://notspike.com/PrototypeG/trip.png

这个问题有什么解决办法吗?我已经尝试过 Farseer 论坛,但它似乎很不活跃

这是一个使用圆形几何图形播放器的视频链接

http://www.notspike.com/PrototypeG/trip.avi

I have an issue similar to http://farseerphysics.codeplex.com/Thread/View.aspx?ThreadId=72364

I have a rectangle player geom, and many rectangle tile geoms lined up next to each other.

Occasionally when the player geom is crossing between them he seems to clip onto the corners of the tile geom and as a result rotate over.

Even when switching the moment of inertia to infinity which prevents rotation, the player geom "hops" when it clips the edge.

Here is a screenshot of the geoms tripping image http://notspike.com/PrototypeG/trip.png

Is there any fix for this? I've tried the Farseer forums but it seems pretty inactive

Here is a link to a video using a circle geom for the player

http://www.notspike.com/PrototypeG/trip.avi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

喜爱纠缠 2024-08-20 00:19:19

我建议您避免在关卡的碰撞几何体中使用彼此相邻放置的小瓷砖。例如,虽然从视觉上很明显您正在使用图块,但视频中的“地板”最好描述为一个长的连续矩形。这样,你就根本不会遇到这个问题......浮点数学已经不够精确,而平铺碰撞几何图形只是要求出错:-)

I would suggest that you avoid the use of small tiles placed next to each other for the level's collision geometry. For example, although visually it's clear that you're using tiles, the "floor" from the video would best be described as a long contiguous rectangle. That way, you don't have this problem at all ... floating point math is already imprecise enough and tiling collision geometry is just asking for that to go wrong :-)

桃气十足 2024-08-20 00:19:19

当我的形状足够小或者移动足够快,物理计算“滴答声”之间的间隔足以允许对象在碰撞检测开始之前重叠时,我以前就遇到过这种情况。

I've had this happen before when my shapes are small enough or the movements are fast enough for the interval between physics calculation "ticks" to be enough to allow the objects to overlap before the collision detection kicks in.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文