|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
TriangleData.java | - | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
|
|
3 |
VRMoo Common - Virtual Reality Object Oriented MUD Common Code
|
|
4 |
Copyright (C) 2003 VRMoo Development Team
|
|
5 |
|
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or modify
|
|
8 |
it under the terms of the GNU General Public License as published by
|
|
9 |
the Free Software Foundation; either version 2 of the License, or
|
|
10 |
(at your option) any later version.
|
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful,
|
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 |
GNU General Public License for more details.
|
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License
|
|
18 |
along with this program; if not, write to the Free Software
|
|
19 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
20 |
|
|
21 |
|
|
22 |
For information about VRMoo and its authors, please visit the website:
|
|
23 |
http://www.vrmoo.org/
|
|
24 |
|
|
25 |
*/
|
|
26 |
|
|
27 |
package org.vrmoo.common.data;
|
|
28 |
|
|
29 |
import org.vrmoo.common.exception.VRMooException;
|
|
30 |
import org.vrmoo.common.exception.VRMooParseException;
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Stores the 3D data that will form one Triangle of a
|
|
34 |
* <code>TriangleArray</code>. Also contains functionality for writing out the
|
|
35 |
* data into a text format, and parsing that same text format.
|
|
36 |
*
|
|
37 |
* @author Jeff Weston
|
|
38 |
*/
|
|
39 |
public class TriangleData extends ItemData |
|
40 |
{ |
|
41 |
/**
|
|
42 |
* Construct an instance of this class using three vertices to represent
|
|
43 |
* the triangle, and a reference to an appearance object.
|
|
44 |
*
|
|
45 |
* @param vertexData the 3 vertices of the triangle
|
|
46 |
* @param appearanceReference a reference to the appearance object for the
|
|
47 |
* triangle
|
|
48 |
*
|
|
49 |
* @throws VRMooException if 3 vertices aren't passed in
|
|
50 |
*/
|
|
51 | 0 |
public TriangleData( VertexData[ ] vertexData, String appearanceReference )
|
52 |
throws VRMooException
|
|
53 |
{ |
|
54 | 0 |
super( vertexData, appearanceReference );
|
55 |
} |
|
56 |
|
|
57 |
/**
|
|
58 |
* Construct an instance of this class using text representing an encoded
|
|
59 |
* Triangle of a <code>TriangleArray</code>.
|
|
60 |
*
|
|
61 |
* @param data the encoded Triangle
|
|
62 |
*
|
|
63 |
* @throws VRMooParseException for any parsing errors that occur
|
|
64 |
*/
|
|
65 | 0 |
public TriangleData( String data ) throws VRMooParseException |
66 |
{ |
|
67 | 0 |
super( data );
|
68 |
} |
|
69 |
|
|
70 |
/**
|
|
71 |
* Returns the number of vertices that form a triangle, 3.
|
|
72 |
*
|
|
73 |
* @return the number of vertices that form a triangle, 3
|
|
74 |
*/
|
|
75 | 0 |
protected int getVertexCount( ) |
76 |
{ |
|
77 | 0 |
return 3;
|
78 |
} |
|
79 |
} |
|
80 |
|
|