Merge branch 'migenius-rsws53-mig-2' of https://github.com/migenius/assimp into migenius-migenius-rsws53-mig-2

pull/3164/head
Kim Kulling 2020-04-22 19:58:41 +02:00
commit ca70b44e44
2 changed files with 18 additions and 6 deletions

View File

@ -680,6 +680,7 @@ void glTF2Importer::ImportCameras(glTF2::Asset &r) {
aicam->mClipPlaneFar = cam.cameraProperties.ortographic.zfar; aicam->mClipPlaneFar = cam.cameraProperties.ortographic.zfar;
aicam->mClipPlaneNear = cam.cameraProperties.ortographic.znear; aicam->mClipPlaneNear = cam.cameraProperties.ortographic.znear;
aicam->mHorizontalFOV = 0.0; aicam->mHorizontalFOV = 0.0;
aicam->mOrthographicWidth = cam.cameraProperties.ortographic.xmag;
aicam->mAspect = 1.0f; aicam->mAspect = 1.0f;
if (0.f != cam.cameraProperties.ortographic.ymag) { if (0.f != cam.cameraProperties.ortographic.ymag) {
aicam->mAspect = cam.cameraProperties.ortographic.xmag / cam.cameraProperties.ortographic.ymag; aicam->mAspect = cam.cameraProperties.ortographic.xmag / cam.cameraProperties.ortographic.ymag;

View File

@ -171,6 +171,16 @@ struct aiCamera
*/ */
float mAspect; float mAspect;
/** Half horizontal orthographic width, in scene units.
*
* The orthographic width specifies the half width of the
* orthographic view box. If non-zero the camera is
* orthographic and the mAspect should define to the
* ratio between the orthographic width and height
* and mHorizontalFOV should be set to 0.
* The default value is 0 (not orthographic).
*/
float mOrthographicWidth;
#ifdef __cplusplus #ifdef __cplusplus
aiCamera() AI_NO_EXCEPT aiCamera() AI_NO_EXCEPT
@ -180,6 +190,7 @@ struct aiCamera
, mClipPlaneNear (0.1f) , mClipPlaneNear (0.1f)
, mClipPlaneFar (1000.f) , mClipPlaneFar (1000.f)
, mAspect (0.f) , mAspect (0.f)
, mOrthographicWidth (0.f)
{} {}
/** @brief Get a *right-handed* camera matrix from me /** @brief Get a *right-handed* camera matrix from me