<commit_before>var World = require('knit').World;
var Constraint = require('knit').Constraint;
var PointMass = require('knit').PointMass;
var Vector2 = require('minivec').Vector2;
var Rectangle = require('minimath').Rectangle;

$(function() {
	var width = window.innerWidth;
	var height = 700;
	var canvas = $("<canvas/>").css({
	    position: "absolute",
	    top: 0,
	    left: 0,
	    background: 'gray'
	}).appendTo($("body"));

	canvas[0].width = width;
	canvas[0].height = height;

	var context = canvas[0].getContext("2d");



    var clothWidth = 50;
    var clothHeight = 55;
    var start_x = 50;
    var start_y = 100;
    var spacing = 5;
    var stiff = 0.02;
    var tear = 30; //at what distance does a constraint "tear" ? 
    
    var mouseInfluence = 5;
    var mouseScale = 0.5;
    var mouseMaxDist = 15;
    var steps = 6;
    
    var mouseTearInfluence = 4;
    var gravity = 0;
    var mass = 1.;
    var useFloor = true;
    

    var usePins = false; //we need to pin the cloth up if we have gravity enabled

    var world = new World(new Vector2(0, gravity));
    world.removablePins = true;
    world.setPinRemoveInfluence(15);
    
    if (useFloor) {
        world.bounds = new Rectangle(0, 0, width, height);
        world.floor = height-5;
    }
    
    
    $(document).keypress(function(e) {
        world.points = [];
        if (e.which==32)
        	createCloth();
        
    }); 
    $(function() {
        createCloth();
    });
    
    var mouseDown = false;<commit_msg>updating simple.js demo<commit_after>var World = require('knit').World;
var Constraint = require('knit').Constraint;
var PointMass = require('knit').PointMass;
var Vector2 = require('minivec').Vector2;
var Rectangle = require('minimath').Rectangle;

$(function() {
	var width = window.innerWidth;
	var height = 700;
	var canvas = $("<canvas/>").css({
	    position: "absolute",
	    top: 0,
	    left: 0,
	    background: 'gray'
	}).appendTo($("body"));

	canvas[0].width = width;
	canvas[0].height = height;

	var context = canvas[0].getContext("2d");



    var clothWidth = 50;
    var clothHeight = 55;
    var start_x = 50;
    var start_y = 100;
    var spacing = 5;
    var stiff = 0.02;
    var tear = 30; //at what distance does a constraint "tear" ? 
    
    var mouseInfluence = 5;
    var mouseScale = 0.5;
    var mouseMaxDist = 15;
    var steps = 6;
    
    var mouseTearInfluence = 2;
    var gravity = 0;
    var mass = 1.;
    var useFloor = false;
    

    var usePins = false; //we need to pin the cloth up if we have gravity enabled

    var world = new World(new Vector2(0, gravity));
    world.removablePins = true;
    world.setPinRemoveInfluence(15);
    
    if (useFloor) {
        world.bounds = new Rectangle(0, 0, width, height);
        world.floor = height-5;
    }
    
    
    $(document).keypress(function(e) {
        world.points = [];
        if (e.which==32)
        	createCloth();
        
    }); 
    $(function() {
        createCloth();
    });
    
    var mouseDown = false;
{'fraction_non_alphanumeric': 0.13853241197762423, 'fraction_numerical': 0.028956893715037842, 'mean_word_length': 2.4467120181405897, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6844237', 'n_tokens_mistral': 1088, 'n_tokens_neox': 994, 'n_words': 275}