Skip to content

lordofduct/ta-boids

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ta-boids

An implementation of boids/flocking for GameObjects.

Sample - Space Travel

A sample demoing how to use the Job System + Burst Compiler with traditional GameObjects.

Scenes

All scenes have a BoidsRunner GameObject, which will have the appropriate *BoidsRunner.

GameObject

For the GameObject version, open up the GameObjectsJobs.unity scene. This scene will spawn N GameObjects, where the transforms are written in parallel using the an IJobParallelForTransform job.

DrawMeshInstanced

Open up the InstancedJobs.unity scene. Instead of GameObjects, we open up a buffer of N matrix elements we want to store and push the data to the Graphics.DrawMeshInstanced command. This example is a little more advanced than the previous one since we want to take advantage of pointers and implicit casting for the Mathematics library, which is Burst friendly.

Jobs Content

All jobs are found in the Boids.cs file. For the jobs used in the InstancedBoidsRunner.cs, take a look at the BoidsOnlyPointer.cs file. Comments have been added where appropriate to explain the content and how this is set up.

Notes

Feel free to use this content if you would like to use it in your projects. (note - per the original author: https://github.com/ThousandAnt/ta-boids)

About

ta-boids-jlh

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%