[Behavior] gravitation (for physics behavior)

Post your completed addons to share with the community

Post » Thu Jan 22, 2015 9:53 am

@rexrainbow Sure, but in that capx you have three sources with the same tag. So either;

1. They all work simultaneously.
Image
OR
2. One of the sources takes priority.
Image

I want to know which? I was hoping for 1 but I think it's 2.

If it is 2 then which source takes priority?
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Thu Jan 22, 2015 4:38 pm

@TheWyrm

In the sample, the target ball had been push a force at beginning.
Here is another sample. which put target between two source with the same distance in horizontal, and push a vertical force. You could see the moving path of target ball is along vertical.
B
97
S
22
G
176
Posts: 4,109
Reputation: 103,021

Post » Thu Jun 25, 2015 7:34 am

cool, i could use this for something :D
B
15
S
7
G
1
Posts: 145
Reputation: 2,379

Post » Fri Jul 17, 2015 3:43 am

So can this plugin be used in conjunction with the default physics plugin? If so it would present a solution to SO many issues I have and make my projects so much simpler to deal with. Great job!
B
10
S
1
Posts: 72
Reputation: 989

Post » Fri Jul 17, 2015 3:45 am

@GideonG

It's based on/require official physics behavior.
B
97
S
22
G
176
Posts: 4,109
Reputation: 103,021

Post » Fri Jul 17, 2015 10:21 am

@rexrainbow That's great to hear! Thanks a lot! This will definitely be a download for me then! :D
B
10
S
1
Posts: 72
Reputation: 989

Post » Sat Feb 20, 2016 10:14 am

Update

Add rex_physics_speedclamp behavior to clamp speed in a range.
B
97
S
22
G
176
Posts: 4,109
Reputation: 103,021

Post » Sat Apr 23, 2016 12:47 am

What's your thoughts on the Chipmunk physics plugin?

I tried to edit your gravitation plug-in to work with Chipmunk physics but it doesn't have an "apply force toward" function.

I'm guessing I'd need to calculate the the angle instead? I tried using cr.angleTo but I don't really know what I'm doing!
The only thing that happens is every object flies off to the right of the screen :D

Code: Select all
behinstProto._apply_force_toward = function (f, px, py) {

    var physics_behavior_inst = this._get_physics_behavior_inst();
    var angle = cr.angleTo(this.inst.x, this.inst.y, px, py);
    cr.behaviors.rojoChipmunkBeta.prototype.acts.applyForceAt.apply(physics_behavior_inst, [1, angle, f, 0, 0, 0]);

}
B
5
S
2
Posts: 1
Reputation: 391

Post » Tue Apr 26, 2016 5:59 am

@neonDog

I would suggest you implement it in.... event sheet.
B
97
S
22
G
176
Posts: 4,109
Reputation: 103,021

Previous

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests