public static BulletSharp.CollisionFilterGroups ConvertGUIEnumToBulletSharpEnum_CollisionFilterGroups(GUICollisionFilterGroups v)
 {
     BulletSharp.CollisionFilterGroups vout = BulletSharp.CollisionFilterGroups.None;
     if ((v & GUICollisionFilterGroups.DefaultFilter) != 0)
     {
         vout = vout | BulletSharp.CollisionFilterGroups.DefaultFilter;
     }
     if ((v & GUICollisionFilterGroups.StaticFilter) != 0)
     {
         vout = vout | BulletSharp.CollisionFilterGroups.StaticFilter;
     }
     if ((v & GUICollisionFilterGroups.KinematicFilter) != 0)
     {
         vout = vout | BulletSharp.CollisionFilterGroups.KinematicFilter;
     }
     if ((v & GUICollisionFilterGroups.DebrisFilter) != 0)
     {
         vout = vout | BulletSharp.CollisionFilterGroups.DebrisFilter;
     }
     if ((v & GUICollisionFilterGroups.SensorTrigger) != 0)
     {
         vout = vout | BulletSharp.CollisionFilterGroups.SensorTrigger;
     }
     if ((v & GUICollisionFilterGroups.CharacterFilter) != 0)
     {
         vout = vout | BulletSharp.CollisionFilterGroups.CharacterFilter;
     }
     if ((v & GUICollisionFilterGroups.AllFilter) != 0)
     {
         vout = BulletSharp.CollisionFilterGroups.AllFilter;
     }
     return(vout);
 }
Пример #2
0
 public SphereCollider(
     float radius,
     BulletSharp.CollisionFilterGroups group = BulletSharp.CollisionFilterGroups.DefaultFilter,
     BulletSharp.CollisionFilterGroups mask  = BulletSharp.CollisionFilterGroups.AllFilter)
 {
     this.radius  = radius;
     collideGroup = group;
     collideMask  = mask;
 }
Пример #3
0
 public BoxCollider(
     Vector3 halfExtents,
     BulletSharp.CollisionFilterGroups group = BulletSharp.CollisionFilterGroups.DefaultFilter,
     BulletSharp.CollisionFilterGroups mask  = BulletSharp.CollisionFilterGroups.AllFilter)
 {
     this.boxHalfExtents = halfExtents;
     collideGroup        = group;
     collideMask         = mask;
 }
Пример #4
0
 public MeshCollider(
     ColliderMesh colMesh,
     BulletSharp.CollisionFilterGroups group = BulletSharp.CollisionFilterGroups.DefaultFilter,
     BulletSharp.CollisionFilterGroups mask  = BulletSharp.CollisionFilterGroups.AllFilter)
 {
     this.colMesh = colMesh;
     collideGroup = group;
     collideMask  = mask;
 }
Пример #5
0
 public CapsuleCollider(
     float radius,
     float height,
     BulletSharp.CollisionFilterGroups group = BulletSharp.CollisionFilterGroups.DefaultFilter,
     BulletSharp.CollisionFilterGroups mask  = BulletSharp.CollisionFilterGroups.AllFilter)
 {
     this.radius  = radius;
     this.height  = height;
     collideGroup = group;
     collideMask  = mask;
 }
Пример #6
0
 public PlaneCollider(
     float halfExtentsX,
     float halfExtentsZ,
     BulletSharp.CollisionFilterGroups group = BulletSharp.CollisionFilterGroups.DefaultFilter,
     BulletSharp.CollisionFilterGroups mask  = BulletSharp.CollisionFilterGroups.AllFilter)
 {
     this.halfExtentsX = halfExtentsX;
     this.halfExtentsZ = halfExtentsZ;
     collideGroup      = group;
     collideMask       = mask;
 }
Пример #7
0
    public static BulletSharp.CollisionFilterGroups RenderEnumMaskCollisionFilterGroupsField(GUIContent guiContent, BulletSharp.CollisionFilterGroups enumVal)
    {
        GUICollisionFilterGroups g = (GUICollisionFilterGroups)enumVal;

        g = (GUICollisionFilterGroups)EditorGUILayout.EnumFlagsField(guiContent, g);
        return((BulletSharp.CollisionFilterGroups)g);
    }
    public static GUICollisionFilterGroups ConvertBulletSharpEnumToGUIEnum_CollisionFilterGroups(BulletSharp.CollisionFilterGroups v)
    {
        GUICollisionFilterGroups vout = 0;

        if ((v & BulletSharp.CollisionFilterGroups.DefaultFilter) != 0)
        {
            vout = vout | GUICollisionFilterGroups.DefaultFilter;
        }
        if ((v & BulletSharp.CollisionFilterGroups.StaticFilter) != 0)
        {
            vout = vout | GUICollisionFilterGroups.StaticFilter;
        }
        if ((v & BulletSharp.CollisionFilterGroups.KinematicFilter) != 0)
        {
            vout = vout | GUICollisionFilterGroups.KinematicFilter;
        }
        if ((v & BulletSharp.CollisionFilterGroups.DebrisFilter) != 0)
        {
            vout = vout | GUICollisionFilterGroups.DebrisFilter;
        }
        if ((v & BulletSharp.CollisionFilterGroups.SensorTrigger) != 0)
        {
            vout = vout | GUICollisionFilterGroups.SensorTrigger;
        }
        if ((v & BulletSharp.CollisionFilterGroups.CharacterFilter) != 0)
        {
            vout = vout | GUICollisionFilterGroups.CharacterFilter;
        }

        if (v == BulletSharp.CollisionFilterGroups.AllFilter)
        {
            vout = (GUICollisionFilterGroups.DefaultFilter | GUICollisionFilterGroups.StaticFilter | GUICollisionFilterGroups.KinematicFilter |
                    GUICollisionFilterGroups.DebrisFilter | GUICollisionFilterGroups.SensorTrigger | GUICollisionFilterGroups.CharacterFilter);
        }

        return(vout);
    }
    public static BulletSharp.CollisionFilterGroups RenderEnumMaskCollisionFilterGroupsField(GUIContent guiContent, BulletSharp.CollisionFilterGroups enumVal)
    {
        GUICollisionFilterGroups g = ConvertBulletSharpEnumToGUIEnum_CollisionFilterGroups(enumVal);

        g = (GUICollisionFilterGroups)EditorGUILayout.EnumMaskField(guiContent, g);
        return(ConvertGUIEnumToBulletSharpEnum_CollisionFilterGroups(g));
    }