<commit_before>// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: <NAME>
// =============================================================================
//
// Generic chase camera.  Such a camera tracks a specified point on a specified
// body. It supports three different modes:
// - 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 fixed at a given point on the body.
//
// TODO: 
// - relax current assumption that the body forward direction is in the positive
//   X direction.
//
// =============================================================================

#include "ChChaseCamera.h"

namespace chrono {
namespace utils {


// -----------------------------------------------------------------------------
// Static variables
// -----------------------------------------------------------------------------

const double ChChaseCamera::m_maxTrackDist2 = 100 * 100;
const std::string ChChaseCamera::m_stateNames[] = { "Chase", "Follow", "Track", "Inside" };

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
ChChaseCamera::ChChaseCamera(const ChSharedBodyPtr chassis)
: m_chassis(chassis),
  m_mult(1),
  m_maxMult(10),
  m_minMult(0.5f),
  m_horizGain(4.0f),
  m_vertGain(2.0f),
  m_state(State::Chase)
{
  Initialize(ChVector<>(0, 0, 0), ChCoordsys<>(), 5, 1);
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void ChChaseCamera::Initialize(const ChVector<>&   ptOnChassis,
                               const ChCoordsys<>& driverCoordsys,
                               double              chaseDist,
                               double              chaseHeight)
{
  m_ptOnChassis = ptOnChassis;
  m_driverCsys = driverCoordsys;
  m_dist = chaseDist;
  m_height = chaseHeight;
  m_angle = 0;

  // if(Z_up)<commit_msg>Fix for GCC (scoped enum)<commit_after>// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: <NAME>
// =============================================================================
//
// Generic chase camera.  Such a camera tracks a specified point on a specified
// body. It supports three different modes:
// - 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 fixed at a given point on the body.
//
// TODO: 
// - relax current assumption that the body forward direction is in the positive
//   X direction.
//
// =============================================================================

#include "ChChaseCamera.h"

namespace chrono {
namespace utils {


// -----------------------------------------------------------------------------
// Static variables
// -----------------------------------------------------------------------------

const double ChChaseCamera::m_maxTrackDist2 = 100 * 100;
const std::string ChChaseCamera::m_stateNames[] = { "Chase", "Follow", "Track", "Inside" };

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
ChChaseCamera::ChChaseCamera(const ChSharedBodyPtr chassis)
: m_chassis(chassis),
  m_mult(1),
  m_maxMult(10),
  m_minMult(0.5f),
  m_horizGain(4.0f),
  m_vertGain(2.0f),
  m_state(Chase)
{
  Initialize(ChVector<>(0, 0, 0), ChCoordsys<>(), 5, 1);
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void ChChaseCamera::Initialize(const ChVector<>&   ptOnChassis,
                               const ChCoordsys<>& driverCoordsys,
                               double              chaseDist,
                               double              chaseHeight)
{
  m_ptOnChassis = ptOnChassis;
  m_driverCsys = driverCoordsys;
  m_dist = chaseDist;
  m_height = chaseHeight;
  m_angle = 0;

  // if(Z_up)
{'fraction_non_alphanumeric': 0.38478048780487806, 'fraction_numerical': 0.010146341463414634, 'mean_word_length': 1.6739697443922796, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2265726', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1171, 'n_words': 351}