physics.GetBodies: return only non nil (active) bodies

This commit is contained in:
JupiterRider 2024-01-09 16:54:02 +01:00
parent 17ce081452
commit 381d68b2a3

View file

@ -526,7 +526,7 @@ func Shatter(body *Body, position rl.Vector2, force float32) {
// GetBodies - Returns the slice of created physics bodies // GetBodies - Returns the slice of created physics bodies
func GetBodies() []*Body { func GetBodies() []*Body {
return bodies[:] return bodies[:bodiesCount]
} }
// GetBodiesCount - Returns the current amount of created physics bodies // GetBodiesCount - Returns the current amount of created physics bodies