Beispiel #1
0
 public void AddBoxCollider(ref CSBoxCollider v)
 {
     if (enabled)
     {
         m_box_colliders.Add(v);
     }
 }
    static public void BuildBoxCollider(ref CSBoxCollider cscol, Transform t, Vector3 size, int id)
    {
        BuildBox(ref cscol.shape, t.localToWorldMatrix, size);

        Vector3 scaled = new Vector3(
            size.x * t.localScale.x,
            size.y * t.localScale.y,
            size.z * t.localScale.z);
        float s = Mathf.Max(Mathf.Max(scaled.x, scaled.y), scaled.z);

        cscol.info.aabb.center  = t.position;
        cscol.info.aabb.extents = Vector3.one * s * 1.415f;
        cscol.info.owner_objid  = id;
    }
 public void AddBoxCollider(ref CSBoxCollider v)
 {
     if (enabled) m_box_colliders.Add(v);
 }