From 64b4d4e9e3d0bb01c4615d3f43a1401e2a3d2830 Mon Sep 17 00:00:00 2001 From: Jens Ayton Date: Sat, 16 Jan 2010 11:57:00 +0000 Subject: [PATCH] Minor cleanup; made fallback material as weird-looking as it used to be. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2973 127b21dd-08f5-0310-b4b7-95ae10353056 --- Resources/Config/descriptions.plist | 36 ------------------------ Resources/Config/material-defaults.plist | 4 +-- src/Core/OOMesh.m | 8 +++--- src/Core/Scripting/OOJSVector.m | 6 ++-- 4 files changed, 9 insertions(+), 45 deletions(-) diff --git a/Resources/Config/descriptions.plist b/Resources/Config/descriptions.plist index 688d2843..346b8c3c 100644 --- a/Resources/Config/descriptions.plist +++ b/Resources/Config/descriptions.plist @@ -747,42 +747,6 @@ -1, 0, -2, 0 ); - // The following is a test of a complex, multi-contour polygon sprite - // with non-overlapping contours. It also happens to generate a mix of - // triangle strips and individual triangles. (The default icon generates - // a single triangle fan.) - // -- Ahruman 2009-10-10 -/* ( - ( - -1, 2, - 1, 2, - 1, -2, - -1, -2 - ), - ( - -3, 3, - 3, 3, - 3, -3, - -3, -3 - ) - );*/ - // The following is a test of a complex, multi-contour polygon sprite - // which self-intersects. - // -- Ahruman 2009-10-10 - /*( - ( - -1, 3, - 1, 3, - 1, -2, - -1, -2 - ), - ( - -3, 1, - 3, 1, - 3, -3, - -3, -3 - ) - );*/ "oolite-default-mine-icon" = ( diff --git a/Resources/Config/material-defaults.plist b/Resources/Config/material-defaults.plist index 92187f56..3e7dca67 100644 --- a/Resources/Config/material-defaults.plist +++ b/Resources/Config/material-defaults.plist @@ -20,8 +20,8 @@ diffuse_map = ""; diffuse = (0, 0, 0.4); ambient = (0, 0, 0.4); - emission = (0.9, 0.9, 0.9); - specular = (1.0, 0.8, 0.8); + emission = (0.4, 0.1, 0.1); + specular = (0.1, 1.0, 0.1); shininess = 1; }; diff --git a/src/Core/OOMesh.m b/src/Core/OOMesh.m index e11ac703..e4227afa 100644 --- a/src/Core/OOMesh.m +++ b/src/Core/OOMesh.m @@ -16,7 +16,7 @@ present. Oolite -Copyright (C) 2004-2008 Giles C Williams and contributors +Copyright (C) 2004-2010 Giles C Williams and contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -1115,8 +1115,8 @@ shaderBindingTarget:(id)target calculatedNormal = normal_to_surface(v2, v1, v0); if (vector_equal(norm, kZeroVector)) { - _faces[i].normal = normal_to_surface(v0, v1, v2); - norm = normal_to_surface (v0, v1, v2); + norm = vector_flip(calculatedNormal); + _faces[i].normal = norm; } if (norm.x*calculatedNormal.x < 0 || norm.y*calculatedNormal.y < 0 || norm.z*calculatedNormal.z < 0) { @@ -1176,7 +1176,7 @@ shaderBindingTarget:(id)target } Vector tangent = vector_subtract(vector_multiply_scalar(vProjAB, dsAC), vector_multiply_scalar(vProjAC, dsAB)); - face->tangent = cross_product(face->normal, tangent); // Rotate 90 degrees. Done this way because I'm too lazy to grok the code above. + face->tangent = cross_product(nA, tangent); // Rotate 90 degrees. Done this way because I'm too lazy to grok the code above. } } diff --git a/src/Core/Scripting/OOJSVector.m b/src/Core/Scripting/OOJSVector.m index 095855ec..36e1f032 100644 --- a/src/Core/Scripting/OOJSVector.m +++ b/src/Core/Scripting/OOJSVector.m @@ -3,7 +3,7 @@ OOJSVector.m Oolite -Copyright (C) 2004-2008 Giles C Williams and contributors +Copyright (C) 2004-2010 Giles C Williams and contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -517,7 +517,7 @@ static JSBool VectorSubtract(JSContext *context, JSObject *this, uintN argc, jsv } -// distanceTo(v : vectorExpression) : Vector3D +// distanceTo(v : vectorExpression) : Number static JSBool VectorDistanceTo(JSContext *context, JSObject *this, uintN argc, jsval *argv, jsval *outResult) { Vector thisv, thatv; @@ -532,7 +532,7 @@ static JSBool VectorDistanceTo(JSContext *context, JSObject *this, uintN argc, j } -// squaredDistanceTo(v : vectorExpression) : Vector3D +// squaredDistanceTo(v : vectorExpression) : Number static JSBool VectorSquaredDistanceTo(JSContext *context, JSObject *this, uintN argc, jsval *argv, jsval *outResult) { Vector thisv, thatv;