[BEHAVIOR] Chipmunk Physics

Post your completed addons to share with the community

Post » Wed Jul 13, 2016 10:36 pm

@R0J0hound , I'm trying to get the object being collided with inside a 'for each collision pair' loop.
It seems to work when objects collide, but then afterwards it just returns 0 for the Chipmunk.CollisionOtherObj value.
This is strange, because the loop runs when objects are touching each other after colliding, but the Chipmunk.CollisionOtherObj returns value of 0.

I need this, because the recent colliding object may not be the value I want if the object colliding is resting on another object and stops touching the recent collided object. I want it to return the original colliding object it still is touching, but it won't until it re-collides.

edit: I might be able to use an alternative method by checking if things overlap..
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Thu Jul 14, 2016 12:03 am

R0J0hound wrote:@badmiracle
Usually if both objects have the behavior, the knock back is automatic. Or if you want it to be more severe you could apply an impulse on post collide. If one object doesn't have the behavior you can still apply an impulse.


Apply impulse at offset just makes for some wack behavior - sending objects rotating rapidly, and not stopping... how do I just make a simple knockback and what else do I have to adjust to prevent the impulse for remaining forever
B
86
S
29
G
10
Posts: 100
Reputation: 10,535

Post » Thu Jul 14, 2016 12:54 pm

It seems that object.Chipmunk.ContactCount doesn't return anything, alongside with other expressions that are supposed to, why is that ?
Banned User
B
17
S
7
G
24
Posts: 388
Reputation: 14,494

Post » Fri Jul 15, 2016 1:45 am

@prominent
Sorry, I haven't had a chance to look into it yet. It's probably one of many edge cases I haven't handled.

@badmiracle
When using the apply impulse action the first vector is the impulse and the the second is the offset from the center of mass. Leave the second one to 0,0 and it souldn't add rotation.

@X3M
Those expressions only give values under the pre/post collide triggers or under the "for each collision pair" condition.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Mon Aug 15, 2016 6:10 am

@R0J0hound

Is there a layout size above which Chipmunk stars loosing precision/becomes unstable? I managed to find this thread:

https://chipmunk-physics.net/forum/view ... f=1&t=2771

which states that Chipmunk uses double precision, so layouts of around 100K in size should still be fine, right?
B
8
S
2
G
2
Posts: 86
Reputation: 1,220

Post » Sun Aug 21, 2016 1:42 am

@R0J0hound - Unfortunately it is not working for me on the latest version of C2 and fails to load with the error:
Found " 'GetPluginSettings' global, but it is not a function "
B
52
S
26
G
8
Posts: 121
Reputation: 8,526

Post » Sun Aug 21, 2016 7:04 am

adcornaglia wrote:@R0J0hound - Unfortunately it is not working for me on the latest version of C2 and fails to load with the error:
Found " 'GetPluginSettings' global, but it is not a function "

@adcornaglia

Are you certain you installed in the 'Behaviors' folder and not the 'Plugins' folder?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
137
S
31
G
87
Posts: 5,557
Reputation: 60,458

Post » Sun Aug 21, 2016 9:56 pm

@Funky Koval
In JavaScript all numbers are double precision, so I doubt it's an issue with a layout that size. It would be the same with any other behavior.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Sun Aug 21, 2016 11:46 pm

zenox98 wrote:
adcornaglia wrote:@R0J0hound - Unfortunately it is not working for me on the latest version of C2 and fails to load with the error:
Found " 'GetPluginSettings' global, but it is not a function "

@adcornaglia

Are you certain you installed in the 'Behaviors' folder and not the 'Plugins' folder?


That was it.
Image
B
52
S
26
G
8
Posts: 121
Reputation: 8,526

Post » Wed Oct 05, 2016 2:47 pm

@R0J0hound I'm testing the plugin and not see "compare velocity" in the physical ... that this plugin is the alternative?
B
13
S
2
Posts: 297
Reputation: 1,717

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests