Sprite Kit Recovery?

I was just curious to know what exactly the Sprite Kit Restitution is setting up. I know that it adjusts the behavior according to SKPhysicsBody parameters, but how is the behavior different?

+4
source share
5 answers

Sprite Kit Physicalbody Restitution is defined as

"a property that describes how much energy a body saves when it bounces from another body, basically a fancy way of saying" bounciness "-IOS Textbook Games

Also an excerpt from the iOS developer library (Apple Docs)

, , . 0,0 1,0. 0.2.

, , (0.0 1.0); , 1, . , . .

+3

restitution SKPhysicsBody Apple:

, , . 0.0 1.0.

"bounciness" . , a node (0, -100) ( ). . , ​​ 1.0, (0,100), 0,9, (0,90) ...

+5

, 1.0f, . 0.0f, .

+3

"bounciness"

+1

, Sprite-kit, , , ,

e = relative speed after collision / relative speed before collision

.

, .

  • , , " ", , e = 1

  • , ( ) , " ", . e = 0

  • The latter case concerns the majority of collisions or all of these situations in which the value of e is between 0 and 1 , or in average. This is essentially an inelastic collision, where a little kinetic energy is dispersed. In fact, the default value of the Sprite-kit is 0.2. physicsBody

0
source

Source: https://habr.com/ru/post/1535966/


All Articles