Difference between Physics Joint Types: joint and tempjoint

Just for grins, I changed the joints in the Corona Air Hockey 2 template from tempjoints to joints. There was no functional difference.

What is the difference between body.tempJoint and body.joint? The documentation did not seem to delineate the differences. When is one supposed to be used over the other and why?

Thank you!

-David
[import]uid: 96411 topic_id: 17075 reply_id: 317075[/import]

That isn’t actually a thing.

See, when you use;
[lua]body.whatever = something[/lua]

You’re saying just that - obj.this = that.

See this code from gameUI from DebugDraw sample code;

[lua]-- Create a temporary touch joint and store it in the object for later reference
body.tempJoint = physics.newJoint( “touch”, body, body.x, body.y )[/lua]

That comment explains it perfectly IMHO.

You could have said [lua]body.randomPhraseThatDoesntMeanAnything = physics.newJoint( “touch”, body, body.x, body.y )[/lua]

and gotten the same result.

Make sense?

Peach :slight_smile: [import]uid: 52491 topic_id: 17075 reply_id: 64214[/import]

Got it, thank you! Brilliantly explained.

-David [import]uid: 96411 topic_id: 17075 reply_id: 64276[/import]