Scaling a Geom

Topics: User Forum
Nov 26, 2008 at 11:00 AM
Hi volks,
currently I am working on a platformer and I have thought for some time about the issue to scale the main-characters size to represent the different states (standing/jumping/sliding/...) more accurate by changing the collision size. Currently I will just use a box for collision. My idea is to connect several boxes with PinJoints and AngleJoints and then to use the PinJoint-distance to achive the box scalation. An other way is to replace the geom... but this may lead to some other, not easy to handle, problems. Arn't there any better solutions?
Thankful for any response, sunDiver
Nov 26, 2008 at 12:10 PM
Is your character made up of different bodies/geoms (like a ragdoll) or is he static (like the box)?

If your character have different states (jumping, standing, ducking) you could create a vertices set (and the geometry) for each of them and change them, when he changes state. (Like you mentioned).

What are some of the problems you are thinking about?
Nov 26, 2008 at 1:24 PM
Edited Nov 27, 2008 at 10:35 AM
Thanks for the fast answer genbox.

Currently the character is just made of a static box, maybe I will change it a little later on into an animated ragdoll-model (depending on the time I have and my persuasive talent to change my boss'-mood ;-) )

The problems I was talking about are for example: when the character stands close to an object and then it increases it's width, the character could be stucked in the object. But due to the changes are very small, this maybe isn't a problem for this character. I'm going to try out.
Nov 26, 2008 at 3:35 PM
Indeed. This is a well know "problem" and have been "solved" in 1000 different ways. Most games choose the easy way (Look at Mario for example) and just keep the width of the character at a fixed amount. In the good old days, a simple boundingbox was the best choice, but that made their characters look like a square. (texture needed to resemble a square to fit the boundingbox)

Anyways, There are other ways of solving this, one of them being detecting when a character is "reaching" inside a wall and just nudge him a little, to get him out. Another is to create some padding between the character and the wall. There are also more advanced methods of solving this, but most of them are build directly into the game behavior.

Even 3D games today have their guns sticking into walls when you are facing it close up. :)

I hope you find a solution that fits you.