View Javadoc

1   package com.insanityengine.ghia.renderer.Edjo;
2   
3   import com.insanityengine.ghia.m3.*;
4   
5   
6   /*** 
7    * 
8    * <P>
9    * Hit class
10   * </P>
11   * 
12   * $Header: /usr/local/cvsroot/ghia/src/java/com/insanityengine/ghia/renderer/Edjo/Hit.java,v 1.2 2005/03/26 05:07:31 brian Exp $
13   * 
14   * @author BrianHammond 
15   * 
16   */
17  public class Hit {
18  	float when, min, max;
19  	Edge what;
20  
21  	/*** 
22  	 * 
23  	 * Constructor
24  	 * 
25  	 */
26  	public Hit() {
27  	}
28  
29  	/*** 
30  	 * 
31  	 * copy
32  	 * 
33  	 * @param hit
34  	 * 
35  	 */
36  	public void copy( Hit hit ) {
37  		this.min = hit.min;
38  		this.max = hit.max;
39  		this.what = hit.what;
40  		this.when = hit.when;
41  	}
42  
43  	/*** 
44  	 * 
45  	 * me
46  	 * 
47  	 * @param that
48  	 * @param x
49  	 * 
50  	 */
51  	public void me( Edge that, float when, float x ) {
52  		this.when = when;
53  		what = that;
54  		min = ( int ) x;
55  		max = ( float ) Math.ceil( x );
56  /*
57  		if ( x - min > 0.5f ) {
58  			max = min + 1;
59  		} else {
60  			max = min;
61  		}
62  */
63  	}
64  
65  	/*** 
66  	 * 
67  	 * me
68  	 * 
69  	 * @param that
70  	 * @param xmin
71  	 * @param xmax
72  	 * 
73  	 */
74  	public void me( Edge that, float when, float xmin, float xmax ) {
75  		set( that, when, ( int ) xmin, ( int ) xmax );
76  	}
77  
78  	/*** 
79  	 * 
80  	 * set
81  	 * 
82  	 * @param that
83  	 * @param when
84  	 * @param xmin
85  	 * @param xmax
86  	 * 
87  	 */
88  	public void set( Edge that, float when, float xmin, float xmax ) {
89  		this.when = when;
90  		what = that;
91  		min = xmin;
92  		max = xmax;
93  	}
94  
95  	/*** 
96  	 * 
97  	 * tex
98  	 * 
99  	 * @param hit
100 	 * 
101 	 */
102 	public void tex( Hit hit ) {
103 		hit.when = when;
104 		what.tex( hit );
105 	}
106 };
107 
108 /***
109  *
110  * $Log: Hit.java,v $
111  * Revision 1.2  2005/03/26 05:07:31  brian
112  * ceil
113  *
114  * 
115  */