summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Physics/PhysicsHelper.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-11-02 19:53:12 +0800
committerchai <chaifix@163.com>2020-11-02 19:53:12 +0800
commit3708d0a07ce43c3d98a0171eacfa9c370c873f96 (patch)
tree728f72bd8e6c464c6f56db7b08755031f685c45c /Assets/Scripts/Physics/PhysicsHelper.cs
parent64061aee5d7849f348f07b78fc3f96ad7555c147 (diff)
*受击
Diffstat (limited to 'Assets/Scripts/Physics/PhysicsHelper.cs')
-rw-r--r--Assets/Scripts/Physics/PhysicsHelper.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Assets/Scripts/Physics/PhysicsHelper.cs b/Assets/Scripts/Physics/PhysicsHelper.cs
index 821241e3..44bf513e 100644
--- a/Assets/Scripts/Physics/PhysicsHelper.cs
+++ b/Assets/Scripts/Physics/PhysicsHelper.cs
@@ -19,6 +19,7 @@ public struct PhysicsCollisionInfo
public PhysicsPrimitive prim1;
public PhysicsPrimitive prim2;
public Vector3 contact;
+ public Vector3 size;
}
public sealed class PhysicsHelper
@@ -63,6 +64,7 @@ public sealed class PhysicsHelper
float top = Mathf.Min(box1.Top, box2.Top);
float bottom = Mathf.Max(box1.Bottom, box2.Bottom);
info.contact = new Vector3((left + right )/2f, (top + bottom)/2f, 0 );
+ info.size = new Vector3(right - left, top - bottom, 1);
return true;
}