Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

TargetCamTransformHelper

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:

Item

Properties

Detailed Description

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.

Example Usage

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.

Property Documentation

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

Output vector3d value containing the target position concluding of targetX, targetY, targetZ.


targetX : alias

Output target x position.


targetY : alias

Output target y position.


targetZ : real

Output target z position.


Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded