Commit 00600790 authored by 16이진형's avatar 16이진형

충돌 임시 공식

parent e6bc3464
......@@ -1103,6 +1103,7 @@ MonoBehaviour:
gamma: 1
time: 0
theobject: {fileID: 439858915}
mass: 10
starttime: 10
otherclock: {fileID: 0}
--- !u!4 &535323109
......@@ -1423,6 +1424,7 @@ MonoBehaviour:
gamma: 1
time: 0
theobject: {fileID: 1320474661}
mass: 10
background: {fileID: 1713675711}
uiManager: {fileID: 394305455}
--- !u!4 &739347347
......@@ -2653,6 +2655,7 @@ MonoBehaviour:
gamma: 1
time: 0
theobject: {fileID: 839664886}
mass: 10
starttime: 0
otherclock: {fileID: 535323108}
--- !u!4 &1094934750
......
......@@ -6,7 +6,7 @@ using MathNet.Numerics.LinearAlgebra.Double;
public static class Constants
{
public static double c => 9; // speed of light.
public static double c => 3; // speed of light.
public static int alphatinterval => 50;
public static double Gamma(double v)
{
......
......@@ -31,6 +31,8 @@ public class FlatlandMovement : MonoBehaviour
public GameObject theobject;
public float mass = 10.0f;
// 마우스로 이동할때 하용하는 변수들.
bool isAutoMove = false;
......@@ -290,10 +292,21 @@ public class FlatlandMovement : MonoBehaviour
collisions.Add(collision.gameObject.GetComponent<ExtrudedMesh>().hash);
FlatlandMovement other = collision.transform.parent.GetComponent<FlatlandMovement>();
Vector3 col = (other.v - this.v);
var tmp = collision.GetContact(0).normal;
tmp = new Vector3(tmp.x, 0, tmp.z);
tmp = tmp.normalized;
tmp *= 100;
float inner = SpaceInnerPorduct(tmp, col.normalized);
inner = Mathf.Abs(inner);
tmp *= col.magnitude*inner*other.mass;
collisionforce = tmp;
alpha += collisionforce;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment