ImageBoxBody.qml 1.5 KB

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