pull/800/head
Kim Kulling 2016-01-27 18:49:26 +01:00
commit 0e7446af83
4 changed files with 15 additions and 14 deletions

View File

@ -1011,13 +1011,19 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
}
// ------------------------------------------------------------------------------------------------
aiCamera* BlenderImporter::ConvertCamera(const Scene& /*in*/, const Object* obj, const Camera* /*camera*/, ConversionData& /*conv_data*/)
aiCamera* BlenderImporter::ConvertCamera(const Scene& /*in*/, const Object* obj, const Camera* cam, ConversionData& /*conv_data*/)
{
ScopeGuard<aiCamera> out(new aiCamera());
out->mName = obj->id.name+2;
out->mPosition = aiVector3D(0.f, 0.f, 0.f);
out->mUp = aiVector3D(0.f, 1.f, 0.f);
out->mLookAt = aiVector3D(0.f, 0.f, -1.f);
if (cam->sensor_x && cam->lens) {
out->mHorizontalFOV = atan2(cam->sensor_x, 2.f * cam->lens);
}
out->mClipPlaneNear = cam->clipsta;
out->mClipPlaneFar = cam->clipend;
return out.dismiss();
}

View File

@ -620,7 +620,10 @@ template <> void Structure :: Convert<Camera> (
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadField<ErrorPolicy_Warn>((int&)dest.type,"type",db);
ReadField<ErrorPolicy_Warn>((int&)dest.flag,"flag",db);
ReadField<ErrorPolicy_Warn>(dest.angle,"angle",db);
ReadField<ErrorPolicy_Warn>(dest.lens,"lens",db);
ReadField<ErrorPolicy_Warn>(dest.sensor_x,"sensor_x",db);
ReadField<ErrorPolicy_Igno>(dest.clipsta,"clipsta",db);
ReadField<ErrorPolicy_Igno>(dest.clipend,"clipend",db);
db.reader->IncPtr(size);
}

View File

@ -312,18 +312,10 @@ struct Camera : ElemBase {
ID id FAIL;
// struct AnimData *adt;
Type type,flag WARN;
float angle WARN;
//float passepartalpha, angle;
//float clipsta, clipend;
//float lens, ortho_scale, drawsize;
//float shiftx, shifty;
//float YF_dofdist, YF_aperture;
//short YF_bkhtype, YF_bkhbias;
//float YF_bkhrot;
float lens WARN;
float sensor_x WARN;
float clipsta, clipend;
};

View File

@ -128,7 +128,7 @@ void SplitLargeMeshesProcess_Triangle::UpdateNode(aiNode* pcNode,
}
// now build the new list
delete pcNode->mMeshes;
delete[] pcNode->mMeshes;
pcNode->mNumMeshes = (unsigned int)aiEntries.size();
pcNode->mMeshes = new unsigned int[pcNode->mNumMeshes];