<commit_before>/*
 * Copyright (C) 2016 <NAME>
 * All rights reserved.
 */
#include "player.h"

// For Server
#include "cwrap/redcrane.hpp"

#include "common/log.h"

// All of this is in meters
// My own height, slightly smaller radius
#define PLAYER_HEIGHT 1.63f
#define PLAYER_RADIUS 0.24f
// This value is a little bit larger then my own measured length from the tip of
// the finger to the middle of the head.
#define PLAYER_REACH  1.0f
// Height of things the player can step over easily, this is the size of the ray
// and is part of the player's total height.
#define PLAYER_SHOE_SIZE 0.15f

#define PLAYER_CAPSULE_HEIGHT \
  (PLAYER_HEIGHT - 2 * PLAYER_RADIUS - PLAYER_SHOE_SIZE)

// Yer average Slavs' Squating
#define CROUCHED_HEIGHT .9652f
#define CROUCHED_CAPSULE_HEIGHT \
  (CROUCHED_HEIGHT - 2 * PLAYER_RADIUS - PLAYER_SHOE_SIZE)

// Make sure these values aren't stupid
static_assert(PLAYER_CAPSULE_HEIGHT > 0.0f,
              "Standing player must have height");
static_assert(CROUCHED_CAPSULE_HEIGHT > 0.0f,
              "Crouched player must have height");

#define PLAYER_SPEED 1.0f
#define CROUCHED_SPEED 0.5f

#define PLAYER_STEP_RATE 0.65f;
#define CROUCHED_STEP_RATE 1.15f;

// 78 kg mass person
#define PLAYER_MASS 78.0f

#define PLAYER_CROUCH_HEIGHT_DELTA ((PLAYER_HEIGHT - CROUCHED_HEIGHT) / 2.0f)

namespace redc
{
  Player_Controller::Player_Controller()
    : inited_(false), ghost_(), shape_(PLAYER_RADIUS, PLAYER_CAPSULE_HEIGHT),
      crouch_shape_(PLAYER_RADIUS, CROUCHED_CAPSULE_HEIGHT),
      jump_velocity_()
  {
    server = nullptr;

    // Initialize velocity and impulse to zero
    jump_velocity_.setZero();

    last_normal_.setZero();

    // Set it to a unit vector going straight upwards
    last_normal_.setY(1.0f);

    // Player state
    state = Player_State::Grounded;

    // Transform
    btTransform trans;
    trans.setIdentity();
    trans.setOrigin(btVector3(0.0f, 1.0f, 0.0f));
    ghost_.setWorldTransform(trans);

    // Shape
    ghost_.setCollisionShape(&shape_);
    set_normal_props();
<commit_msg>Update formatting in player.cpp<commit_after>/*
 * Copyright (C) 2016 <NAME>
 * All rights reserved.
 */
#include "player.h"

// For Server
#include "cwrap/redcrane.hpp"

#include "common/log.h"

// All of this is in meters
// My own height, slightly smaller radius
#define PLAYER_HEIGHT 1.63f
#define PLAYER_RADIUS 0.24f
// This value is a little bit larger then my own measured length from the tip of
// the finger to the middle of the head.
#define PLAYER_REACH  1.0f
// Height of things the player can step over easily, this is the size of the ray
// and is part of the player's total height.
#define PLAYER_SHOE_SIZE 0.15f

#define PLAYER_CAPSULE_HEIGHT \
  (PLAYER_HEIGHT - 2 * PLAYER_RADIUS - PLAYER_SHOE_SIZE)

// Yer average Slavs' Squating
#define CROUCHED_HEIGHT .9652f
#define CROUCHED_CAPSULE_HEIGHT \
  (CROUCHED_HEIGHT - 2 * PLAYER_RADIUS - PLAYER_SHOE_SIZE)

// Make sure these values aren't stupid
static_assert(PLAYER_CAPSULE_HEIGHT > 0.0f,
              "Standing player must have height");
static_assert(CROUCHED_CAPSULE_HEIGHT > 0.0f,
              "Crouched player must have height");

#define PLAYER_SPEED 1.0f
#define CROUCHED_SPEED 0.5f

#define PLAYER_STEP_RATE 0.65f;
#define CROUCHED_STEP_RATE 1.15f;

// 78 kg mass person
#define PLAYER_MASS 78.0f

#define PLAYER_CROUCH_HEIGHT_DELTA ((PLAYER_HEIGHT - CROUCHED_HEIGHT) / 2.0f)

namespace redc
{
  Player_Controller::Player_Controller()
    : inited_(false), ghost_(), shape_(PLAYER_RADIUS, PLAYER_CAPSULE_HEIGHT),
      crouch_shape_(PLAYER_RADIUS, CROUCHED_CAPSULE_HEIGHT), jump_velocity_()
  {
    server = nullptr;

    // Initialize velocity and impulse to zero
    jump_velocity_.setZero();

    last_normal_.setZero();

    // Set it to a unit vector going straight upwards
    last_normal_.setY(1.0f);

    // Player state
    state = Player_State::Grounded;

    // Transform
    btTransform trans;
    trans.setIdentity();
    trans.setOrigin(btVector3(0.0f, 1.0f, 0.0f));
    ghost_.setWorldTransform(trans);

    // Shape
    ghost_.setCollisionShape(&shape_);
    set_normal_props();

{'fraction_non_alphanumeric': 0.0944900918318028, 'fraction_numerical': 0.024649589173513776, 'mean_word_length': 3.708759954493743, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1301873', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1457, 'n_words': 395}