public UndoArgs(DeformableBase bd, float h, float t, float[] rl, int ts) { deformable = bd; height = h; thickness = t; radiusList = rl; timeStamp = ts; }
public void EnableCut(Transform cuttingSrc, Collider cuttingSrcCollider) { canCut = true; cuttingSrcExtents = cuttingSrcCollider.bounds.extents.magnitude; this.cuttingSrc = cuttingSrc.GetComponent <CuttingTool>(); hits = 0; Heating heatScript = GetComponent <Heating>(); hitsToCut = (heatScript != null ? (int)(19.0f * (1.0f - DeformableBase.FindClosestHeatFactor(heatScript, cuttingSrc.position))) + 1 : defaultHitsToCut); if (deformableMesh) { deformableMesh.enabled = false; } }
// Use this for initialization public void Initialize() { if (!target) { target = transform.parent.parent.gameObject; } heatScript = target.GetComponent <Heating>(); ProjectTarget(); heatFactor = DeformableBase.FindClosestHeatFactor(heatScript, target.transform.InverseTransformPoint(transform.position)); ts_transform = new ts_Transform(transform); ts_targetTransform = new ts_Transform(target.transform); }
public BendableMesh(Mesh _mesh, Transform _meshTransform, Transform _bendTransform) { mesh = _mesh; origVerts = _mesh.vertices; seperatingIndex = DeformableBase.FindClosestVertex(_meshTransform.InverseTransformPoint(_bendTransform.position), origVerts); }
public void DeformCallBack(DeformableBase db) { weights = db.WeightList.ToArray(); }