LookAtNode QML Type
Un nœud auxiliaire qui reste automatiquement orienté vers un autre nœud. En savoir plus…
| Import Statement: | import QtQuick3D.Helpers |
| Since: | Qt 6.4 |
| Inherits: |
Propriétés
- target : Node
Description détaillée
Cet assistant implémente un nœud qui pivote automatiquement de manière à toujours être orienté vers un nœud spécifié. La rotation s'effectue uniquement autour des axes X et Y.
Par exemple, l'extrait de code suivant maintient le cylindre orienté vers le cube.
View3D {
anchors.fill: parent
camera: camera
PerspectiveCamera {
id: camera
}
DirectionalLight {}
LookAtNode {
target: cube
Model {
id: cylinder
source: "#Cone"
eulerRotation.x: -90
materials: [
PrincipledMaterial {}
]
}
}
Model {
id: cube
position: Qt.vector3d(300, 300, 0);
source: "#Cube"
materials: [ PrincipledMaterial {} ]
}
}Documentation des propriétés
target : Node
Spécifie le nœud cible à examiner. La valeur par défaut est null.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.