<commit_before>
import THREE = require("three")

import { b2Utils } from "../b2utils";
import { Box2D } from "../thirdparty/box2d";

/**
 * An object that manages drawing debug shapes for bodies in a Box2D world.
 * @namespace
 */
export class ThreeJsDebugDraw
{
	// nested array, indexed by vert count
	private meshPools: { [s: string]: THREE.Object3D[] } = {};
	private poolIndices: { [s: string]: number } = {};

	private drawFlags: number = 0;

	public transform: THREE.Object3D = new THREE.Object3D();

	private getGeometry(color: Box2D.b2Color, vertCount: number): THREE.Geometry
	{
		if (!this.meshPools[vertCount])
		{
			this.meshPools[vertCount] = [];
			this.poolIndices[vertCount] = 0;
		}

		var pool = this.meshPools[vertCount];

		var mesh: THREE.Object3D;
		var geometry: THREE.Geometry;

		var index = this.poolIndices[vertCount]++;
		if (!pool[index])
		{
			geometry = new THREE.Geometry();
			for (var i = 0; i < vertCount; i++)
			{
				geometry.vertices.push(new THREE.Vector3());
			}

			var lineMaterial = new THREE.LineBasicMaterial({ color: 0xffffff });
			mesh = new THREE.Line(geometry, lineMaterial);

			pool[index] = mesh;
			this.transform.add(mesh);
		}
		else
		{
			mesh = pool[index];

			var material = pool[index].material;
			material.color.setHex(color.color);

			geometry = pool[index].geometry;
		}

		mesh.visible = true;

		return geometry;
	};

	public startDrawing(): void
	{
		// reset mesh counters
		for (var i in this.meshPools)
		{
			this.poolIndices[i] = 0;
		}
	};
<commit_msg>fix TS warnings in box2d debugger<commit_after>
import THREE = require("three")

import { b2Utils } from "../b2utils";
import { Box2D } from "../thirdparty/box2d";

/**
 * An object that manages drawing debug shapes for bodies in a Box2D world.
 * @namespace
 */
export class ThreeJsDebugDraw
{
	// nested array, indexed by vert count
	private meshPools: { [s: string]: (THREE.Mesh|THREE.Line)[] } = {};
	private poolIndices: { [s: string]: number } = {};

	private drawFlags: number = 0;

	public transform: THREE.Object3D = new THREE.Object3D();

	private getGeometry(color: Box2D.b2Color, vertCount: number): THREE.Geometry
	{
		if (!this.meshPools[vertCount])
		{
			this.meshPools[vertCount] = [];
			this.poolIndices[vertCount] = 0;
		}

		var pool = this.meshPools[vertCount];

		var mesh: THREE.Mesh|THREE.Line;
		var geometry: THREE.Geometry;

		var index = this.poolIndices[vertCount]++;
		if (!pool[index])
		{
			geometry = new THREE.Geometry();
			for (var i = 0; i < vertCount; i++)
			{
				geometry.vertices.push(new THREE.Vector3());
			}

			var lineMaterial = new THREE.LineBasicMaterial({ color: 0xffffff });
			mesh = new THREE.Line(geometry, lineMaterial);

			pool[index] = mesh;
			this.transform.add(mesh);
		}
		else
		{
			mesh = pool[index];

			var material = pool[index].material;
			(material as THREE.LineBasicMaterial).color.setHex(color.color);

			geometry = pool[index].geometry as THREE.Geometry;
		}

		mesh.visible = true;

		return geometry;
	};

	public startDrawing(): void
	{
		// reset mesh counters
		for (var i in this.meshPools)
		{
			this.poolIndices[i] = 0;
		}
	};

{'fraction_non_alphanumeric': 0.14226738647189585, 'fraction_numerical': 0.010479517307081613, 'mean_word_length': 3.5258620689655173, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6177219', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1052, 'n_words': 269}