# [BEHAVIOR] Chipmunk Physics

### » Fri Dec 09, 2016 8:21 pm

First set gravity to zero. Then you can google two formulas.
The first is "universal gravitation". It's a formula for calculating the force between two objects. Basically every tick you'd apply the force calculated by that equation toward another object.
The "G" value you'd tweak to be more of the scale that fits onscreen. You may also tweak the object masses.

The second formula is "orbit velocity". Basically take the angle from the moon to the earth, add or subtract 90, and set the velocity of the moon in that direction with the result of the formula.
B
95
S
34
G
128
Posts: 5,494
Reputation: 81,676

### » Fri Dec 30, 2016 7:56 pm

@R0j0hound First of all, this is looking really great. Thanks for all the effort you've put into making and maintaining this.

I'm trying to convert a normal Physics game to Chipmunk, and replaced all functions with what I think are exact Chipmunk equivalents. The objects move at vastly different speeds, so I am wondering if the Velocity values are represented differently. Is there a simple way to convert the values? I have a hunch it's by a factor of 60 due to dt stuff but I figured you would know better.
B
11
S
2
Posts: 24
Reputation: 1,280

### » Fri Dec 30, 2016 9:07 pm

@ryguydavis
By default the timestep for chipmunk is set at 1/30, so at 60fps the speed will be double. You can change the timestep to 1/60 for the speeds to be the same.
B
95
S
34
G
128
Posts: 5,494
Reputation: 81,676

### » Fri Dec 30, 2016 9:16 pm

@R0j0hound Wow that's much simpler than I expected. Thanks a lot.
B
11
S
2
Posts: 24
Reputation: 1,280

### » Sun Jan 01, 2017 12:05 am

Okay, so can you tell me bluntly; are Chipmunk Physics superior to the vanilla C2 physics? &&&&
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐๐ผ ๐๐ป ๐๐ฝ ๐๐พ ๐ HAPPY NEW YEARS !!! ๐ ๐๐พ ๐๐ฝ ๐๐ป ๐๐ผ ๐ ๐ ๐ ๐ ๐ ๐ ๐
B
52
S
26
G
8
Posts: 121
Reputation: 8,526

### » Sun Jan 01, 2017 1:58 am

@adcornaglia , I only use this Chipmunk physics plugin now- I don't use the default physics. This plugin has a lot more features.
B
49
S
23
G
66
Posts: 1,151
Reputation: 39,103

### » Sun Jan 22, 2017 11:49 am

Hey all!

What am I doing wrong?
I tried to create a pinball flipper, but the pivot point is a bit "sloppy". I tried to change the "PAD_FORCE_STRENGTH" too, but it does not help. (I want it to move quickly anyways.)

It is obviously moves away from its original position, then slides back after a while. Is there a way to get rid of this extra movement? It looks like I am using the wrong joint, because it is not the "pin" like in the default physics.

Thanks for your replay and help!
B
10
S
2
G
1
Posts: 51
Reputation: 761

### » Sat Feb 11, 2017 11:35 am

hey, i'm a complete beginner on physics... Should i start straightaway with chipmunk, or would it be better if i master first (and i'm far from mastering nothing as for now) the basic C2 physics?
B
23
S
11
G
6
Posts: 181
Reputation: 5,010

### » Mon Feb 13, 2017 6:19 pm

@Borgi
Best I can tell the force pulls the joint out of place. Maybe try a torque instead?

@megalocrator
Either would be fine to use.
B
95
S
34
G
128
Posts: 5,494
Reputation: 81,676

### » Mon Feb 20, 2017 11:15 pm

@R0J0hound

Would you mind checking this example? https://drive.google.com/open?id=0B6SE3 ... mJTemxHOUE
Hopefully I am doing something obviously wrong but I can't seem to spot it. I am trying to attach the crack to image point '1' and then have it turn. It seems to always setup the joint to the origin through and cause it to move strange.

Thanks,
B
40
S
11
G
1
Posts: 212
Reputation: 4,545

PreviousNext