Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1671 | chris | 1 | package com.gebauz.bauzoid.parser; |
| 2 | |||
| 3 | import com.gebauz.bauzoid.math.Vector2; |
||
| 4 | import com.gebauz.bauzoid.math.Vector3; |
||
| 5 | import com.gebauz.bauzoid.math.Vector4; |
||
| 6 | |||
| 7 | public class ParseUtil |
||
| 8 | { |
||
| 9 | // Constants======================================================================================== |
||
| 10 | |||
| 11 | // Embedded Types=================================================================================== |
||
| 12 | |||
| 13 | // Fields=========================================================================================== |
||
| 14 | |||
| 15 | // Methods========================================================================================== |
||
| 16 | |||
| 17 | private ParseUtil() |
||
| 18 | { |
||
| 19 | } |
||
| 20 | |||
| 21 | public static Vector2 readVector2(Tokenizer t) throws ScanException |
||
| 22 | { |
||
| 23 | float x = t.readNumber(); |
||
| 24 | t.readToken(","); |
||
| 25 | float y = t.readNumber(); |
||
| 26 | return new Vector2(x, y); |
||
| 27 | } |
||
| 28 | |||
| 29 | public static Vector3 readVector3(Tokenizer t) throws ScanException |
||
| 30 | { |
||
| 31 | float x = t.readNumber(); |
||
| 32 | t.readToken(","); |
||
| 33 | float y = t.readNumber(); |
||
| 34 | t.readToken(","); |
||
| 35 | float z = t.readNumber(); |
||
| 36 | return new Vector3(x, y, z); |
||
| 37 | } |
||
| 38 | |||
| 39 | public static Vector4 readVector4(Tokenizer t) throws ScanException |
||
| 40 | { |
||
| 41 | float x = t.readNumber(); |
||
| 42 | t.readToken(","); |
||
| 43 | float y = t.readNumber(); |
||
| 44 | t.readToken(","); |
||
| 45 | float z = t.readNumber(); |
||
| 46 | t.readToken(","); |
||
| 47 | float w = t.readNumber(); |
||
| 48 | return new Vector4(x, y, z, w); |
||
| 49 | } |
||
| 50 | |||
| 51 | // Getters/Setters================================================================================== |
||
| 52 | |||
| 53 | } |