summaryrefslogtreecommitdiffstats
path: root/src/imports/shapes/Capsule.qml
diff options
context:
space:
mode:
authorSarah Smith <sarah.j.smith@nokia.com>2011-12-03 10:11:39 -0800
committerQt by Nokia <qt-info@nokia.com>2011-12-06 05:31:19 +0100
commit904f3a7181e6b4761c6cc6b21bc66936ef46c52d (patch)
tree6add69388e66fe38202bb3cc0b2ace1c733586f3 /src/imports/shapes/Capsule.qml
parent960b6e36fcd1e03b7c704c9139ca2ec182161f7a (diff)
Mesh conversion on Cylinder and Capsule.
Follow the example of the Sphere and convert Cylinder and Capsule to being meshes as well. Add some useful doc to the three classes showing the performance and other considerations for each. Add a basic manual test, with a README. Slightly improve the warning message from QDeclarativeMesh. Fix a bug with Sphere where nothing would display if the default values for a sphere were used. This was because the createGeometry() function was only triggered when properties changed. Now also trigger it if draw is called and the scenegraph for the object has not yet been created. Same code was also required on the new shape meshes. Change-Id: I475e34e31741ba8583587961fc3d0ee3d03bcb9d Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
Diffstat (limited to 'src/imports/shapes/Capsule.qml')
-rw-r--r--src/imports/shapes/Capsule.qml55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/imports/shapes/Capsule.qml b/src/imports/shapes/Capsule.qml
new file mode 100644
index 00000000..6997e76d
--- /dev/null
+++ b/src/imports/shapes/Capsule.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtQuick3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt3D 1.0
+import Qt3D.Shapes 1.0
+
+Item3D {
+ id: capsule
+ property alias name: capsuleMesh.objectName
+ property alias radius: capsuleMesh.radius
+ property alias length: capsuleMesh.length
+ property alias levelOfDetail: capsuleMesh.levelOfDetail
+ mesh: CapsuleMesh {
+ id: capsuleMesh
+ }
+}