使用 Sprite Kit 创建水(流体)表面 [英] Create water(fluid) surface with Sprite Kit

查看:59
本文介绍了使用 Sprite Kit 创建水(流体)表面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 Sprite Kit 创建水面?

How can i create water surface with Sprite Kit?

我已经搜索并找到了对 Cocos2d 的帮助,它使用 box2d 为水创建物理效果,例如漂浮在水面上的物体以及它的一部分在水中和其他外部水.物体顺水而下,所施加的力与将其抛入水中的力相同,效果类似.

I have searched and found help for Cocos2d which uses box2d to create physics effects for water like object floating over water and some part of it in water and other outside of water. Objects going down the water with as force as applied to throw it into the water and similar effects.

那么如何使用 Sprite Kit 实现相同的水效果?任何想法

So how can i achieve the same water effect with Sprite Kit? Any ideas

推荐答案

SKPhysicsBody 类具有名为 linearDampingangularDamping 的属性,您可以可以修改以模拟抛入水中的物体的液体摩擦(流体阻力).您可以在 SKPhysicsBody 类参考.

The SKPhysicsBody class has properties called linearDamping and angularDamping, which you can modify to simulate liquid friction (fluid resistance) for objects thrown into the water. You can read up on these in the SKPhysicsBody Class Reference.

这篇关于使用 Sprite Kit 创建水(流体)表面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆