ImageBoxBody.qml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import QtQuick 2.0
  2. import Box2D 2.0
  3. Image {
  4. id: image
  5. property alias body: boxBody
  6. property alias fixture: box
  7. // Body properties
  8. property alias world: boxBody.world
  9. property alias linearDamping: boxBody.linearDamping
  10. property alias angularDamping: boxBody.angularDamping
  11. property alias bodyType: boxBody.bodyType
  12. property alias bullet: boxBody.bullet
  13. property alias sleepingAllowed: boxBody.sleepingAllowed
  14. property alias fixedRotation: boxBody.fixedRotation
  15. property alias active: boxBody.active
  16. property alias awake: boxBody.awake
  17. property alias linearVelocity: boxBody.linearVelocity
  18. property alias angularVelocity: boxBody.angularVelocity
  19. property alias fixtures: boxBody.fixtures
  20. property alias gravityScale: boxBody.gravityScale
  21. // Box properties
  22. property alias density: box.density
  23. property alias friction: box.friction
  24. property alias restitution: box.restitution
  25. property alias sensor: box.sensor
  26. property alias categories: box.categories
  27. property alias collidesWith: box.collidesWith
  28. property alias groupIndex: box.groupIndex
  29. signal beginContact(Fixture other)
  30. signal endContact(Fixture other)
  31. sourceSize.height: height
  32. sourceSize.width: width
  33. Body {
  34. id: boxBody
  35. target: image
  36. Box {
  37. id: box
  38. width: image.width
  39. height: image.height
  40. onBeginContact: image.beginContact(other)
  41. onEndContact: image.endContact(other)
  42. }
  43. }
  44. }