Commit 9766618c authored by Chae Ho Shin's avatar Chae Ho Shin

ignore self-collisions or self-worldline-collisions

parent cf50696c
......@@ -3257,7 +3257,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: eb322bc5933761d4fb98f8561eadae28, type: 2}
- {fileID: 2100000, guid: 7286fb01c3bf28349bf3a51860aefb00, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
......
......@@ -80,6 +80,7 @@ public class ExtrudedMesh : MonoBehaviour
clone.transform.GetChild(0).gameObject.AddComponent<RuntimeCSGFlatlandObject>();
clone.layer = 8;
clone.transform.GetChild(0).gameObject.layer = 8;
Physics.IgnoreCollision(clone.GetComponentInChildren<MeshCollider>(), GetComponent<MeshCollider>());
Destroy(clone, 30);
prevtime = sections[sections.Count - 1].time;
}
......
......@@ -44,6 +44,11 @@ public class FlatlandMovement : MonoBehaviour
/// </summary>
Queue<float> pathVelocitys = new Queue<float>();
protected void Start()
{
Physics.IgnoreLayerCollision(0, 1);
}
protected void FixedUpdate()
{
if (isAutoMove)
......@@ -200,7 +205,7 @@ public class FlatlandMovement : MonoBehaviour
Vector3 finaldeltav = new Vector3((float)(deltav[1] / tt), 0.0f, (float)(deltav[2] / tt));
//this.v = finaldeltav;
this.v = finaldeltav;
}
......@@ -267,7 +272,7 @@ public class FlatlandMovement : MonoBehaviour
/// <param name="collision"></param>
public virtual void OnCollisionEnterchild(Collision collision)
{
Debug.Log("Collision! ~~~~~~~~~~~~~~~~" + theobject.transform.parent.name + "~~~~~~~~~~~~~~~~~~~~~~" + collision.transform.parent.name);
}
/// <summary>
/// 나갔을때 호출
......
......@@ -11,6 +11,7 @@ public class Planemovement : FlatlandMovement
void Start()
{
base.Start();
//Renderer r = theobject.GetComponent<Renderer>();
//Color materialColor = r.material.color;
//r.material.color = Color.clear;
......
......@@ -21,6 +21,7 @@ public class PlayerMovement : FlatlandMovement,IInteractor
// Start is called before the first frame update
void Start()
{
base.Start();
v = new Vector3(0.0f, 0.0f, 0.0f);
gamma = 1.0f;
cnt = 0;
......@@ -32,6 +33,7 @@ public class PlayerMovement : FlatlandMovement,IInteractor
backgroundStartScale = background.transform.localScale;
interactiveObjects = new List<InteractiveObject>();
}
void Update()
......@@ -179,7 +181,6 @@ public class PlayerMovement : FlatlandMovement,IInteractor
if (collision.transform.parent != null)
{
Debug.Log("Collision");
InteractiveObject x = collision.transform.parent.gameObject.GetComponent<InteractiveObject>();
if (x)
{
......
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