Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / help with physics? Rocks tumbling on each other.

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 26th Dec 2018 21:11
Appreciate any help with this. I am just trying to get this rock to crumble. The results are ugly to downright bizarre.


Attachments

Login to view attachments
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 26th Dec 2018 22:06
Added a video.

How can I keep the pieces closer together? Also, one of the smaller pieces seems to bounce and roll around too spasmodically.

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Dec 2018 22:31 Edited at: 26th Dec 2018 22:32
They will behave that way because dynamic physics bodies will push themselves away from each other
in all/any directions


ie an exploding block without physics can be acheived



to do a crumble effect I personally think if you moved the pieces until the collided inward you would get a crumble effect
I cant see it will work properly with dynamic objects but i could be wrong
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Dec 2018 22:44
you may find these commands help




but it still kinda a bit bouncy due to their positioning
fubar
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 27th Dec 2018 00:37
Yeah, I can't get anything to look remotely natural. I think I will need to animate it, unfortunately.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Dec 2018 00:46
Have you tried Kinematic objects? that way you could place them yourself
and still have some physics properties
fubar
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 27th Dec 2018 00:56 Edited at: 27th Dec 2018 00:56
1) it looks like the size of the ground matters.
2) the gravity matters
3) the mass of the objects matter

How these all relate to each other is a mystery, since the documentation is poor and there are no demos.

Janbo has a shadow shader on the forums that utilizes physics. Its really well done, but I don't see what I am doing different from his project. He has boxes stacked on top of one other, and when its hit by a ball, they don't go flying out into outer space like the hulk hit them.

edit: I set the rock to a kinematic, but it just stayed there.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 27th Dec 2018 01:21 Edited at: 27th Dec 2018 01:24
With this I get a fun looking break. But, I really think its only applicable to this ground size. A little frustrating.



fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Dec 2018 05:12 Edited at: 27th Dec 2018 05:15
you could try changing the physics scale factor

Create3DPhysicsWorld( scaleFactor )


fubar
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Dec 2018 05:15
Try;
Create3DPhysicsWorld(2)
SetObjectShapeConvexHull( crumble_rock_objects[i] )

Create3DPhysicsWorld(2) will scale the 3D world right down to match the size of your models. Alternatively you could make them huge in size
Convex hull will work the best i think. If your shapes are indented then it will fill that in with the hit shape and cause the pieces to push away from each other


fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Dec 2018 05:18
That's it blink solved it

heres the snippet
fubar
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 27th Dec 2018 20:58
Nice, thank you.

Login to post a reply

Server time is: 2024-11-23 09:04:47
Your offset time is: 2024-11-23 09:04:47