Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtrianglemeshshape.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
6
8
9/*!
10 \qmltype TriangleMeshShape
11 \inqmlmodule QtQuick3D.Physics
12 \inherits CollisionShape
13 \since 6.4
14 \brief A collision shape based on a 3D mesh.
15
16 This type defines a shape based on the same 3D mesh file format used by
17 \l [QtQuick3D]{Model::source}{QtQuick3D.Model}.
18
19 Objects that are controlled by the physics simulation cannot use TriangleMeshShape: It can only
20 be used with \l StaticRigidBody and \l {DynamicRigidBody::isKinematic}{kinematic bodies}. Use \l
21 ConvexMeshShape for non-kinematic dynamic bodies.
22
23 \sa {Qt Quick 3D Physics Shapes and Bodies}{Shapes and Bodies overview documentation}
24*/
25
26/*!
27 \qmlproperty url TriangleMeshShape::source
28 This property defines the location of the mesh file used to define the shape.
29
30 Internally, TriangleMeshShape converts the mesh to an optimized data structure. This conversion
31 can be done in advance. See the \l{Qt Quick 3D Physics Cooking}{cooking overview documentation}
32 for details.
33
34 \note If both the \l{TriangleMeshShape::}{geometry} and \l{TriangleMeshShape::}{source}
35 properties are set then only \l{TriangleMeshShape::}{geometry} will be used.
36 \sa TriangleMeshShape::geometry
37*/
38
39/*!
40 \qmlproperty Geometry TriangleMeshShape::geometry
41 This property defines the geometry of a mesh used to define the shape.
42 \note If both the \l{TriangleMeshShape::}{geometry} and \l{TriangleMeshShape::}{source}
43 properties are set then only \l{TriangleMeshShape::}{geometry} will be used.
44 \sa TriangleMeshShape::source
45 \since 6.7
46*/
47
48QMeshShape::MeshType QTriangleMeshShape::shapeType() const
49{
50 return QMeshShape::MeshType::TRIANGLE;
51}
52
53bool QTriangleMeshShape::isStaticShape() const
54{
55 return true;
56}
57
58QT_END_NAMESPACE
Combined button and popup list for selecting options.