Created
February 9, 2022 15:22
-
-
Save nirinchev/1d4e3467a50fed16bacd8f2655f02715 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IQueryable<Powerup> PowerupsAroundLocation(Vector3 location, float radius) | |
{ | |
// Note that this query returns a cube around the location, not a sphere. | |
var powerups = realm.All<Powerup>().Filter( | |
"Position.x > $0 AND Position.x < $1 AND Position.y > $2 AND Position.y < $3 AND Position.z > $4 AND Position.z < $5", | |
location.x - radius, location.x + radius, | |
location.y - radius, location.y + radius, | |
location.z - radius, location.z + radius); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment