Example #1
0
 public UndoArgs(DeformableBase bd, float h, float t, float[] rl, int ts)
 {
     deformable = bd;
     height     = h;
     thickness  = t;
     radiusList = rl;
     timeStamp  = ts;
 }
Example #2
0
    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;
        }
    }
Example #3
0
    // 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);
    }
Example #4
0
 public BendableMesh(Mesh _mesh, Transform _meshTransform, Transform _bendTransform)
 {
     mesh            = _mesh;
     origVerts       = _mesh.vertices;
     seperatingIndex = DeformableBase.FindClosestVertex(_meshTransform.InverseTransformPoint(_bendTransform.position), origVerts);
 }
Example #5
0
 public void DeformCallBack(DeformableBase db)
 {
     weights = db.WeightList.ToArray();
 }