We need to know if the pivot is sent in the LWS file.
Lightwave's logic is that when the pivot is set in the LWS file, it overwrite any pivot from the loaded object. The isPivotSet member is added to NodeDesc and set to false by default. It is changed to true if PivotPosition is found in the LWS file.pull/3/head
parent
8680a5e76e
commit
8913a21eed
|
@ -782,6 +782,8 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
|
|||
c = fast_atof_move(c, (float&) nodes.back().pivotPos.y );
|
||||
SkipSpaces(&c);
|
||||
c = fast_atof_move(c, (float&) nodes.back().pivotPos.z );
|
||||
// Mark pivotPos as set
|
||||
nodes.back().isPivotSet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@ struct NodeDesc
|
|||
: number (0)
|
||||
, parent (0)
|
||||
, name ("")
|
||||
, isPivotSet (false)
|
||||
, lightColor (1.f,1.f,1.f)
|
||||
, lightIntensity (1.f)
|
||||
, lightType (0)
|
||||
|
@ -115,6 +116,7 @@ struct NodeDesc
|
|||
|
||||
// position of pivot point
|
||||
aiVector3D pivotPos;
|
||||
bool isPivotSet;
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue