Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


saaughmraat

Member Since 15 Jan 2013
Offline Last Active Sep 05 2013 12:07 AM

Posts I've Made

In Topic: which side of my shooter

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)"

PARTNERS