fix: fix various issues.

- fix convertion loss in CKCamera.
- bump up version to 0.3.0
- use CMake to generate version info header.
- fix annotation about Dassault ComputeCRC error.
- change member field initialization value in CKLight.
This commit is contained in:
2024-12-31 17:43:39 +08:00
parent fe4a58e864
commit 2e7580c131
10 changed files with 42 additions and 16 deletions

View File

@ -128,7 +128,7 @@ SetObjectFlags(obj_flags); \
}
void CKCamera::ComputeProjectionMatrix(VxMath::VxMatrix& mat) const {
CKFLOAT aspect = m_Width / m_Height;
CKFLOAT aspect = static_cast<CKFLOAT>(m_Width) / m_Height;
if (m_ProjectType == CK_CAMERA_PROJECTION::CK_PERSPECTIVEPROJECTION) {
mat.Perspective(m_Fov, aspect, m_FrontPlane, m_BackPlane);
} else {

View File

@ -1,5 +1,6 @@
#include "CKLight.hpp"
#include "../CKStateChunk.hpp"
#include <numbers>
namespace LibCmo::CK2::ObjImpls {
@ -16,8 +17,8 @@ namespace LibCmo::CK2::ObjImpls {
m_LightData.m_Attenuation0 = 1.0f;
m_LightData.m_Attenuation1 = 0.0f;
m_LightData.m_Attenuation2 = 0.0f;
m_LightData.m_InnerSpotCone = 0.69813174f; // MARK: Perhaps 40 deg in rad.
m_LightData.m_OuterSpotCone = 0.78539819f; // MARK: Perhaps 45 deg in rad.
m_LightData.m_InnerSpotCone = 40.0f / 180.0f * std::numbers::pi_v<float>; // MARK: Original value is 0.69813174f. Perhaps 40 deg in rad.
m_LightData.m_OuterSpotCone = 45.0f / 180.0f * std::numbers::pi_v<float>; // MARK: Original value is 0.78539819f. Perhaps 45 deg in rad.
}
CKLight::~CKLight() {}