[BEHAVIOR] Chipmunk Physics

Post your completed addons to share with the community

Post » Fri Dec 09, 2016 8:21 pm

@bereLaDD33
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
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

Post » 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

Post » 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
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

Post » 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

Post » 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

Post » 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
45
S
20
G
65
Posts: 1,115
Reputation: 38,121

Post » 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.)
Image

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

Post » 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,003

Post » 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
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

Post » 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
38
S
11
G
1
Posts: 203
Reputation: 4,473

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests