求解非线性求解器_使用高级物理求解器改善仿真和性能

求解非线性求解器

In mid-2015, Roblox unveiled a major upgrade to its physics engine: the Projected Gauss-Seidel (PGS) physics solver. For the first year, the new solver was optional and provided improved fidelity and greater performance compared to the previously used spring solver.

2015年中期,Roblox对其物理引擎进行了重大升级:Projected Gauss-Seidel(PGS)物理求解器。 第一年,新的求解器是可选的,与以前使用的弹簧求解器相比,它提供了更高的保真度和更高的性能。

Image for post

In 2016, we added support for a diverse set of new physics constraints, incentivizing developers to migrate to the new solver and extending the creative capabilities of the physics engine. Any new places used the PGS solver by default, with the option of reverting back to the classic solver.

在2016年,我们增加了对各种新物理约束的支持,从而激励开发人员迁移到新的求解器,并扩展了物理引擎的创造能力。 默认情况下,所有新场所都使用PGS求解器,并可以选择还原为经典求解器。

We ironed out some stability issues associated with high mass differences and complex mechanisms by the introduction of the hybrid LDL-PGS solver in mid-2018. This made the old solver obsolete, and it was completely disabled in 2019, automatically migrating all places to the PGS.

通过在2018年中期引入混合LDL-PGS求解器,我们消除了一些与高质量差异和复杂机制相关的稳定性问题。 这使旧的求解器过时了,并于2019年被完全禁用,自动将所有位置迁移到PGS。

In 2019, the performance was further improved using multi-threading that splits the simulation into jobs consisting of connected islands of simulating parts. We still had performance issues related to the LDL that we finally resolved in early 2020.

在2019年,使用多线程进一步提高了性能,该多线程将模拟分为由连接的模拟零件岛组成的工作。 我们仍然存在与LDL相关的性能问题,我们最终在2020年初解决了该问题。

The physics engine is still being improved and optimized for performance, and we plan on adding new features for the foreseeable future.

物理引擎仍在改进和优化性能,我们计划在可预见的将来添加新功能。

实施物理定律 (Implementing the Laws of Physics)

The main objective of a physics engine is to simulate the motion of bodies in a virtual environment. In our physics engine, we care about bodies that are rigid, that collide and have constraints with each other.

物理引擎的主要目标是模拟虚拟环境中物体的运动。 在我们的物理引擎中,我们关心的是刚体,碰撞和相互约束的物体。

Image for post

A physics engine is organized into two phases: collision detection and solving. Collision detection finds intersections between geometries associated with the rigid bodies, generating appropriate collision information such as collision points, normals and penetration depths. Then a solver updates the motion of rigid bodies under the influence of the collisions that were detected and constraints that were provided by the user.

物理引擎分为两个阶段:碰撞检测和解决。 碰撞检测可发现与刚体关联的几何形状之间的相交处,从而生成适当的碰撞信息,例如碰撞点,法线和穿透深度。 然后, 求解器在检测到的碰撞和用户提供的约束的影响下更新刚体的运动。

Image for post

The motion is the result of the solver interpreting the laws of physics, such as conservation of energy and momentum. But doing this 100% accurately is prohibitively expensive, and the trick to simulating it in real-time is to approximate to increase performance, as long as the result is physically realistic. As long as the basic laws of motion are maintained within a reasonable tolerance, this tradeoff is completely acceptable for a computer game simulation.

该运动是求解器解释物理定律(例如能量和动量守恒)的结果。 但是,准确地100%执行此操作的费用过高,而且只要结果在物理上是现实的,就可以实时模拟它,以提高性能。 只要基本运动规律保持在合理的公差范围内,这种折衷对于计算机游戏模拟是完全可以接受的。

迈出小步 (Taking Small Steps)

The main idea of the physics engine is to discretize the motion using time-stepping. The equations of motion of constrained and unconstrained rigid bodies are very difficult to integrate directly and accurately. The discretization subdivides the motion into small time increments, where the equations are simplified and linearized making it possible to solve them approximately. This means that during each time step the motion of the relevant parts of rigid bodies that are involved in a constraint is linea

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值