Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualsaaughmraat

Posted 15 January 2013 - 04:22 AM

Assuming a 2D situation,

If position-A is ur shooter, and position-B is the target,

then the relative-target is given by substracting A from B.

if A=(x1, y1) and B = (x2, y2) then, A should be shooting towards the direction (x2-x1, y2-y1)

If you intend to rotate the shooter, the shooter should be rotated by an angle, calculated from "atan2(y2-y1, x2-x1)"

#2saaughmraat

Posted 15 January 2013 - 04:21 AM

Assuming a 2D situation,

If position-A is ur shooter, and position-B is the target,

then the relative-target is given by substracting A from B.

if A=(x1, y1) and B = (x2, y2) then, A should be shooting towards the direction (x2-x1, y2-y1)

If you intend to rotate the shooter, the shooter should be rotated by an angle, calculated from "atan2(y2-y1, x2-x1)"

#1saaughmraat

Posted 15 January 2013 - 04:21 AM

Assuming a 2D situation,

 

If position-A is ur shooter, and position-B is the target,

 

then the relative-target is given by substracting A from B.

 

if A=(x1, y1) and B = (x2, y2) then, A should be shooting towards a direction (x2-x1, y2-y1)

 

If you intend to rotate the shooter, the shooter should be rotated by an angle, calculated from  "atan2(y2-y1, x2-x1)"


PARTNERS