Advertisement
Daemonion

vanilla get source position code

Aug 27th, 2012
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. function action_sound2d:get_source_positions ()
  2. local actor = db.actor
  3. local dir = actor:direction ()
  4. dir.y = 0.0
  5. local dir_left = vector_rotate_y (dir, 45)
  6. local dir_right = vector_rotate_y (dir, -45)
  7. dir_left:normalize ()
  8. dir_right:normalize ()
  9. --ðàññ÷èòàåì âûñîòó
  10. local pos = actor:position ()
  11. pos.y = pos.y + 1.5 --íó íèçêîðîñëûé ó íàñ àêòåð...
  12. local pos_l = pos;
  13. return pos_l:add (dir_left:mul (1.5)), pos:add (dir_right:mul (1.5))
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement