/src/org/mt4j/components/PickInfo.java
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 ***********************************************************************/ 18package org.mt4j.components; 19 20import org.mt4j.util.math.Ray; 21 22 23/** 24 * The Class PickInfo. Used for picking a component in a canvas. 25 * Contains the picking ray and the screen coordiantes of the picking location. 26 * @author Christopher Ruff 27 */ 28public class PickInfo { 29 30 /** The screen x coordinate. */ 31 private float screenXCoordinate; 32 33 /** The screen y coordinate. */ 34 private float screenYCoordinate; 35 36 /** The original pick ray. */ 37 private Ray originalPickRay; 38 39 /** 40 * Instantiates a new pick info. Used for the pick() method of 41 * the MTComponent class. 42 * This class is used to check what 43 * 44 * @param screenXCoordinate the screen x coordinate 45 * @param screenYCoordinate the screen y coordinate 46 * @param originalPickRay the original pick ray 47 */ 48 public PickInfo(float screenXCoordinate, float screenYCoordinate, Ray originalPickRay) { 49 super(); 50 this.screenXCoordinate = screenXCoordinate; 51 this.screenYCoordinate = screenYCoordinate; 52 this.originalPickRay = originalPickRay; 53 } 54 55 /** 56 * Gets the pick ray. 57 * 58 * @return the pick ray 59 */ 60 public Ray getPickRay() { 61 return originalPickRay; 62 } 63 64 /** 65 * Gets the screen x coordinate. 66 * 67 * @return the screen x coordinate 68 */ 69 public float getScreenXCoordinate() { 70 return screenXCoordinate; 71 } 72 73 /** 74 * Gets the screen y coordinate. 75 * 76 * @return the screen y coordinate 77 */ 78 public float getScreenYCoordinate() { 79 return screenYCoordinate; 80 } 81 82 83 84}