Created
December 21, 2016 04:40
-
-
Save runewake2/2256a3d77724e3606743d7f07f734280 to your computer and use it in GitHub Desktop.
Revisions
-
runewake2 created this gist
Dec 21, 2016 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; public class PhysicsDeformer : MonoBehaviour { public float collisionRadius = 0.1f; public DeformableMesh deformableMesh; // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnCollisionStay(Collision collision) { foreach (var contact in collision.contacts) { deformableMesh.AddDepression(contact.point, collisionRadius); } } }