Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onCollision version with parameters that are "backward compatible" with ... #48

Merged
merged 1 commit into from Mar 27, 2013

Conversation

doodaddy64
Copy link
Contributor

@doodaddy64 doodaddy64 commented Mar 25, 2013

There is an open question as to how to best handle onCollision in behaviors.

Say two objects A and B collide. T2D has the option to handle onCollision with either the Scene or with the objects themselves. If handling with the scene, you have

myScene::onCollision(%this, %objectA, %objectB, %details)

where you get both objects, of course. If handling with the objects themselves, you have

myObject::onCollision(%this, %objectB, %details)`

The called object is objectA or %this. The question is if handling with behaviors, what do you prefer? Original it was

1) myBehavior::onCollision(%this, %objectB, %details)

That is, to get objectA, you use %this.owner. A recent experiment changed it to

2) myBehavior::onCollision(%this, %parentObjectA, %objectB, %details)

That is, you also get the owner (objectA) directly as %parentObjectA.

Opinions? Don't cares?

The current pull request would switch it back to 1) above. Canceling this pull request would keep it at the new 2).

@MichPerry-GG
Copy link
Contributor

@MichPerry-GG MichPerry-GG commented Mar 25, 2013

There's a little contention on this pull request. I'd like for other folks to weigh in before we merge or not. Could you create a post in the T2D beginner forum and attach a link to this? I'd like to hear what others think.

@doodaddy64
Copy link
Contributor Author

@doodaddy64 doodaddy64 commented Mar 25, 2013

@ghost
Copy link

@ghost ghost commented Mar 26, 2013

So I said yesterday that I wasn't bothered which form the callback took but you know, now that I've had a (much needed) sleep I'm thinking that perhaps the best argument is that behaviors are supposed to act like components OF an object and therefore are supposed to mirror (as much as they can) the callbacks on the parent. In the case of that argument, the commonly-used "onCollision()" and "onEndCollision()" should be as similar as possible so perhaps taking this as a goal, we should remove that extra argument.

@MichPerry-GG MichPerry-GG merged commit b7d6167 into GarageGames:development Mar 27, 2013
Wavinator pushed a commit to Wavinator/Torque2D that referenced this issue Nov 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants