Am I right to assume that at the point of collision, I can just calculate the radius on the fly by taking the square root of delta-X squared plus delta-Y squared (delta from the center of the planet), or is there some other factor I'm overlooking?
Sorry, confused again ! Why would you need to calculate the radius ? Wouldn't you know it ? Or maybe you wouldn't in your app / game / concept ??
If you have - for instance - an alien crashing into a planet, and you didn't know the size of the planet actor for whatever reason, you can use the magnitude function to measure the distance from the colliding alien's centre point to the planet's centre point - then take off half the width / diameter of the alien to calculate the radius of the planet.
And for the offset angle at initial impact, that would be X=tan-1(delta-Y/delta-X) ?
Haven't got a clue, I usually sit down and tap away until it looks about right, then tidy up the maths afterwards.
@socks: If I just went with a perfectly round planet you're correct. I was just thinking if there is terrain on it then the radius would not be consistent.
@socks: If I just went with a perfectly round planet you're correct. I was just thinking if there is terrain on it then the radius would not be consistent.
Ah, I see, that makes sense, so the 'radius' of the planet would vary. GameSalad doesn't support custom or polygonal collision shapes, although you can build up a terrain in other (more fiddly) ways.
Comments
If you have - for instance - an alien crashing into a planet, and you didn't know the size of the planet actor for whatever reason, you can use the magnitude function to measure the distance from the colliding alien's centre point to the planet's centre point - then take off half the width / diameter of the alien to calculate the radius of the planet. Haven't got a clue, I usually sit down and tap away until it looks about right, then tidy up the maths afterwards.