MCPcopy
hub / github.com/EngoEngine/engo / Remove

Method Remove

common/collision.go:543–554  ·  view source on GitHub ↗

Remove removes an entity from the CollisionSystem.

(basic ecs.BasicEntity)

Source from the content-addressed store, hash-verified

541
542// Remove removes an entity from the CollisionSystem.
543func (c *CollisionSystem) Remove(basic ecs.BasicEntity) {
544 delete := -1
545 for index, e := range c.entities {
546 if e.BasicEntity.ID() == basic.ID() {
547 delete = index
548 break
549 }
550 }
551 if delete >= 0 {
552 c.entities = append(c.entities[:delete], c.entities[delete+1:]...)
553 }
554}
555
556// Update checks the entities for collision with eachother. Only Main entities are check for collision explicitly.
557// If one of the entities are solid, the SpaceComponent is adjusted so that the other entities don't pass through it.

Callers 1

SetupMethod · 0.95

Calls 1

IDMethod · 0.80

Tested by 1

SetupMethod · 0.76