/src/org/mt4j/components/PickInfo.java

http://mt4j.googlecode.com/ · Java · 84 lines · 22 code · 13 blank · 49 comment · 0 complexity · fa3db3504ba669c04a2264a75d4d3ffe MD5 · raw file

  1. /***********************************************************************
  2. * mt4j Copyright (c) 2008 - 2009, C.Ruff, Fraunhofer-Gesellschaft All rights reserved.
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. ***********************************************************************/
  18. package org.mt4j.components;
  19. import org.mt4j.util.math.Ray;
  20. /**
  21. * The Class PickInfo. Used for picking a component in a canvas.
  22. * Contains the picking ray and the screen coordiantes of the picking location.
  23. * @author Christopher Ruff
  24. */
  25. public class PickInfo {
  26. /** The screen x coordinate. */
  27. private float screenXCoordinate;
  28. /** The screen y coordinate. */
  29. private float screenYCoordinate;
  30. /** The original pick ray. */
  31. private Ray originalPickRay;
  32. /**
  33. * Instantiates a new pick info. Used for the pick() method of
  34. * the MTComponent class.
  35. * This class is used to check what
  36. *
  37. * @param screenXCoordinate the screen x coordinate
  38. * @param screenYCoordinate the screen y coordinate
  39. * @param originalPickRay the original pick ray
  40. */
  41. public PickInfo(float screenXCoordinate, float screenYCoordinate, Ray originalPickRay) {
  42. super();
  43. this.screenXCoordinate = screenXCoordinate;
  44. this.screenYCoordinate = screenYCoordinate;
  45. this.originalPickRay = originalPickRay;
  46. }
  47. /**
  48. * Gets the pick ray.
  49. *
  50. * @return the pick ray
  51. */
  52. public Ray getPickRay() {
  53. return originalPickRay;
  54. }
  55. /**
  56. * Gets the screen x coordinate.
  57. *
  58. * @return the screen x coordinate
  59. */
  60. public float getScreenXCoordinate() {
  61. return screenXCoordinate;
  62. }
  63. /**
  64. * Gets the screen y coordinate.
  65. *
  66. * @return the screen y coordinate
  67. */
  68. public float getScreenYCoordinate() {
  69. return screenYCoordinate;
  70. }
  71. }