Math help - ORBZ this is probably one for you :)

jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
edited November -1 in Working with GS (Mac)
I've got some tricky math in my new game, and I've been trying to work with the sample projects, but it's over my head.

For the first part, I've been working with the canon shoot demo, but I don't want the full 90 degree range of fire. I want to limit it to just 45 degrees. So, if the canon is at a 45 degree angle from the ground, I want the canon to rotate no more than 22.5 degrees either up or down. The tricky part is that this can't be relative to the scene, it needs to be relative to the actor's position, as it could potentially be anywhere on a 360 degree sphere.

Secondly, lets say this canon shoots replicas of itself, and where the 'package' lands, it spawns a new canon, orientated the impact location, pointing out from it's own island at a 90 degree angle.

I drew this diagram to help illustrate it. Say island 1 is your starting place. The grey lines are the rotation range of the canon. you shoot at island 2, and it impacts, creating a new canon, with it's own range. I'm planning on making it so you need to select each canon to make it active.

Does that make sense?

image

Comments

Sign In or Register to comment.