Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-12-03 23:09:25 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-12-03 23:35:45 +0400
commit46eef60d93fd0d52ed4b94750f7a3248db5594ee (patch)
tree234bd4dba7f241afec6e8c1a4057fb886b37878c /source/blender/collada
parent462751688449108899a821f500cffc03658d6e3d (diff)
Cleanup: Internal degrees removal.
This patch changes most of the reamining degrees usage in internal code into radians. I let a few which I know off asside, for reasons explained below - and I'm not sure to have found out all of them. WARNING: this introduces forward incompatibility, which means files saved from this version won't open 100% correctly in previous versions (a few angle properties would use radians values as degrees...). Details: - Data: -- Lamp.spotsize: Game engine exposed this setting in degrees, to not break the API here I kept it as such (using getter/setter functions), still using radians internally. -- Mesh.smoothresh: Didn't touch to this one, as we will hopefully replace it completely by loop normals currently in dev. - Modifiers: -- EdgeSplitModifierData.split_angle, BevelModifierData.bevel_angle: Done. - Postprocessing: -- WipeVars.angle (sequencer's effect), NodeBokehImage.angle, NodeBoxMask.rotation, NodeEllipseMask.rotation: Done. - BGE: -- bConstraintActuator: Orientation type done (the minloc[0] & maxloc[0] cases). Did not touch to 'limit location' type, it can also limit rotation, but it exposes through RNA the same limit_min/limit_max, which hence can be either distance or angle values, depending on the mode. Will leave this to BGE team. -- bSoundActuator.cone_outer_angle_3d, bSoundActuator.cone_inner_angle_3d: Done (note I kept degrees in BGE itself, as it seems this is the expected value here...). -- bRadarSensor.angle: Done. Reviewers: brecht, campbellbarton, sergey, gaiaclary, dfelinto, moguri, jbakker, lukastoenne, howardt Reviewed By: brecht, campbellbarton, sergey, gaiaclary, moguri, jbakker, lukastoenne, howardt Thanks to all! Differential Revision: http://developer.blender.org/D59
Diffstat (limited to 'source/blender/collada')
-rw-r--r--source/blender/collada/DocumentImporter.cpp3
-rw-r--r--source/blender/collada/LightExporter.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 98770675444..144fe75fa70 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -1127,6 +1127,7 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light)
et->setData("energy", &(lamp->energy));
et->setData("dist", &(lamp->dist));
et->setData("spotsize", &(lamp->spotsize));
+ lamp->spotsize = DEG2RADF(lamp->spotsize);
et->setData("spotblend", &(lamp->spotblend));
et->setData("halo_intensity", &(lamp->haint));
et->setData("att1", &(lamp->att1));
@@ -1223,7 +1224,7 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light)
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
if (IS_EQ(att2, 0.0f) && att1 > 0)
lamp->falloff_type = LA_FALLOFF_INVLINEAR;
- lamp->spotsize = light->getFallOffAngle().getValue();
+ lamp->spotsize = DEG2RADF(light->getFallOffAngle().getValue());
lamp->spotblend = light->getFallOffExponent().getValue();
}
break;
diff --git a/source/blender/collada/LightExporter.cpp b/source/blender/collada/LightExporter.cpp
index a277963b883..ff50abfedae 100644
--- a/source/blender/collada/LightExporter.cpp
+++ b/source/blender/collada/LightExporter.cpp
@@ -101,7 +101,7 @@ void LightsExporter::operator()(Object *ob)
else if (la->type == LA_SPOT) {
COLLADASW::SpotLight cla(mSW, la_id, la_name);
cla.setColor(col, false, "color");
- cla.setFallOffAngle(la->spotsize, false, "fall_off_angle");
+ cla.setFallOffAngle(RAD2DEGF(la->spotsize), false, "fall_off_angle");
cla.setFallOffExponent(la->spotblend, false, "fall_off_exponent");
cla.setConstantAttenuation(constatt);
cla.setLinearAttenuation(linatt);
@@ -147,7 +147,7 @@ bool LightsExporter::exportBlenderProfile(COLLADASW::Light &cla, Lamp *la)
cla.addExtraTechniqueParameter("blender", "shadow_b", la->shdwb, "blender_shadow_b");
cla.addExtraTechniqueParameter("blender", "energy", la->energy, "blender_energy");
cla.addExtraTechniqueParameter("blender", "dist", la->dist, "blender_dist");
- cla.addExtraTechniqueParameter("blender", "spotsize", la->spotsize);
+ cla.addExtraTechniqueParameter("blender", "spotsize", RAD2DEGF(la->spotsize));
cla.addExtraTechniqueParameter("blender", "spotblend", la->spotblend);
cla.addExtraTechniqueParameter("blender", "halo_intensity", la->haint, "blnder_halo_intensity");
cla.addExtraTechniqueParameter("blender", "att1", la->att1);