0

I don't understand what is the difference between physics.setDrawMode("hybrid") and physics.setDrawMode("normal")?

2 Answers 2

0

According to the Corona documentation the normal mode is --for the default Corona renderer, with no collision outlines, while the hybrid one is --overlays collision outlines on normal display objects. You can read more about it here

2
  • "outlines" you mean out of the screen?
    – idan ahal
    Apr 11, 2015 at 17:09
  • @idanahal I guess so. Apr 11, 2015 at 17:10
0

To help debugging physics engine behaviour, Corona allows to set rendering mode to one of three:

  • normal - doesn't show collision outlines

normal mode

  • hybrid - shows collision outlines on display objects, following colors are used to distinguish between different bodies

    • orange — dynamic physics bodies
    • dark blue — kinematic physics bodies
    • green — static, non-moveable physics bodies
    • gray — a body that is "sleeping" due to lack of activity
    • light blue — physical joints (see the Physics Joints guide)

In the example below, the floor's outline is green, because it is a static, it doesn't move, as defined by the following code:

physics.addBody( floor, "static", { density=1.0, friction=0.3, bounce=0.2 } )

The ball's outline on the other hand, is orange when it's moving, and gray, when it's resting ("sleeping") on the floor.

enter image description here hybrid mode

  • debug - only collision engine outlines are shown;

debug

"hybrid"/"debug" modes will be useful when debugging collisions (as bounding boxes of objects are shown), object movement, physical properties etc.

So in short, the difference between "normal" and "hybrid" modes is that in "hybrid" mode, you can see the physics properties of the bodies.

Documentation here and here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.