0 Favourites

PHYSICS: Less bounce against Immovable object?

  • Hi.

    Simple question really.

    Using the Physics behavior on 2 objects. Object1 is in the air, Object2 is on the ground.

    Object1 falls towards Object2 and collides with it.

    If Object2 is set to "Immovable", Object1 bounces off a lot less than if "Movable".

    Why is that?

  • Ok

    I tried this myself and made a small capx:

    dl.dropboxusercontent.com/u/89517854/physicsthingy.capx

    by changing the immovable option on sprite two you can see a difference in the max Y after the first bounce.

    My guess is :

    When the object is immovable it doesn't bounce itself, so it's not like an action from Object 1 causes an reaction on Object 2.

    When the Object 2 is not immovable it will make a bounce after recieving energy from object 1 and after hitting ground (since you have to hava some sort of ground, else everything will fall to infinity) it will give a small amount of energy back to the Object 1, hence make it bounce higher.

    rock on,

    Michael

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Hmm, I'd not noticed this before! The difference seems to be fairly small though. It must be a quirk of the Box2D engine.

    I suppose when an object is movable, some of the impact speed is transmitted in to the reaction of the movable object. If it's immovable I'd have expected it to bounce higher, because none of the energy is lost in the object it collided with. However it seems the opposite is the case, which is a little odd.

  • I imagine it more like a trampoline since the moveable object is not really "resting" all the time it inherits some "bounciness" all the time.

    rock on,

    Michael

    EDIT: Some physicist could help <img src="smileys/smiley36.gif" border="0" align="middle" />

  • When "Immovable" is on, it seems to disable(set to 0) all properties of the object - Elasticity, Friction, etc.

    When "Movable" is on, the equation seems to combine both the elasticity of Object1 and Object2 to calculate the bounce, amongst others.

    The Manual says only Density is set to 0 with Immovable on.

    Thus you should be able to manually choose elasticity for an Immovable object, no? One wall should be bouncier than the other, for example.

    Immovable completely disabling all physics properties does seem to cancel that possibility.

    This makes having, for example, different types of surfaces on the same Layout quite difficult, no?

  • In general I must say physics engines are not something to base your core gameplay on. Try to avoid using mechanics you can't control.

    Sorry if I can't be of more help here.

    rock on,

    Michael

  • It's a very controllable mechanic - the effect is reproducible every single time.

    What bothered me is that the Scirra Manual doesn't reflect this or even mention it. Thus not sure if it's a feature or a bug.

  • Is it possible to get a confirmation on if this is intended functionality or bug?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)