Provides the position when rotating towards a direction usable for follow or target cameras. More...
Import Statement: | import Felgo 3.0 |
Since: | Felgo 2.5.0 |
Inherits: |
The TargetCamTransformHelper provides the position when rotating towards a direction usable for follow or target cameras.
It outputs the properties targetX, targetY, targetZ given on the player position and rotation and the cameraDistanceHorizontal and cameraDistanceVertical.
Note: Qt3D and also the Felgo 3D Components are in a Tech Preview state and may change its API in future versions.
You can connect this component with the Scene3D camera properties like in this example:
import Felgo 3.0 import QtQuick 2.0 GameWindow { // is needed by the Render3D component - to this entity the Entity objects are added to property alias rootEntity: scene3D.rootEntity Scene { id: gameScene Level { EntityBase { id: mainPlayer }// EntityBase }// Level }// GameScene TargetCamTransformHelper { id: targetCamHelper player: mainPlayer // move the camera behind the current player rotation by this value cameraDistanceHorizontal: -130 // move the camera up the current player position by this value cameraDistanceHorizontal: -40 } Scene3D { id: scene3D cameraPosition: targetCamHelper.targetPosition } }
For a complete game how to use Scene3D together with the Render3D component, see the CarChallenge 3D Demo.
cameraDistanceHorizontal : real |
Moves the camera behind the current player rotation by this value.
cameraDistanceVertical : real |
Moves the camera up the current player position by this value.
player : Item |
The player Item containing the source of position and rotation calculations.
targetPosition : vector3d |
targetZ : real |
Output target z position.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: