chrono::utils::ChChaseCamera Class Reference

Description

Utility class for a generic chase camera which can be associated with any ChBody in a Chrono system.

This camera tracks a given point on the associated body (typically the chassis of a vehicle).

#include <ChUtilsChaseCamera.h>

Public Types

enum  State {
  Chase, Follow, Track, Inside,
  Free
}
 Chase camera operation mode. More...
 

Public Member Functions

 ChChaseCamera (std::shared_ptr< ChBody > chassis)
 Construct a chase camera associated with the given body.
 
void Initialize (const ChVector<> &ptOnChassis, const ChCoordsys<> &driverCoordsys, double chaseDist, double chaseHeight, const ChVector<> &up=ChVector<>(0, 0, 1), const ChVector<> &fwd=ChVector<>(1, 0, 0))
 Initialize the chase camera. More...
 
void Update (double step)
 Update internal dynamics.
 
void Zoom (int val)
 Control chase distance.
 
void Turn (int val)
 Control angle (in horizontal plane) around target point.
 
void Raise (int val)
 Control camera height (for Free mode).
 
void SetState (State s)
 Set the chase camera operation mode.
 
void SetCameraPos (const ChVector<> &pos)
 Overwrite chase camera position.
 
void SetCameraAngle (double angle)
 Overwrite chase camera angle (in horizontal plane).
 
State GetState () const
 Get the current operation mode.
 
const std::string & GetStateName () const
 Return a string description of the current operation mode.
 
ChVector GetCameraPos () const
 Get current camera location (expressed in the world frame).
 
ChVector GetTargetPos () const
 Get current location of the target point (expressed in the world frame).
 
void SetHorizGain (double g)
 Set internal dynamics gain for camera movement in the horizontal plane.
 
void SetVertGain (double g)
 Set internal dynamics gain for camera movement in the vertical direction.
 
void SetMultLimits (double minMult, double maxMult)
 Set zoom limits.
 
void SetChassis (std::shared_ptr< ChBody > chassis)
 Change the associated body.
 
void SetTargetPoint (const ChVector<> &point)
 Set the target point on the associated body.
 
void SetChaseDistance (double dist)
 Set the chase distance.
 
void SetChaseHeight (double height)
 Set the chase height.
 

Member Enumeration Documentation

◆ State

Chase camera operation mode.

Enumerator
Chase 

camera attached to a "flexible cantilever" behind the body

Follow 

camera attached to a "flexible beam" articulated on the body

Track 

camera is fixed and tracks the body

Inside 

camera is rigidly fixed at a given point on the body

Free 

detached camera

Member Function Documentation

◆ Initialize()

void chrono::utils::ChChaseCamera::Initialize ( const ChVector<> &  ptOnChassis,
const ChCoordsys<> &  driverCoordsys,
double  chaseDist,
double  chaseHeight,
const ChVector<> &  up = ChVector<>(0, 0, 1),
const ChVector<> &  fwd = ChVector<>(1, 0, 0) 
)

Initialize the chase camera.

Parameters
ptOnChassistarget point on associated body
driverCoordsyslocal driver position (for `Inside` mode)
chaseDistbase value for distance behind target point on associated body
chaseHeightbase value for height above target point on associated body
upvertical direction of the world frame
fwdforward direction of the world frame

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/utils/ChUtilsChaseCamera.h
  • /builds/uwsbel/chrono/src/chrono/utils/ChUtilsChaseCamera.cpp