Changing SKPhysicsBody Settings Not Affected

I am trying to simulate the behavior of various types of balls (soccer ball, tennis, golf, volleyball, etc.). For these purposes, I tried to change the density, mass, and dimensional parameters of the physical body. In my game, this has no effect, and I tried to simulate it in a very simple application consisting of a ball and a paddle

enter image description here

the ball always rises to the same height at the same speed , regardless of mass, density, size

setting for the ball

enter image description here

Is it due to restitution equal to 1? How can I simulate the behavior of different types of balls in this way?

+5
source share
1 answer

you need to change the restitution property as well as Lin. Moisturizing and Ang. Humidification on the ball

for my example i have

tennis ball - rest 0.6 lin 0.2 ang 0.2

soccer ball - rest. 0.5 lin 0.3 v 0.2

golf ball - rest 0.8 lin 0.3 ang 0.3

shot - rest 0.1 lin 0.1 ang 0.1

enter image description here

here is a link to Apple property definitions

https://developer.apple.com/documentation/spritekit/skphysicsbody/1519906-mass

+5
source

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


All Articles