Nesta página

LookAtNode QML Type

Um nó auxiliar que é automaticamente mantido apontando para outro nó. Mais...

Import Statement: import QtQuick3D.Helpers
Since: Qt 6.4
Inherits:

Node

Propriedades

Descrição detalhada

Este auxiliar implementa um nó que gira automaticamente de forma a ficar sempre voltado para um nó especificado. A rotação ocorre apenas nos eixos X e Y.

Por exemplo, o trecho de código a seguir mantém o cilindro apontado para o cubo.

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 {} ]
    }
}

Documentação das propriedades

target : Node

Especifica o nó de destino a ser analisado. O valor padrão é 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.