havok物理引擎_统一中的Havok物理

havok物理引擎

As announced at Game Developers Conference (GDC) 2019, Havok Physics is now available as a Preview package in the Unity Package Manager. This means that all Unity users can get their hands on the same physics solution that powers many of the top titles of this console generation and brings a wealth of enhancements for your physics simulation needs.

正如在2019游戏开发者大会(GDC)上宣布的那样 ,Havok Physics现在可以在Unity Package Manager中作为Preview包使用。 这意味着所有Unity用户都可以使用同一物理解决方案,该解决方案可为该控制台一代的许多顶级产品提供支持,并为您的物理模拟需求带来了很多增强。

建立在数据中的伙伴关系 (Partnership forged in data)

When we first set out to define what the future of physics would look like with our Data-Oriented Technology Stack (DOTS), we sought a partner that shared the same core concepts and values as us. Through our partnership with Havok, we were able to leverage DOTS to deliver the highly optimized, stateless, entirely C#, and performant Unity Physics. We also knew that some of you would have more complex simulation requirements, needing a stateful physics system. For that reason, we knew Havok would be the perfect solution to integrate into Unity for those high-end simulation needs.

当我们最初着手定义面向数据的技术栈(DOTS)的物理学未来时,我们寻求的合作伙伴与我们拥有相同的核心概念和价值观。 通过与Havok的合作,我们能够利用DOTS交付高度优化的,无状态的,完全C#的高性能Unity Physics。 我们还知道你们中的一些人将有更复杂的仿真要求,需要有状态的物理系统。 因此,我们知道Havok将是完美集成到Unity中以满足高端仿真需求的解决方案。

Some of you might be asking, “Ok, but why did you make two systems instead of just one?” We know that our users have a plethora of different use cases, and we wanted to give everyone a choice based on what their needs are. For some, Unity Physics will suffice, while others will want the benefits and enhanced workflows of Havok Physics. Ultimately, there is no right or wrong choice, as we illustrate later in this blog post. You can switch between either solver without having to reauthor all of your content completely.

你们中的一些人可能会问:“好,但是为什么要制造两个系统而不是一个系统?” 我们知道我们的用户有很多不同的用例,我们希望根据他们的需求为每个人提供选择。 对于某些人来说,Unity Physics就足够了,而另一些人则希望获得Havok Physics的好处和增强的工作流程。 最终,没有正确或错误的选择,正如我们在本博文后面所说明的那样。 您可以在两个求解器之间切换,而不必完全重新编写所有内容。

Havok物理整合 (Havok Physics integration)

演示地址

性能 (Performance)

The Havok Physics integration in Unity is written using the same C# DOTS framework as Unity Physics, and is backed by the closed-source, proprietary Havok Physics engine, written in native C++. Havok Physics is heavily optimized for typical game use cases. Core algorithms have been refined over many years, and various automatic caching strategies (including sleeping of inactive objects) mean that CPU resources are spent only where needed.

Unity中的Havok Physics集成使用与Unity Physics相同的C#DOTS框架编写,并由以本机C ++编写的开源专有Havok Physics引擎作为后盾。 Havok Physics已针对典型游戏用例进行了优化。 核心算法经过多年的完善,各种自动缓存策略(包括Hibernate非活动对象)意味着仅在需要的地方使用CPU资源。

演示地址

行为 (Behavior)

Havok Physics is a robust physics engine designed to handle the performance demands of the most dynamic games, which often include complex scenes with lots of physical interaction. By working with partners across the industry for over 20 years, Havok has encountered and solved, and continues to iterate on, many of the hardest problems facing real-time physics simulation.

Havok Physics是一个强大的物理引擎,旨在满足大多数动态游戏的性能要求,这些游戏通常包含具有大量物理交互的复杂场景。 通过与整个行业的合作伙伴合作20多年,Havok遇到并解决了并继续迭代实时物理模拟面临的许多最困难的问题。

This investment results in stable stacking of physics bodies, minimal artifacts when you have fast-moving bodies, and generally more controlled behavior, especially when given non-optimized collision geometry.

这项投资可以稳定地堆积物理物体,当物体具有快速移动的物体时,伪像最少,并且通常具有更好的控制行为,尤其是在给定非最佳碰撞几何体的情况下。

Example demonstrating the stable stacking functionality of Havok Physics.

演示Havok Physics稳定堆叠功能的示例。

Because Havok Physics caches different state information to perform intelligent optimizations, it can achieve superior performance in large-scale (e.g., open-world) games. Havok Physics also offers greater stability by handling interpenetrating objects and endless stacks with an advanced friction model.

因为Havok Physics缓存不同的状态信息以执行智能优化,所以它可以在大型(例如,开放世界)游戏中获得出色的性能。 Havok Physics还通过使用先进的摩擦模型处理互穿的物体和环形堆叠,提供了更高的稳定性。

Unity Physics (right) attempts to resolve the static/dynamic interpenetrating rigidbodies in a single frame, while Havok Physics (left) can smoothly resolve the setup over a number of frames.

Unity Physics(右)尝试在单个框架中解析静态/动态互穿刚体,而Havok Physics(左)可以在多个框架上平滑解析设置。

可视化和调试 (Visualization and debugging)

The Havok Visual Debugger (VDB) application is a robust debugging tool for Havok Physics simulations. Connecting over TCP/IP to your application, it allows you to diagnose difficult behavior, performance problems, or crashes remotely. While connected, your application exposes a host of capabilities for the VDB user to turn on/off based on the problem they are trying to solve. If configured, your application creates a server offering information to connected VDB clients.

Havok视觉调试器(VDB)应用程序是用于Havok物理模拟的强大调试工具。 通过TCP / IP连接到您的应用程序,它使您可以诊断困难的行为,性能问题或远程崩溃。 连接后,您的应用程序将为VDB用户提供大量功能,可根据他们要解决的问题打开/关闭VDB用户。 如果进行了配置,则您的应用程序将创建一个服务器,向连接的VDB客户端提供信息。

The Havok Visual Debugger UI

Havok视觉调试器用户界面

The Visual Debugger has been an essential tool for the development teams on every game powered by Havok Physics. The modular viewers can be selectively enabled and allow users to:

对于由Havok Physics提供支持的每款游戏,Visual Debugger一直是开发团队的必备工具。 可以有选择地启用模块化查看器,并允许用户:

    The VDB client can also record, save, and load previous snapshots of a simulation for review. These snapshots have been an invaluable resource when developers need external support to help debug complex physics scenarios.

    VDB客户端还可以记录,保存和加载模拟的先前快照以供查看。 当开发人员需要外部支持来帮助调试复杂的物理场景时,这些快照是非常宝贵的资源。

    两个物理引擎,一种数据格式 (Two physics engines, one data format)

    As we described earlier, one of the key goals when we started working on the DOTS Physics initiative was to have a single data representation that could be used across any simulation back-end. By providing a unified editor data layout, developers can author tooling, gameplay code, and other systems that are agnostic to the simulation back-end. We wanted to give control back to you, the creators, to use the simulation back-end that suits your needs without having to reauthor all of your content. The following diagram illustrates the data layout model.

    如前所述,当我们开始从事DOTS Physics计划时,主要目标之一就是拥有可在任何模拟后端使用的单一数据表示。 通过提供统一的编辑器数据布局,开发人员可以编写工具,游戏代码以及与仿真后端无关的其他系统。 我们希望将控制权交还给创建者,您可以使用适合您需求的模拟后端,而不必重新编写所有内容。 下图说明了数据布局模型。

    Flow of physics data in DOTS

    DOTS中的物理数据流

    As you can see, the data flows from authoring through to the simulation systems. At the root level, we abstract our authoring data to be system agnostic, which allows us to build the same tools and user experience across both simulation back-ends. This is then piped through our conversion pipeline into Entity Data. In the Entity Data bucket we have our runtime components such as PhysicsCollider, PhysicsVelocity, PhysicsMass, PhysicsDamping, PhysicsGravityFactor, and PhysicsCustomTags. These are passed into the Build Physics World system, which acts as a second conversion step to convert data optimized for contiguous access into data that is optimized for random access. This system produces a Collision World, which is used for querying the state of the world at the current point in time, and a Dynamics World, which holds all the information needed to simulate physics for the current time step. By separating these worlds, we can perform query operations on the Collision World at the same time the Step Physics World is updating the data held in the Dynamics World, allowing for maximum thread utilization.

    如您所见,数据从创作一直流到仿真系统。 从根本上讲,我们将创作数据抽象为与系统无关的,这使我们能够在两个模拟后端之间构建相同的工具和用户体验。 然后通过我们的转换管道将其通过管道传输到实体数据中。 在实体数据段中,我们具有运行时组件,例如PhysicsCollider,PhysicsVelocity,PhysicsMass,PhysicsDamping,PhysicsGravityFactor和PhysicsCustomTags。 这些将传递到Build Physics World系统中,该系统充当第二转换步骤,将为连续访问而优化的数据转换为为随机访问而优化的数据。 该系统会生成一个“碰撞世界”(Collision World)和一个“动力学世界”(Dynamics World),其中“碰撞世界”用于查询当前时间点的世界状态,“动力学世界”包含当前时间步长模拟物理所需的所有信息。 通过分离这些世界,我们可以在Step Physics World更新Dynamics World中保存的数据的同时,在Collision World上执行查询操作,以最大程度地利用线程。

    As indicated in the diagram, both Unity Physics and Havok Physics share the same data throughout the pipeline. As such, you benefit from not only a unified content pipeline, but also a data protocol and API surface that is system agnostic. Moving between the two different back-ends is an effortless process.

    如图所示,Unity Physics和Havok Physics在整个管道中共享相同的数据。 这样,您不仅受益于统一的内容管道,而且受益于与系统无关的数据协议和API表面。 在两个不同的后端之间移动是一个轻松的过程。

    As we move forward with DOTS Physics, we envision a future where Unity can offer a wide array of simulation back-ends to meet various use cases while maintaining a unified authoring experience across all of these physics systems.

    随着DOTS Physics的发展,我们设想了一个未来,Unity可以提供各种各样的模拟后端,以满足各种用例,同时在所有这些物理系统中保持统一的创作体验。

    Live switching between physics back-ends while in Play mode

    在“播放”模式下在物理后端之间实时切换

    Havok Physics入门 (Getting started with Havok Physics)

    If you’re still with us, you’re probably thinking, “Alright! Enough with the technical jargon – how can I get this?” The good news is you can download the Havok Physics integration as a Preview package via the Unity Package Manager (Unity 2019.1 and later). You can also read through the Havok Physics for Unity documentation.

    如果您仍然与我们在一起,您可能会想,“好吧! 技术术语足够了–我怎么能得到这个?” 好消息是您可以通过Unity软件包管理器(Unity 2019.1及更高版本)将Havok Physics集成作为预览软件包下载。 您也可以阅读Havok Physics for Unity文档。

    If you’d like to engage with the team, raise any issues, or show us the cool things you’re creating with Havok Physics, drop by our new DOTS Physics forum!

    如果您想与团队合作,提出任何问题或向我们展示您使用Havok Physics创建的很棒的东西,请访问我们新的DOTS Physics论坛

    翻译自: https://blogs.unity3d.com/2019/11/06/havok-physics-in-unity/

    havok物理引擎

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

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

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

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

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

    抵扣说明:

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

    余额充值