implemented + (void) setInputModelScale: (GLfloat) value; which sets the scale at which the next model will be loaded

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@638 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Giles Williams 2006-07-06 14:03:21 +00:00
parent 8fb0065249
commit 3911a6b723
2 changed files with 13 additions and 2 deletions

View File

@ -398,6 +398,8 @@ BOOL maintainLinkedLists(Universe* uni);
- (NSDictionary*) modelData;
- (void) setModelFromModelData:(NSDictionary*) dict;
+ (void) setInputModelScale: (GLfloat) value;
- (void) loadData:(NSString *) filename;
- (void) checkNormalsAndAdjustWinding;
- (void) calculateVertexNormals;

View File

@ -1385,6 +1385,12 @@ static Universe *data_store_universe;
}
}
GLfloat input_model_scale = 1.0f;
+ (void) setInputModelScale: (GLfloat) value
{
input_model_scale = value;
}
- (void) loadData:(NSString *) filename
{
NSScanner *scanner;
@ -1550,7 +1556,7 @@ static Universe *data_store_universe;
failFlag = YES;
if (!failFlag)
{
vertices[j].x = x; vertices[j].y = y; vertices[j].z = z;
vertices[j].x = input_model_scale * x; vertices[j].y = input_model_scale * y; vertices[j].z = input_model_scale * z;
}
else
{
@ -1762,7 +1768,10 @@ static Universe *data_store_universe;
[self OGL_AssignVARMemory:sizeof(EntityData) :(void *)&entityData :0];
}
//
// reset the scale
//
[Entity setInputModelScale: 1.0];
}
- (void) checkNormalsAndAdjustWinding