aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/spawn/box.qml
blob: 354499676864beb3f7de5a5542ac2c1fb9c94765 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick3D
import QtQuick3D.Physics

DynamicRigidBody {
    property bool inArea: false
    mass: 10
    y: 2

    Model {
        source: "#Cube"
        materials: PrincipledMaterial {
            baseColor: inArea ? "blue" : "red"
        }
        scale: Qt.vector3d(0.01, 0.01, 0.01)
    }

    collisionShapes: BoxShape {
        extents: Qt.vector3d(1, 1, 1)
    }
}