[BEHAVIOR] Chipmunk Physics

Post your completed addons to share with the community

Post » Fri Jan 30, 2015 6:38 pm

R0J0hound wrote:Update 2.2
Download in first post.

* Fixed: Adding joints in to new objects in "post collide"
* Fixed: Movement actions for new objects in "post collide" were ignored.

@Prominent
In "post collide" new objects aren't added to the simulation till right after the physics step. So they won't trigger a "post collide" till at least the next frame.



Awesome! My game is working as expected now. Thanks a lot!
If I come across anything else I'll let you know..
B
43
S
19
G
65
Posts: 1,098
Reputation: 37,933

Post » Sun Feb 01, 2015 9:37 pm

@R0J0hound , Okay.. I think I found a bug.. Seems like when you move an object that a joint is attached to, the joint anchor position properties don't get updated until the next event cycle. So if you use the joint position expression right after moving the object, it won't be the accurate location.
B
43
S
19
G
65
Posts: 1,098
Reputation: 37,933

Post » Mon Feb 02, 2015 1:48 am

Update 2.2a
Download in first post.

Fix: JointAnchor expressions were not giving the correct positions right away if objects were moved.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Tue Feb 03, 2015 1:18 am

@R0J0hound , the positions aren't accurate for sliding joints.
B
43
S
19
G
65
Posts: 1,098
Reputation: 37,933

Post » Tue Feb 03, 2015 1:50 am

@R0J0hound , actually, nevermind.. they're accurate.
sliding joints have been confusing me for a while. I think it must be something with my events..
B
43
S
19
G
65
Posts: 1,098
Reputation: 37,933

Post » Tue Feb 03, 2015 2:49 am

Slide joints should be like pin joints, but you specify a minimum and maximum distance instead of using the distance between anchor points.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Tue Feb 03, 2015 3:13 am

hm, if I add a slide joint to two objects that are 10 pixels away from each other, and I give it a max distance of 10.. does that max distance get added onto the distance they're away from each other? Or does it take that into account already..
That might be my confusion if it adds the distance onto the distance they're already from each other..

edit: seems like it takes it into account. I'm still having trouble with sliding joints, not sure what my problem is though.. Must be something else I'm missing.
B
43
S
19
G
65
Posts: 1,098
Reputation: 37,933

Post » Tue Feb 03, 2015 3:56 am

@R0J0hound , when I try to set the idle speed threshold, I get this error
ReferenceError: idleSpeedThreshold is not defined
at Acts.setIdleSpeedThreshold (http://localhost:50000/rojoChipmunkBeta ... js:7673:35)
at Action.run_object (http://localhost:50000/eveng.js:1839:10)
at EventBlock.run_actions_and_subevents (http://localhost:50000/eveng.js:929:38)
at EventBlock.run (http://localhost:50000/eveng.js:886:9)
at Runtime.executeSingleTrigger (http://localhost:50000/preview.js:4565:10)
at Runtime.triggerOnSheetForTypeName (http://localhost:50000/preview.js:4484:16)
at Runtime.triggerOnSheet (http://localhost:50000/preview.js:4411:13)
at Runtime.trigger (http://localhost:50000/preview.js:4393:12)
at Layout.startRunning (http://localhost:50000/layout.js:379:16)
at Runtime.go_loading_finished (http://localhost:50000/preview.js:1886:36)
B
43
S
19
G
65
Posts: 1,098
Reputation: 37,933

Post » Tue Feb 03, 2015 6:05 am

Update 2.2b
Download in first post.

Fixed: "idle speed threshold" action was broken.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Wed Feb 04, 2015 6:51 pm

@R0J0hound - the collisions in chipmunk seem more imprecise than c2's physics. I noticed the 'set fixed timestep' action defaults to 1/30, so does this mean the physics calculations are being done around every 2nd frame?

The capx shows what i mean - the red box with chipmunk clips into the floor on collision then moves back up, while the c2 physics box just stops dead:
You do not have the required permissions to view the files attached to this post.
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: bomt and 1 guest