Skip to content

overlap and collision events could have a leaner interface #101

@shikaan

Description

@shikaan

Objects need to subscribe to OVERLAP_EVENT and COLLISION_EVENT and what they get back is an event with a the pair of objects that collided.

One of the objects though will always be the subscriber, so it would be nice if the events they get back just has the reference to the other object so that we don't have to always do

bool overlapperIs(OverlapEvent* e, Object* o) {
  return e->getFirstObject() == o || e->getSecondObject() == o; // one of these two will always be the subscriber!
}

They could receive an event such as

e->getOther(); // pointer to the other object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions