Commit MetaInfo

Revision607204472c377e2759e055b206eb3ef9541db9f6 (tree)
Time2013-03-08 03:14:46
AuthorFace
CommiterFace

Log Message

UMMU: using position/size to define air lock instead of native corner definition

Change Summary

Incremental Difference

diff -r 1735f6a35598 -r 607204472c37 Orbitersdk/samples/genericvessel/SC3Data.cpp
--- a/Orbitersdk/samples/genericvessel/SC3Data.cpp Thu Mar 07 16:56:24 2013 +0100
+++ b/Orbitersdk/samples/genericvessel/SC3Data.cpp Thu Mar 07 19:14:46 2013 +0100
@@ -206,22 +206,24 @@
206206 float ummuVersion=crew.GetUserUMmuVersion();
207207 crew.SetMaxSeatAvailableInShip(maxSeatsAvailable);
208208
209- int state=GetPrivateProfileInt(UMMUSECTION, "AIRLOCK_STATE", 1, ini);
210-
211- VECTOR3 min, max;
212- GetPrivateProfileString(UMMUSECTION, "AIRLOCK_CORNER_MIN", "(-1,-1,-1)", data, MAXLEN, ini);
213- sscanf(data, VECTORFORMAT, &min.x, &min.y, &min.z);
214- GetPrivateProfileString(UMMUSECTION, "AIRLOCK_CORNER_MAX", "(1,1,1)", data, MAXLEN, ini);
215- sscanf(data, VECTORFORMAT, &max.x, &max.y, &max.z);
216- crew.DefineAirLockShape(state, (float)min.x, (float)max.x, (float)min.y, (float)max.y, (float)min.z, (float)max.z);
209+ VECTOR3 pos, size;
210+ GetPrivateProfileString(UMMUSECTION, "AIRLOCK_POSITION", "(0,0,0)", data, MAXLEN, ini);
211+ sscanf(data, VECTORFORMAT, &pos.x, &pos.y, &pos.z);
212+ GetPrivateProfileString(UMMUSECTION, "AIRLOCK_SIZE", "(1,1,1)", data, MAXLEN, ini);
213+ sscanf(data, VECTORFORMAT, &size.x, &size.y, &size.z);
214+ size/=2;
215+ VECTOR3 rot=pos-size;
216+ pos+=size;
217+ if (rot.x>pos.x) size.x=rot.x,rot.x=pos.x,pos.x=size.x;
218+ if (rot.y>pos.y) size.y=rot.y,rot.y=pos.y,pos.y=size.y;
219+ if (rot.z>pos.z) size.z=rot.z,rot.z=pos.z,pos.z=size.z;
220+ crew.DefineAirLockShape(TRUE, (float)rot.x, (float)pos.x, (float)rot.y, (float)pos.y, (float)rot.z, (float)pos.z);
217221
218222 GetPrivateProfileString(UMMUSECTION, "EVA_POS", "(0,0,0)", data, MAXLEN, ini);
219- sscanf(data, VECTORFORMAT, &min.x, &min.y, &min.z);
223+ sscanf(data, VECTORFORMAT, &pos.x, &pos.y, &pos.z);
220224 GetPrivateProfileString(UMMUSECTION, "EVA_ROT", "(0,0,0)", data, MAXLEN, ini);
221- sscanf(data, VECTORFORMAT, &max.x, &max.y, &max.z);
222- crew.SetMembersPosRotOnEVA(min, max);
223-
224-
225+ sscanf(data, VECTORFORMAT, &rot.x, &rot.y, &rot.z);
226+ crew.SetMembersPosRotOnEVA(pos, rot);
225227 }
226228
227229 return true;
Show on old repository browser