Flip objects behavior

edited July 2015 in Help request
I am facing a problem with flipped objects position. When I flip an object, it also changes its position, then I am adjusting the object position to place it where I originally wanted it to be, but the physics parts are not moving along.

I could easily adjust the parts positions as well, but I can't really understand why I would need to. It would seem to me that the parts' position should move with the object.

Here is a video of this happening with in the editor:

Here is the relevant part of the ini file:
Graphic = temple_fountaing_0_Graphic
Group = default
Flip = y
Position = (0.0, 439.0, 1.0)
Body = temple_fountaing_0_Body

Texture = temple_fountaing.png
Smoothing = true

PartList = temple_fountaing_0_part_0
Dynamic = false
FixedRotation = false
HighSpeed = false

Solid = false
Type = sphere

Thanks in advance.


  • edited July 2015
    The reason is that flipping only affects the graphic (ie. the visual part) and doesn't impact the physical part (ie. the body).
    Your pivot is probably not center on your graphic, which means when you flip it it looks like it's at a different place, however its physical shape hasn't move.

    If you want to flip the whole object, including both graphic and body, I'd suggest using a negative scale:
    Scale = (-1, 1, 1); <= Flip on X
    Scale = (1, -1, 1); <= Flip on Y
    Scale = -1; <= Flip on X and Y

    There are very few cases where Flip is actually that helpful, and it's probably a good idea to stick with signed scale values instead. :)
  • edited August 2015
    I was testing today a change to place the collider in the expected position when the object is flipped and I noticed that the flipped object is being clipped while still inside the camera area.

    This doesn't affect a non flipped objects. Is this expected?
  • edited August 2015
    No, it's probably a bug. Did it happen with negative scale flipping or with the Graphic's Flip property?
    Also, if you have a short repro case that would be great (and I will probably not be able to look at it before a couple of weeks as I'm away from home on vacation right now).
  • edited August 2015
    It works with the negative scale and bugs with the flip property.

    I can get the scene viewer code and ini file that will cause the error, I will post it here when I get some time at home (I have only the binaries here).
  • edited August 2015
    Sorry for the long time, here is the code (if you are not using Code::blocks, the ini file is in the bin/Debug folder, you will also need to update the [Resource] Texture folder).

    Just use the left key (it will move the camera) and you will see the object disappearing when there is about 1/2 of it still on the screen. https://forum.orx-project.org/uploads/legacy/fbfiles/files/MapLoader.zip
  • edited August 2015
    Thanks for the archive. I just came back from vacation and I'll have a look at it over next week end.
Sign In or Register to comment.