@x0661t I implemented this using Box2D and I used b2DistanceJoint to connect blob's segments eh.
Soft body chipmunk physics
(49 posts) (21 voices)-
Posted 10 months ago #
-
wow greate work
plz give more source ?
i cant understand about m_centreBody, and m_perimeterBodies[ BLOG_SEGMENTS ]...
plz
Posted 10 months ago # -
m_centreBody is the reference to the central body and m_perimeterBodies[BLOB_SEGMENTS] define the points for the outer segments.
Posted 10 months ago # -
Just awesome
Posted 10 months ago # -
I am strongly interested in using a soft body character in box2d, though I can't quite figure out how to put the pieces together. I never post brief requests like this, but I would be willing to compensate someone who is willing to put together an example for me. Despite this I will continue to try, just thought to ask. Thanks :)
Posted 9 months ago # -
Hi, I was wondering if someone could tell me what this line means, and how you would write it, accommodating box2d. I am unfamiliar with UTIL:
baseAngle = [ UTIL angle:m_centerBody.pos b:m_perimeterBodies[ 0 ].pos ];It is also suggested by Birkemose that he uses "springs". Is there a box2d equivalent to this, prismatic joints maybe? And is anyone creating an outwards force on the perimeter bodies in relevance to the center body, like internal pressure; I have this implemented and it adds a certain rigidity to the body as a whole.
Other than that I would like to thank Birkemose especially for his input. I am very close to having my very own squishy dude in box2d.
Posted 9 months ago # -
Where's the source download? I want to see this for myself! It looks amazing!
Posted 9 months ago # -
AFAIK, he has not released the full source code, just the draw method which should really be about all you need to make this work for you if you are familiar with chipmunk that is.
Posted 9 months ago # -
I have some example code on the Chipmunk downloads page for doing soft body physics:
http://chipmunk-physics.net/tutorials/JellyChipmunk.tgzIt's not set up quite the same as Birkemose's as I wanted it to look squishier, but is still fairly similar.
Get the Flash Video Posted 9 months ago # -
Thanks for that slembcke. Will take a look, even though I pretty much got it figured out in box2D. Still a little rough around the edges though :)
Posted 9 months ago # -
Wow, looks awesome. I tried to get a very simple test of this with a Hello World template with chipmunk, but like @mobilepot I'm having trouble figuring out what to do with
m_centreBody, m_perimeterBodies[ BLOG_SEGMENTS ]
and the linebaseAngle = [ UTIL angle:m_centerBody.pos b:m_perimeterBodies[ 0 ].pos ]
(Maybe this is a class i'm missing...)
Has anybody gotten a basic example working that they wouldn't mind sharing?
I haven't played with the physics stuff much and quite frankly I'm stumped.Posted 9 months ago # -
glColor4ub( m_color.r, m_color.g, m_color.b, 255 );Does anyone know what m_color is, and how to implement it?
I am simply writing it like this: glColor4ub( 255, 255, 255, 255 );
I am having a problem when I draw the soft body, where everything else that I have given a ccc3 color, turns white, for example my score text and some blocks.I have a feeling it is this line that is responsible. Does m_color hold the values of all colors for each object?
If I delete this line: glDisableClientState( GL_COLOR_ARRAY ); then everything is the right color, although my soft body is a weird gradient color and looks funny. Just thought I would add that.
Anybody have any insights? Oh, I am doing this in box2D if that helps or, it probably doesn't matter :)
Posted 9 months ago # -
@Korigame
m_color is just my internal color for the soft body, so it should not affect the color of other objects.It sounds like the rest of your objects uses color arrays. In stead of removing glDisableClientState( GL_COLOR_ARRAY ), try adding glEnableCLientState( GL_COLOR_ARRAY ) as last line.
Posted 9 months ago # -
@Birkemose I love you, thank you for that. That little issue has been bothering me for a few days now. My soft body isn't perfect yet, as I still need to add the springs to the center, but that's hardly an issue.
I would like to ask you if you would have a problem with me using your draw method in my game. I have changed some things to accommodate my own player class, but the code is similar, shall I say. Much props for your continuing input and insights :)
When I have a more polished version of the prototype I am working on I will show it off; the soft body is used as the main playable character.
Thank you - Korigame
Posted 9 months ago # -
@Birkemose Hey, I tried implementing your blob logic with 9 perimeter rectangular bodies, 1 center round body, 9 springs and 9 joints. Is it possible you could shed some more light to this?
I have tried this for some time now, but I'm not able to get the layout to appear anything like what you are describing. What kind of joints are you using and how are you setting the anchor points of these and the springs?
Maybe just a short code segment describing the generation of the blob skeleton.
Thanks,
ClaudiaPosted 1 month ago # -
The demo is now on github
https://github.com/Birkemose/BlobDisclaimer:
The framework is not very well written, hardcoded at places, and should not be shown to youngsters.Posted 1 month ago # -
@Birkmose: Perhaps you should step into comedy. I sense a line of work is waiting for you, much like a young Luke Skywalker wanting to fight his long lost dad!
The stuff you contribute here is fantastic. I admire you efforts!
Posted 1 month ago #
Reply
You must log in to post.