
import Qt3D.Core 2.0
import Qt3D.Render 2.0
import Qt3D.Extras 2.0
import Qt3D.Examples 2.0
import QtQuick 2.5 as Quick
import QtQuick.Scene3D 2.0
Entity
{
id: carModelEntity
property bool hidden: true
property Scene3D scene
property real carRotation: 0.0
property var previousComponent: undefined
property var previousMaterial
property vector3d defaultCameraPosition: Qt.vector3d(0.0, 10.0, 30.0)
property vector3d defaultLightPosition: Qt.vector3d(0.0, 30.0, 11.0)
property vector3d lightPosition: defaultLightPosition
property vector3d cameraPos: defaultCameraPosition
property vector3d lightPos: defaultLightPosition
property real lightPosMultiplier: 1.75
property int door_left: 1
property int door_right: 2
property int door_trunk: 4
property int door_hood: 8
property bool highlighting: false
property bool doorAction: false
property int highlightType: 0
property int defaultHighlight: 99
// Preset camera positions for highlights
// Light positions can use the same vectors, but with a multiplier to move it further or closer
// Lamp highlights
property vector3d positionFrontLeftHigh: Qt.vector3d(5.0, 4.0, 15.0) // Left headlight
property vector3d positionFrontRightHigh: Qt.vector3d(-5.0, 4.0, 15.0) // Right headlight
property vector3d positionFrontLeftLow: Qt.vector3d(3.0, 2.0, 15.0) // Left day light
property vector3d positionFrontRightLow: Qt.vector3d(-3.0, 2.0, 15.0) // Right day light
property vector3d positionRearLeft: Qt.vector3d(5.0, 5.0, -15.0) // Left tail light
property vector3d positionRearRight: Qt.vector3d(-5.0, 5.0, -15.0) // Right tail light
// Tire highlights
property vector3d positionLeftRear: Qt.vector3d(10.0, 2.0, -12.5)
property vector3d positionLeftFront: Qt.vector3d(10.0, 2.0, 12.5)
property vector3d positionRightRear: Qt.vector3d(-10.0, 2.0, -12.5)
property vector3d positionRightFront: Qt.vector3d(-10.0, 2.0, 12.5)
// Door highlights
property vector3d positionLeft: Qt.vector3d(35.0, 10.0, 0.0) // Doors on the left
property vector3d positionRight: Qt.vector3d(-35.0, 10.0, 0.0) // Doors on the right
property vector3d positionTop: Qt.vector3d(0.0, 40.0, 1.0) // Doors on both sides
property vector3d positionBack: Qt.vector3d(0.0, 20.0, -20.0) // Trunk
property vector3d positionFront: Qt.vector3d(0.0, 20.0, 20.0) // Hood
// Original
property color bodyColor: Qt.rgba(0.6270588, 0.04137255, 0.04137255, 1.0)
property color interiorColor: Qt.rgba(0.17, 0.17, 0.18, 1.0)
property color highlightColor: "orange"
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 45
aspectRatio: scene.width / scene.height
nearPlane: 0.1
farPlane: 100.0
position: defaultCameraPosition
upVector: Qt.vector3d(0.0, 1.0, 0.0)
viewCenter: Qt.vector3d(0.0, 0.0, 0.0)
}
Entity {
components: [
Transform {
translation: lightPosition
},
PointLight {
color: "white"
intensity: 1.0
}
]
}
RenderSettings {
Viewport {
RenderSurfaceSelector {