<commit_before>// Never set the rotation of a button
// All units, such as throw, are designed to go in the negative Z
// Add it to a parent/pivot, and rotate that.

var PushButton = function(interactablePlane){
  this.plane = interactablePlane;
  this.plane.returnSpring = this.plane.mass;

  this.longThrow  = -0.05;
  this.shortThrow = -0.03;

  this.pressed = false;
  this.canChangeState = true;
  this.plane.movementConstraints.z = this.releasedConstraint.bind(this);

  this.on('press', function(){
    this.pressed = true;

    this.plane.movementConstraints.z = this.pressedConstraint.bind(this);
    this.plane.mesh.material.color.setHex(0xccccff);

  }.bind(this));
<commit_msg>Button sets default opts for interactablePlane<commit_after>// Never set the rotation of a button
// All units, such as throw, are designed to go in the negative Z
// Add it to a parent/pivot, and rotate that.
// alternatively, we could have it so that constraints themselves are transformed by mesh.matrix
// are there any potential cases where such a thing would be bad?
// - if the base shape had to be rotated to appear correct
// it would be nice to not have to wrap a button, just to rotate it.

var PushButton = function(interactablePlane){
  this.plane = interactablePlane;
  this.plane.returnSpring = this.plane.mass;
  this.plane.moveX = false;
  this.plane.moveY = false;
  this.plane.moveZ = true;

  this.longThrow  = -0.05;
  this.shortThrow = -0.03;

  this.pressed = false;
  this.canChangeState = true;
  this.plane.movementConstraints.z = this.releasedConstraint.bind(this);

  this.on('press', function(){
    this.pressed = true;

    this.plane.movementConstraints.z = this.pressedConstraint.bind(this);
    this.plane.mesh.material.color.setHex(0xccccff);

  }.bind(this));

{'fraction_non_alphanumeric': 0.11092436974789915, 'fraction_numerical': 0.00784313725490196, 'mean_word_length': 3.7248677248677247, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5975653', 'n_tokens_mistral': 571, 'n_tokens_neox': 545, 'n_words': 170}