<commit_before>﻿//Holobounds.cs
//Created by <NAME> on 22.06.16
//Playspace manager and access point

using UnityEngine;
using Holojam.Network;

namespace Holojam{
   [ExecuteInEditMode]
   public class Holobounds : MonoBehaviour{
      public Vector2[] bounds = new Vector2[4]; //Raw corners (FL, FR, BR, BL)
      public float floor = 0; //Floor Y
      public float ceiling = 3; //Ceiling Y -- not used for tracking
      public bool localSpace = false;

      public HolojamView calibrator; //Tracked tool for setting values

      //Reference values & functions

      public float area{get{
         float a = 0;
         for(int i=0;i<4;++i){
            Vector2 p0 = bounds[i], p1 = bounds[(i+1)%4];
            //Add area under each segment (subtracting if underneath)
            a += (p1.x-p0.x) * (p1.y+p0.y) * 0.5f;
         }
         return Mathf.Abs(a); //Result may be negative depending on orientation
      }}
      public float xRatio{get{ //Ratio between side medians
         return Vector2.Distance(Side(3),Side(1)) / Vector2.Distance(Side(0),Side(2));
      }}
      //Bounds rotation
      public Quaternion rotation{get{
         return localSpace && transform.parent!=null?
            transform.parent.rotation:Quaternion.identity;
      }}

      //Offset from center of floor
      public Vector3 Offset(Vector3 o){
         Vector3 f = Floor(0.25f*(bounds[0]+bounds[1]+bounds[2]+bounds[3]))+o;
         return localSpace && transform.parent!=null?
            transform.parent.TransformPoint(f):f;
      }

      //Bounding corner points
      public Vector3 Corner(int i){return Floor(bounds[i]);}
      public Vector3 Upper(int i){return Ceiling(bounds[i]);}

      //Distance from input point to edge of bounds
      public float Distance(Vector3 target){ 
         //Do calculations in 2D
         Vector2 t = new Vector2(target.x,target.z);<commit_msg>Holobounds patch<commit_after>﻿//Holobounds.cs
//Created by <NAME> on 22.06.16
//Playspace manager and access point

using UnityEngine;
using Holojam.Network;

namespace Holojam{
   [ExecuteInEditMode]
   public class Holobounds : MonoBehaviour{
      public Vector2[] bounds = new Vector2[4]; //Raw corners (FL, FR, BR, BL)
      public float floor = 0; //Floor Y
      public float ceiling = 3; //Ceiling Y -- not used for tracking
      public bool localSpace = false;

      public HolojamView calibrator; //Tracked tool for setting values

      //Reference values & functions

      public float area{get{
         float a = 0;
         for(int i=0;i<4;++i){
            Vector2 p0 = bounds[i], p1 = bounds[(i+1)%4];
            //Add area under each segment (subtracting if underneath)
            a += (p1.x-p0.x) * (p1.y+p0.y) * 0.5f;
         }
         return Mathf.Abs(a); //Result may be negative depending on orientation
      }}
      public float xRatio{get{ //Ratio between side medians
         return Vector2.Distance(Side(3),Side(1)) / Vector2.Distance(Side(0),Side(2));
      }}
      //Bounds rotation
      public Quaternion rotation{get{
         return localSpace && transform.parent!=null?
            transform.parent.rotation:Quaternion.identity;
      }}

      //Offset from center of floor
      public Vector3 Offset(Vector3 o){
         Vector3 f = 0.25f*(Corner(0)+Corner(1)+Corner(2)+Corner(3))+o;
         return f;
      }

      //Bounding corner points
      public Vector3 Corner(int i){return Floor(bounds[i]);}
      public Vector3 Upper(int i){return Ceiling(bounds[i]);}

      //Distance from input point to edge of bounds
      public float Distance(Vector3 target){ 
         //Do calculations in 2D
         Vector2 t = new Vector2(target.x,target.z);
{'fraction_non_alphanumeric': 0.11635475996745322, 'fraction_numerical': 0.025494982370490915, 'mean_word_length': 2.4858223062381852, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3858247', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1093, 'n_words': 330}