Prototype unit system for assimp generic enough to be used across formats.

This commit is contained in:
Gordon MacPherson
2019-08-21 20:29:46 +01:00
parent bdf6612ba0
commit 0d29203e24
4 changed files with 82 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <assimp/BaseImporter.h>
namespace Assimp {
@@ -69,7 +69,15 @@ bool ScaleProcess::IsActive( unsigned int pFlags ) const {
}
void ScaleProcess::SetupProperties( const Importer* pImp ) {
// User scaling
mScale = pImp->GetPropertyFloat( AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY, 1.0f );
// File scaling * Application Scaling
float importerScale = pImp->GetPropertyFloat( AI_CONFIG_APP_SCALE_KEY, 1.0f );
// apply scale to the scale
// helps prevent bugs with backward compatibility for anyone using normal scaling.
mScale *= importerScale;
}
void ScaleProcess::Execute( aiScene* pScene ) {