public static PhysicsCollider GetEnviromentPhysicsCollider(string name, float scale = 1f)
        {
            PhysicsCollider pc = new PhysicsCollider {
            };

            switch (name)
            {
            case "Kanto|Tree":
                NativeArray <CompoundCollider.ColliderBlobInstance> cs = new NativeArray <CompoundCollider.ColliderBlobInstance>(2, Allocator.TempJob);
                cs[0] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = CylinderCollider.Create(new CylinderGeometry
                    {
                        Orientation = Quaternion.Euler(new float3(270f, 270f, 0)),
                        Height      = 1f * scale,
                        Radius      = .25f * scale,
                        SideCount   = 20,
                        Center      = new float3(0, .5f, 0) * scale
                    }, new CollisionFilter
                    {
                        BelongsTo    = TriggerEventClass.Collidable,
                        CollidesWith = TriggerEventClass.Collidable,
                        GroupIndex   = 1
                    }),
                    CompoundFromChild = new RigidTransform {
                        rot = quaternion.identity
                    }
                };
                cs[1] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = CylinderCollider.Create(new CylinderGeometry
                    {
                        Center      = new float3(0, 1.7f, 0) * scale,
                        Orientation = Quaternion.Euler(new float3(90f, 0, 0)),
                        Height      = 1.5f * scale,
                        Radius      = 1f * scale,
                        SideCount   = 20
                    }, new CollisionFilter
                    {
                        BelongsTo    = TriggerEventClass.Collidable,
                        CollidesWith = TriggerEventClass.Collidable,
                        GroupIndex   = 1
                    }),
                    CompoundFromChild = new RigidTransform {
                        rot = quaternion.identity
                    }
                };
                pc = new PhysicsCollider {
                    Value = CompoundCollider.Create(cs)
                };
                cs.Dispose();
                break;

            default:
                Debug.LogWarning("Failed to get collider for \"" + name + "\"");
                break;
            }
            return(pc);
        }
Exemple #2
0
        public static CompoundCollider.ColliderBlobInstance[][] GenerateBasePokemonColliderData(CollisionFilter[] collisionFilter = null,
                                                                                                Unity.Physics.Material[] material = null, int[] groupIndex = null, int[] exclude = null)
        {
            if (exclude == null)
            {
                exclude = new int[0];
            }
            if (collisionFilter == null)
            {
                collisionFilter = new CollisionFilter[MaxPokedexNumber];
            }
            if (material == null)
            {
                material = new Unity.Physics.Material[MaxPokedexNumber];
            }
            if (groupIndex == null)
            {
                groupIndex = new int[MaxPokedexNumber];
                for (int i = 0; i < MaxPokedexNumber; i++)
                {
                    groupIndex[i] = 1;
                }
            }
            CompoundCollider.ColliderBlobInstance[][] temp = new CompoundCollider.ColliderBlobInstance[MaxPokedexNumber][];
            PhysicsCollider physicsCollider = new PhysicsCollider {
            };
            NativeArray <CompoundCollider.ColliderBlobInstance> colliders;

            Quaternion rotation = new quaternion();

            for (int i = 1; i < MaxPokedexNumber; i++)
            {
                //	Debug.Log("Height = "+ PokemonBaseEntityData[i].Height+" i = "+i);
                if (collisionFilter[i].Equals(new CollisionFilter()))
                {
                    //	Debug.Log("Creating new Collision Filter");
                    collisionFilter[i] = new CollisionFilter
                    {
                        BelongsTo    = TriggerEventClass.Pokemon | TriggerEventClass.Collidable,
                        CollidesWith = TriggerEventClass.Collidable,
                        GroupIndex   = groupIndex[i]
                    };
                }
                if (material[i].Equals(new Unity.Physics.Material()))
                {
                    material[i] = GetPokemonColliderMaterial(i);
                }
                temp[i] = GeneratePokemonCollider(i, collisionFilter[i], material[i], groupIndex[i]);
            }
            return(temp);
        }
    private static PhysicsCollider CreateCompoundCollider(PhysicsCollider c1, PhysicsCollider c2)
    {
        CompoundCollider.ColliderBlobInstance[] colliderArray = new CompoundCollider.ColliderBlobInstance[2];
        colliderArray[0] = new CompoundCollider.ColliderBlobInstance {
            Collider = c1.Value
        };
        colliderArray[1] = new CompoundCollider.ColliderBlobInstance {
            Collider = c2.Value
        };
        NativeArray <CompoundCollider.ColliderBlobInstance> colliderNativeArray = new NativeArray <CompoundCollider.ColliderBlobInstance>(colliderArray, Allocator.TempJob);
        PhysicsCollider compoundCollider = new PhysicsCollider {
            Value = CompoundCollider.Create(colliderNativeArray)
        };

        colliderNativeArray.Dispose();
        return(compoundCollider);
    }
Exemple #4
0
        public static unsafe BlobAssetReference <Collider> GenerateRandomCompound(ref Random rnd)
        {
            int numChildren = rnd.NextInt(1, 10);
            var children    = new NativeArray <CompoundCollider.ColliderBlobInstance>(numChildren, Allocator.Temp);

            for (int i = 0; i < numChildren; i++)
            {
                children[i] = new CompoundCollider.ColliderBlobInstance
                {
                    CompoundFromChild = new RigidTransform
                    {
                        pos = (rnd.NextInt(10) > 0) ? rnd.NextFloat3(-5.0f, 5.0f) : float3.zero,
                        rot = (rnd.NextInt(10) > 0) ? rnd.NextQuaternionRotation() : quaternion.identity
                    },
                    Collider = GenerateRandomCollider(ref rnd)
                };
            }

            return(CompoundCollider.Create(children));
        }
        private BlobAssetReference <Collider> CreateGroundCompoundWith2Children(float3 groundSize)
        {
            var groundCollider1 = BoxCollider.Create(new BoxGeometry {
                Orientation = quaternion.identity, Size = groundSize
            });
            var groundCollider2 = BoxCollider.Create(new BoxGeometry {
                Orientation = quaternion.identity, Size = groundSize
            });
            var instances = new NativeArray <CompoundCollider.ColliderBlobInstance>(2, Allocator.Temp);

            instances[0] = new CompoundCollider.ColliderBlobInstance
            {
                Collider          = groundCollider1,
                CompoundFromChild = RigidTransform.identity
            };
            instances[1] = new CompoundCollider.ColliderBlobInstance
            {
                Collider          = groundCollider2,
                CompoundFromChild = RigidTransform.identity
            };
            return(CompoundCollider.Create(instances));
        }
Exemple #6
0
    public override void CreateScene(TerrainDemoScene sceneSettings)
    {
        // Make heightfield data
        NativeArray <float> heights;
        int2   size;
        float3 scale;
        bool   simple = false;

#if UNITY_ANDROID || UNITY_IOS
        simple = true;
#endif
        bool flat     = false;
        bool mountain = false;
        if (simple)
        {
            size       = new int2(2, 2);
            scale      = new float3(25, 0.1f, 25);
            heights    = new NativeArray <float>(size.x * size.y * UnsafeUtility.SizeOf <float>(), Allocator.Temp);
            heights[0] = 1;
            heights[1] = 0;
            heights[2] = 0;
            heights[3] = 1;
        }
        else
        {
            size  = new int2(sceneSettings.SizeX, sceneSettings.SizeZ);
            scale = new float3(sceneSettings.ScaleX, sceneSettings.ScaleY, sceneSettings.ScaleZ);
            float period = 50.0f;
            heights = new NativeArray <float>(size.x * size.y * UnsafeUtility.SizeOf <float>(), Allocator.Temp);
            for (int j = 0; j < size.y; j++)
            {
                for (int i = 0; i < size.x; i++)
                {
                    float a = (i + j) * 2.0f * (float)math.PI / period;
                    heights[i + j * size.x] = flat ? 0.0f : math.sin(a);
                    if (mountain)
                    {
                        float fractionFromCenter = 1.0f - math.min(math.length(new float2(i - size.x / 2, j - size.y / 2)) / (math.min(size.x, size.y) / 2), 1.0f);
                        float mountainHeight     = math.smoothstep(0.0f, 1, fractionFromCenter) * 25.0f;
                        heights[i + j * size.x] += mountainHeight;
                    }
                }
            }
        }

        // static terrain
        Entity staticEntity;
        {
            var collider = sceneSettings.BuildTerrainMesh
                ? CreateMeshTerrain(heights, new int2(sceneSettings.SizeX, sceneSettings.SizeZ), new float3(sceneSettings.ScaleX, sceneSettings.ScaleY, sceneSettings.ScaleZ))
                : TerrainCollider.Create(heights, size, scale, sceneSettings.Method);
            CreatedColliders.Add(collider);

            if (sceneSettings.BuildCompoundTerrain)
            {
                var numChildren = sceneSettings.NumChildren;
                var instances   = new NativeArray <CompoundCollider.ColliderBlobInstance>(numChildren, Allocator.Temp);
                for (int i = 0; i < numChildren; i++)
                {
                    instances[i] = new CompoundCollider.ColliderBlobInstance
                    {
                        Collider          = collider,
                        CompoundFromChild = new RigidTransform
                        {
                            pos = new float3((i % 2) * scale.x * (size.x - 1), 0.0f, (i / 2) * scale.z * (size.y - 1)),
                            rot = quaternion.identity
                        }
                    };
                }
                collider = Unity.Physics.CompoundCollider.Create(instances);
                CreatedColliders.Add(collider);
                instances.Dispose();
            }

            float3 position = new float3(size.x - 1, 0.0f, size.y - 1) * scale * -0.5f;
            staticEntity = CreateStaticBody(position, quaternion.identity, collider);
        }
    }
    protected override void Start()
    {
        float3 gravity = new float3(0, -9.81f, 0);

        base.init(gravity);

        // Make heightfield data
        NativeArray <float> heights;
        int2   size;
        float3 scale;
        bool   simple   = false;
        bool   flat     = false;
        bool   mountain = false;

        if (simple)
        {
            size       = new int2(2, 2);
            scale      = new float3(1, 0.1f, 1);
            heights    = new NativeArray <float>(size.x * size.y * UnsafeUtility.SizeOf <float>(), Allocator.Temp);
            heights[0] = 1;
            heights[1] = 0;
            heights[2] = 0;
            heights[3] = 1;
        }
        else
        {
            size  = new int2(SizeX, SizeZ);
            scale = new float3(ScaleX, ScaleY, ScaleZ);
            float period = 50.0f;
            heights = new NativeArray <float>(size.x * size.y * UnsafeUtility.SizeOf <float>(), Allocator.Temp);
            for (int j = 0; j < size.y; j++)
            {
                for (int i = 0; i < size.x; i++)
                {
                    float a = (i + j) * 2.0f * (float)math.PI / period;
                    heights[i + j * size.x] = flat ? 0.0f : math.sin(a);
                    if (mountain)
                    {
                        float fractionFromCenter = 1.0f - math.min(math.length(new float2(i - size.x / 2, j - size.y / 2)) / (math.min(size.x, size.y) / 2), 1.0f);
                        float mountainHeight     = math.smoothstep(0.0f, 1, fractionFromCenter) * 25.0f;
                        heights[i + j * size.x] += mountainHeight;
                    }
                }
            }
        }

        // static terrain
        Entity staticEntity;
        {
            bool createMesh = false;
            var  collider   = createMesh
                ? CreateMeshTerrain(heights, new int2(SizeX, SizeZ), new float3(ScaleX, ScaleY, ScaleZ))
                : TerrainCollider.Create(heights, size, scale, Method);

            bool compound = false;
            if (compound)
            {
                var instances = new NativeArray <CompoundCollider.ColliderBlobInstance>(4, Allocator.Temp);
                for (int i = 0; i < 4; i++)
                {
                    instances[i] = new CompoundCollider.ColliderBlobInstance
                    {
                        Collider          = collider,
                        CompoundFromChild = new RigidTransform
                        {
                            pos = new float3((i % 2) * scale.x * (size.x - 1), 0.0f, (i / 2) * scale.z * (size.y - 1)),
                            rot = quaternion.identity
                        }
                    };
                }
                collider = Unity.Physics.CompoundCollider.Create(instances);
                instances.Dispose();
            }

            float3 position = new float3(size.x - 1, 0.0f, size.y - 1) * scale * -0.5f;
            staticEntity = CreateStaticBody(position, quaternion.identity, collider);
        }
    }
    protected unsafe override void Start()
    {
        float3 gravity = new float3(0, -9.81f, 0);

        base.init(gravity);

        // Make heightfield data
        float *heights;
        int2   size;
        float3 scale;
        bool   simple   = false;
        bool   flat     = false;
        bool   mountain = false;

        if (simple)
        {
            size       = new int2(2, 2);
            scale      = new float3(1, 0.1f, 1);
            heights    = (float *)UnsafeUtility.Malloc(size.x * size.y * sizeof(float), 4, Allocator.Temp);
            heights[0] = 1;
            heights[1] = 0;
            heights[2] = 0;
            heights[3] = 1;
        }
        else
        {
            size  = new int2(SizeX, SizeZ);
            scale = new float3(ScaleX, ScaleY, ScaleZ);
            float period = 50.0f;
            heights = (float *)UnsafeUtility.Malloc(size.x * size.y * sizeof(float), 4, Allocator.Temp);
            for (int j = 0; j < size.y; j++)
            {
                for (int i = 0; i < size.x; i++)
                {
                    float a = (i + j) * 2.0f * (float)math.PI / period;
                    heights[i + j * size.x] = flat ? 0.0f : math.sin(a);
                    if (mountain)
                    {
                        float fractionFromCenter = 1.0f - math.min(math.length(new float2(i - size.x / 2, j - size.y / 2)) / (math.min(size.x, size.y) / 2), 1.0f);
                        float mountainHeight     = math.smoothstep(0.0f, 1, fractionFromCenter) * 25.0f;
                        heights[i + j * size.x] += mountainHeight;
                    }
                }
            }
        }

        // static terrain
        Entity staticEntity;
        {
            BlobAssetReference <Unity.Physics.Collider> collider = Unity.Physics.TerrainCollider.Create(size, scale, heights, Method);

            bool convertToMesh = false;
            if (convertToMesh)
            {
#pragma warning disable 618
                var res = Unity.Physics.Authoring.DisplayBodyColliders.DrawComponent.BuildDebugDisplayMesh((Unity.Physics.Collider *)collider.GetUnsafePtr());
#pragma warning restore 618
                Vector3[] v        = res[0].Mesh.vertices;
                float3[]  vertices = new float3[v.Length];
                for (int i = 0; i < vertices.Length; i++)
                {
                    vertices[i] = v[i];
                }
                collider = Unity.Physics.MeshCollider.Create(vertices, res[0].Mesh.triangles);
            }

            bool compound = false;
            if (compound)
            {
                var instances = new NativeArray <CompoundCollider.ColliderBlobInstance>(4, Allocator.Temp);
                for (int i = 0; i < 4; i++)
                {
                    instances[i] = new CompoundCollider.ColliderBlobInstance
                    {
                        Collider          = collider,
                        CompoundFromChild = new RigidTransform
                        {
                            pos = new float3((i % 2) * scale.x * (size.x - 1), 0.0f, (i / 2) * scale.z * (size.y - 1)),
                            rot = quaternion.identity
                        }
                    };
                }
                collider = Unity.Physics.CompoundCollider.Create(instances);
                instances.Dispose();
            }

            float3 position = new float3(size.x - 1, 0.0f, size.y - 1) * scale * -0.5f;
            staticEntity = CreateStaticBody(position, quaternion.identity, collider);
        }

        UnsafeUtility.Free(heights, Allocator.Temp);
    }
    public void RebuildCollision()
    {
        List <ChunkComponent> chunkList = new List <ChunkComponent>();
        int colliderCount = 0;

        for (int x = 0; x < sizeX; x++)
        {
            for (int z = 0; z < sizeZ; z++)
            {
                for (int y = 0; y < sizeY; y++)
                {
                    if (chunkComponents[x, y, z] != null || chunkComponents[x, y, z].chunk.getCollisionData() != null)
                    {
                        chunkList.Add(chunkComponents[x, y, z]);
                        colliderCount += chunkComponents[x, y, z].chunk.getCollisionData().Count;
                    }
                }
            }
        }

        BoxGeometry box = new BoxGeometry
        {
            Center      = float3.zero,
            Orientation = quaternion.identity,
            Size        = new float3(0.9f),
            BevelRadius = 0.0f
        };

        Vector3    position      = Vector3.zero;
        quaternion rotation      = quaternion.identity;
        Chunk      chunk         = null;
        int        colliderIndex = 0;

        NativeArray <CompoundCollider.ColliderBlobInstance> colliders = new NativeArray <CompoundCollider.ColliderBlobInstance>(colliderCount, Allocator.Temp);

        for (int i = 0; i < chunkList.Count; i++)
        {
            chunk = chunkList[i].chunk;

            for (int n = 0; n < chunk.getCollisionData().Count; n++)
            {
                float3 center = chunk.getCollisionData().centers[n] + (new Vector3(chunk.getX(), chunk.getY(), chunk.getZ()) * Constants.CHUNK_SIZE) + pivotPoint;
                box.Size = chunk.getCollisionData().sizes[n];

                colliders[colliderIndex] = new CompoundCollider.ColliderBlobInstance
                {
                    CompoundFromChild = new RigidTransform(quaternion.identity, center),
                    Collider          = Unity.Physics.BoxCollider.Create(box)
                };

                colliderIndex++;
            }
        }

        BlobAssetReference <Unity.Physics.Collider> collider = CompoundCollider.Create(colliders);

        GameMaster.Instance.entityManager.SetComponentData(entity, new PhysicsCollider {
            Value = collider
        });

        if (isStatic == false)
        {
            GameMaster.Instance.SetEntityMass(entity, collider, colliders.Length);
        }

        colliders.Dispose();
    }
Exemple #10
0
        /// <summary>
        /// creates and returns the pokemoon's PhysicsCollider
        /// </summary>
        /// <param name="pokemonName">Name of the pokemon</param>
        /// <returns>PhysicsCollider</returns>
        public static PhysicsCollider getPokemonPhysicsCollider(string pokemonName, PokemonEntityData ped,
                                                                CollisionFilter collisionFilter = new CollisionFilter(), float scale = 1f, Unity.Physics.Material material = new Unity.Physics.Material(),
                                                                int groupIndex = 1)
        {
            ///FUTURE UPDATE
            ///allow specific colliders to recieve specific filters and materials!

            //needs collision groups
            PhysicsCollider physicsCollider = new PhysicsCollider {
            };
            Quaternion rotation             = new quaternion();

            //if default collision filter is detected then create one realted to the pokemon
            if (collisionFilter.Equals(new CollisionFilter()))
            {
                Debug.Log("Creating new Collision Filter");
                collisionFilter = new CollisionFilter
                {
                    BelongsTo    = TriggerEventClass.Pokemon | TriggerEventClass.Collidable,
                    CollidesWith = TriggerEventClass.Collidable,
                    GroupIndex   = groupIndex
                };
            }
            if (material.Equals(new Unity.Physics.Material()))
            {
                material = GetPokemonColliderMaterial(StringToPokedexEntry(pokemonName));
            }
            switch (pokemonName)
            {
            case "Cubone":
                var colliders = new NativeArray <CompoundCollider.ColliderBlobInstance>(5, Allocator.Temp);
                colliders[0] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.SphereCollider.Create(new SphereGeometry {
                        Center = new float3(0, 0.27f, 0.03f), Radius = 0.225f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3 {
                            x = 0, y = 0, z = 0
                        }, rot = quaternion.identity
                    }
                };
                var a = GenerateCapsuleData(float3.zero, Vector3.right, 0.1f, 0.3f);
                rotation.SetFromToRotation(Vector3.right, new Vector3(0, 90f, 0));
                colliders[1] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.CapsuleCollider.Create(new CapsuleGeometry {
                        Vertex0 = a.pointA, Vertex1 = a.pointB, Radius = 0.1f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3(-0.17f, 0.19f, 0), rot = rotation
                    }
                };
                colliders[2] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.CapsuleCollider.Create(new CapsuleGeometry {
                        Vertex0 = a.pointA, Vertex1 = a.pointB, Radius = 0.1f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3(0.17f, 0.19f, 0), rot = rotation
                    }
                };
                colliders[3] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.SphereCollider.Create(new SphereGeometry {
                        Center = float3.zero, Radius = 0.23f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3(0, 0.75f, 0.03f), rot = rotation
                    }
                };
                a            = GenerateCapsuleData(float3.zero, Vector3.right, 0.1f, 0.3f);
                rotation     = Quaternion.Euler(0, 90f, 26f);
                colliders[4] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.CapsuleCollider.Create(new CapsuleGeometry {
                        Vertex0 = a.pointA, Vertex1 = a.pointB, Radius = 0.1f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3(0, 0.63f, 0.33f), rot = rotation
                    }
                };
                physicsCollider = new PhysicsCollider {
                    Value = CompoundCollider.Create(colliders)
                };
                if (scale > 1f)
                {
                    Debug.LogWarning("Cannot scale Cubone");
                }
                colliders.Dispose();
                break;

            case "Electrode":
                Debug.Log("Creating PHysicwsCollider for Electrode");
                physicsCollider = new PhysicsCollider {
                    Value = Unity.Physics.SphereCollider.Create(new SphereGeometry
                    {
                        Center = float3.zero,
                        Radius = ped.Height / 2 * scale
                    },
                                                                collisionFilter,
                                                                material
                                                                )
                };
                break;

            default:
                Debug.LogError("Failed to find collider for pokemon \"" + pokemonName + "\"");
                physicsCollider = new PhysicsCollider
                {
                    Value = Unity.Physics.SphereCollider.Create(new SphereGeometry
                    {
                        Center = float3.zero,
                        Radius = ped.Height / 2 * scale
                    },
                                                                collisionFilter,
                                                                material
                                                                )
                };
                break;
            }
            //		Debug.Log("Returning Physics Collide for \""+pokemonName+"\"");
            return(physicsCollider);
        }
Exemple #11
0
        public static CompoundCollider.ColliderBlobInstance[] GeneratePokemonCollider(int i, CollisionFilter collisionFilter, Unity.Physics.Material material, int groupIndex = 1, float scale = 1f)
        {
            CompoundCollider.ColliderBlobInstance[] colliders = new CompoundCollider.ColliderBlobInstance[0];
            Quaternion rotation = new Quaternion();

            switch (i)
            {
            case 104:
                colliders    = new CompoundCollider.ColliderBlobInstance[5];
                colliders[0] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.SphereCollider.Create(new SphereGeometry {
                        Center = new float3(0, 0.27f, 0.03f), Radius = 0.225f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3 {
                            x = 0, y = 0, z = 0
                        }, rot = quaternion.identity
                    }
                };
                var a = GenerateCapsuleData(float3.zero, Vector3.right, 0.1f, 0.3f);
                rotation.SetFromToRotation(Vector3.right, new Vector3(0, 90f, 0));
                colliders[1] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.CapsuleCollider.Create(new CapsuleGeometry {
                        Vertex0 = a.pointA, Vertex1 = a.pointB, Radius = 0.1f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3(-0.17f, 0.19f, 0), rot = rotation
                    }
                };
                colliders[2] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.CapsuleCollider.Create(new CapsuleGeometry {
                        Vertex0 = a.pointA, Vertex1 = a.pointB, Radius = 0.1f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3(0.17f, 0.19f, 0), rot = rotation
                    }
                };
                colliders[3] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.SphereCollider.Create(new SphereGeometry {
                        Center = float3.zero, Radius = 0.23f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3(0, 0.75f, 0.03f), rot = rotation
                    }
                };
                a            = GenerateCapsuleData(float3.zero, Vector3.right, 0.1f, 0.3f);
                rotation     = Quaternion.Euler(0, 90f, 26f);
                colliders[4] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.CapsuleCollider.Create(new CapsuleGeometry {
                        Vertex0 = a.pointA, Vertex1 = a.pointB, Radius = 0.1f
                    }, collisionFilter, material),
                    CompoundFromChild = new RigidTransform {
                        pos = new float3(0, 0.63f, 0.33f), rot = rotation
                    }
                };
                break;

            case 101:
                colliders    = new CompoundCollider.ColliderBlobInstance[1];
                colliders[0] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.SphereCollider.Create(new SphereGeometry
                    {
                        Center = float3.zero,
                        Radius = PokemonBaseEntityData[i].Height / 2
                    },
                                                                   collisionFilter,
                                                                   material
                                                                   )
                };
                break;

            default:
                Debug.LogWarning("Failed to find collider for pokemon \"" + PokedexEntryToString((ushort)i) + "\"");
                colliders    = new CompoundCollider.ColliderBlobInstance[1];
                colliders[0] = new CompoundCollider.ColliderBlobInstance
                {
                    Collider = Unity.Physics.SphereCollider.Create(new SphereGeometry
                    {
                        Center = float3.zero,
                        Radius = PokemonBaseEntityData[i].Height > 0 ? PokemonBaseEntityData[i].Height / 2 : 1f
                    },
                                                                   collisionFilter,
                                                                   material
                                                                   )
                };
                break;
            }
            return(colliders);
        }