Last change
on this file since 12131 was
12131,
checked in by linggj, 5 years ago
|
it works but needs some beuty to be added
|
File size:
1.6 KB
|
Rev | Line | |
---|
[12106] | 1 | #include "SMCoord.h" |
---|
| 2 | |
---|
| 3 | namespace orxonox { |
---|
| 4 | SMCoord::SMCoord() { |
---|
| 5 | set(0); |
---|
| 6 | } |
---|
| 7 | |
---|
[12110] | 8 | SMCoord::~SMCoord() { |
---|
| 9 | |
---|
| 10 | } |
---|
| 11 | |
---|
[12106] | 12 | SMCoord::SMCoord(int x) { |
---|
| 13 | set(x); |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | void SMCoord::set(int index) { |
---|
[12110] | 17 | if(index<0) return; |
---|
| 18 | if(index>8) return; |
---|
[12106] | 19 | this->index = index; |
---|
| 20 | } |
---|
| 21 | |
---|
[12110] | 22 | Vector3 SMCoord::get3dcoordinate() { |
---|
| 23 | Vector3 coord; |
---|
| 24 | switch(this->index) |
---|
| 25 | { |
---|
| 26 | case 0: |
---|
| 27 | coord.x= 550; |
---|
| 28 | coord.y = 300; |
---|
| 29 | coord.z = 0; |
---|
| 30 | break; |
---|
| 31 | case 1: |
---|
| 32 | coord.x= 100; |
---|
| 33 | coord.y = 350; |
---|
| 34 | coord.z = -250; |
---|
| 35 | break; |
---|
| 36 | case 2: |
---|
| 37 | coord.x= -600; |
---|
| 38 | coord.y = 250; |
---|
| 39 | coord.z = -500; |
---|
| 40 | break; |
---|
| 41 | case 3: |
---|
| 42 | coord.x= -1000; |
---|
| 43 | coord.y = 50; |
---|
| 44 | coord.z = -750; |
---|
| 45 | break; |
---|
| 46 | case 4: |
---|
| 47 | coord.x= -900; |
---|
| 48 | coord.y = -400; |
---|
| 49 | coord.z = -1000; |
---|
| 50 | break; |
---|
| 51 | case 5: |
---|
| 52 | coord.x= -500; |
---|
| 53 | coord.y = -700; |
---|
| 54 | coord.z = -1250; |
---|
| 55 | break; |
---|
| 56 | case 6: |
---|
| 57 | coord.x= 0; |
---|
[12131] | 58 | coord.y = -900; |
---|
[12110] | 59 | coord.z = -1500; |
---|
| 60 | break; |
---|
| 61 | case 7: |
---|
| 62 | coord.x= 700; |
---|
| 63 | coord.y = -1100; |
---|
| 64 | coord.z = -1750; |
---|
| 65 | break; |
---|
| 66 | case 8: |
---|
| 67 | coord.x= 1500; |
---|
| 68 | coord.y = 1300; |
---|
| 69 | coord.z = -2000; |
---|
| 70 | break; |
---|
| 71 | default: |
---|
| 72 | coord.x= 0; |
---|
| 73 | coord.y = 0; |
---|
| 74 | coord.z = 0; |
---|
| 75 | } |
---|
| 76 | return coord; |
---|
| 77 | } |
---|
| 78 | |
---|
[12106] | 79 | int SMCoord::getIndex() { |
---|
| 80 | return this->index; |
---|
| 81 | } |
---|
| 82 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.