Warning, /education/gcompris/external/qml-box2d/examples/impulse/Ball.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.0
0002 import Box2D 2.0
0003 import "../shared"
0004 
0005 PhysicsItem {
0006     id: ball
0007 
0008     Rectangle {
0009         id: circle
0010 
0011         color: "green"
0012         radius: width / 2
0013         width: 100
0014         height: 100
0015         anchors.centerIn: parent
0016     }
0017 
0018     property Body body: CircleBody {
0019         target: ball
0020         world: physicsWorld
0021         sleepingAllowed: false
0022         bodyType: Body.Dynamic
0023 
0024         radius: circle.radius
0025         x: -radius
0026         y: -radius
0027         density: 1
0028         friction: 1
0029         restitution: 0.5
0030     }
0031 }