CarChallenge 3D Demo
import QtQuick 2.0
import Felgo 3.0
EntityBase {
id: entity
entityType: "wall"
BoxCollider {
id: boxCollider
bodyType: Body.Static
}
Rectangle {
anchors.fill: parent
color: "brown"
visible: false
}
property string wallType: wallTypeEnum.top
property variant wallTypeEnum: {
'top': 0,
'right': 1,
'left': 2,
'bottom': 3,
}
function calculateRotationOffset() {
if(wallType == wallTypeEnum.bottom)
return 0
else if(wallType == wallTypeEnum.left)
return 90
else if(wallType == wallTypeEnum.top)
return 180
else if(wallType == wallTypeEnum.right)
return 270
}
Render3D {
x: -(parent.x + entity.width/2)
y: -(parent.y + entity.height/2)
zOffset: -20*scaleOffset
scaleOffset: 0.4276
source: "../../assets/3d/outerwall.obj"
texture: "../../assets/3d/walloutT.jpg"
textureScale: 7
rotation: entity.calculateRotationOffset()
rotationAxis: Qt.vector3d(0,0,1)
rotationOffset: 270
rotationAxisOffset: Qt.vector3d(1,0,0)
}