/src/away3d/core/base/data/UV.as

http://github.com/away3d/away3d-core-fp11 · ActionScript · 67 lines · 37 code · 9 blank · 21 comment · 0 complexity · b270c2b125431a139673871ae4f6c361 MD5 · raw file

  1. package away3d.core.base.data
  2. {
  3. /**
  4. * Texture coordinates value object.
  5. */
  6. public class UV
  7. {
  8. private var _u:Number;
  9. private var _v:Number;
  10. /**
  11. * Creates a new <code>UV</code> object.
  12. *
  13. * @param u [optional] The horizontal coordinate of the texture value. Defaults to 0.
  14. * @param v [optional] The vertical coordinate of the texture value. Defaults to 0.
  15. */
  16. public function UV(u:Number = 0, v:Number = 0)
  17. {
  18. _u = u;
  19. _v = v;
  20. }
  21. /**
  22. * Defines the vertical coordinate of the texture value.
  23. */
  24. public function get v():Number
  25. {
  26. return _v;
  27. }
  28. public function set v(value:Number):void
  29. {
  30. _v = value;
  31. }
  32. /**
  33. * Defines the horizontal coordinate of the texture value.
  34. */
  35. public function get u():Number
  36. {
  37. return _u;
  38. }
  39. public function set u(value:Number):void
  40. {
  41. _u = value;
  42. }
  43. /**
  44. * returns a new UV value Object
  45. */
  46. public function clone():UV
  47. {
  48. return new UV(_u, _v);
  49. }
  50. /**
  51. * returns the value object as a string for trace/debug purpose
  52. */
  53. public function toString():String
  54. {
  55. return _u + "," + _v;
  56. }
  57. }
  58. }