<commit_before>import React from 'react';
import TankBody from './TankBody';
import Turret from './Turret';

class Tank extends React.Component {

  constructor(props) {
    super(props);
    this.position = props.position || '0 3 0';
    this.rotation = props.rotation || '0 0 0';
    this.bodyLength = 5;
    this.bodyWidth = 3;
    this.state = {
      turretAngle: 0,
      control: 'turret'
    }

    setInterval(() => {
      this.setState({ 
        turretAngle: Math.random() * 60 - 30
      })
    }, 1000)
  }

  render () {
    if(this.state.control === 'body') {
      return (
        <a-entity id='tank'>
          <TankBody 
          activeControl={true}
          position={this.position}
          rotation={this.rotation}
          bodyLength={this.bodyLength}
          bodyWidth={this.bodyWidth}>
            <Turret 
            position={'0 2.75 0'}
            turretRadius={this.bodyWidth/2}
            turretAngle={this.state.turretAngle}/>
          </TankBody>
        </a-entity>
      )
    } else {
      return (
        <a-entity id='tank'>
          <TankBody 
          position={this.position}
          rotation={this.rotation}
          // velocity={this.state.velocity} TODO: set velocity and heading based on incoming state
          // heading={this.state.heading}
          bodyLength={this.bodyLength}
          bodyWidth={this.bodyWidth}>
            <Turret 
            activeControl={true}
            position={'0 2.75 0'}
            turretRadius={this.bodyWidth/2}/>
          </TankBody>
        </a-entity>
      )
    }
  }
}<commit_msg>Hardcode initial position of tank containers to ensure they stay locked to the global frame<commit_after>import React from 'react';
import TankBody from './TankBody';
import Turret from './Turret';

class Tank extends React.Component {

  constructor(props) {
    super(props);
    this.position = props.position || '0 3 0';
    this.rotation = props.rotation || '0 0 0';
    this.bodyLength = 5;
    this.bodyWidth = 3;
    this.state = {
      turretAngle: 0,
      control: 'body'
    }

    setInterval(() => {
      this.setState({ 
        turretAngle: Math.random() * 60 - 30
      })
    }, 1000)
  }

  render () {
    if(this.state.control === 'body') {
      return (
        <a-entity id='tank' position='0 0 0' rotation='0 0 0'>
          <TankBody 
          activeControl={true}
          position={this.position}
          rotation={this.rotation}
          bodyLength={this.bodyLength}
          bodyWidth={this.bodyWidth}>
            <Turret 
            position={'0 2.75 0'}
            turretRadius={this.bodyWidth/2}
            turretAngle={this.state.turretAngle}/>
          </TankBody>
        </a-entity>
      )
    } else {
      return (
        <a-entity id='tank' position='0 0 0' rotation='0 0 0'>
          <TankBody 
          position={this.position}
          rotation={this.rotation}
          // velocity={this.state.velocity} TODO: set velocity and heading based on incoming state
          // heading={this.state.heading}
          bodyLength={this.bodyLength}
          bodyWidth={this.bodyWidth}>
            <Turret 
            activeControl={true}
            position={'0 2.75 0'}
            turretRadius={this.bodyWidth/2}/>
          </TankBody>
        </a-entity>
      )
    }
  }
}
{'fraction_non_alphanumeric': 0.13221153846153846, 'fraction_numerical': 0.021033653846153848, 'mean_word_length': 1.833191489361702, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '1530187', 'n_tokens_mistral': 1044, 'n_tokens_neox': 973, 'n_words': 210}