1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
import QtQuick
import QtQuick3D
import QtQuick3D.Physics
Rectangle {
width: 640
height: 480
visible: true
PhysicsWorld {
scene: viewport.scene
forceDebugDraw: true
running: true
}
View3D {
id: viewport
anchors.fill: parent
PerspectiveCamera {
id: camera
position: Qt.vector3d(0, 50, 500)
eulerRotation: Qt.vector3d(0, 0, 0)
clipFar: 5000
clipNear: 1
}
DirectionalLight {}
BoxShape {
id: boxshape
}
SphereShape {
id: sphereshape
}
CapsuleShape {
id: capsuleshape
}
StaticRigidBody {
id: body0
position: Qt.vector3d(0, 0, 0)
collisionShapes: [boxshape, sphereshape, capsuleshape]
}
StaticRigidBody {
id: body1
position: Qt.vector3d(0, 100, 0)
collisionShapes: [boxshape, sphereshape, capsuleshape]
}
}
}
|