[add] Model Radius
[add] MapObject Lod 적용 [add] MapObject Culling 적용
This commit is contained in:
@@ -23,7 +23,9 @@ CModel::CModel(const CModel& rhs)
|
||||
m_Materials(rhs.m_Materials),
|
||||
m_iNumMaterials(rhs.m_iNumMaterials),
|
||||
m_iNumAnimations(rhs.m_iNumAnimations),
|
||||
m_pLerpAnim(rhs.m_pLerpAnim)
|
||||
m_pLerpAnim(rhs.m_pLerpAnim),
|
||||
m_fRadius{rhs.m_fRadius},
|
||||
m_vRadiusOffset{rhs.m_vRadiusOffset}
|
||||
{
|
||||
_uint iNumBones = (_uint)(rhs.m_Bones.size());
|
||||
m_Bones.reserve(iNumBones);
|
||||
@@ -479,6 +481,28 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
|
||||
m_Materials.push_back(pMaterial);
|
||||
}
|
||||
m_Materials.shrink_to_fit();
|
||||
|
||||
while (true)
|
||||
{
|
||||
getline(file, strText);
|
||||
if (string::npos != strText.find("Origin"))
|
||||
{
|
||||
size_t iXPos = strText.find_first_of("X");
|
||||
size_t iYPos = strText.find_first_of("Y");
|
||||
size_t iZPos = strText.find_first_of("Z");
|
||||
size_t iEndPos = strText.find_first_of("}");
|
||||
|
||||
m_vRadiusOffset.x = stof(strText.substr(iXPos + 2, iYPos - 2)) * 0.01f;
|
||||
m_vRadiusOffset.z = stof(strText.substr(iYPos + 2, iZPos - 2)) * -0.01f;
|
||||
m_vRadiusOffset.y = stof(strText.substr(iZPos + 2, iEndPos)) * 0.01f;
|
||||
}
|
||||
if (string::npos != strText.find("SphereRadius"))
|
||||
{
|
||||
size_t iBeginIndex = strText.find_first_of("=");
|
||||
m_fRadius = stof(strText.substr(iBeginIndex + 1)) / 100.f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -779,6 +803,12 @@ _bool CModel::SaveAssimpModel(const _char* filename)
|
||||
}
|
||||
}
|
||||
|
||||
if(MODEL::ENVIROMENT == m_eType)
|
||||
{
|
||||
fwrite(&m_fRadius, sizeof(_float), 1, fp);
|
||||
fwrite(&m_vRadiusOffset, sizeof(_float3), 1, fp);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return true;
|
||||
@@ -1079,6 +1109,11 @@ _bool CModel::LoadData(const _char* filename)
|
||||
NewModel.Materials.push_back(mat);
|
||||
}
|
||||
|
||||
if(MODEL::ENVIROMENT == m_eType)
|
||||
{
|
||||
fread(&m_fRadius, sizeof(_float), 1, fp);
|
||||
fread(&m_vRadiusOffset, sizeof(_float3), 1, fp);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
|
||||
@@ -13,9 +13,11 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
|
||||
public:
|
||||
#pragma region Model
|
||||
MODEL Get_Type() const { return m_eType; }
|
||||
_float4x4* Get_PreTransformMatrixPtr() { return &m_PreTransformMatrix; }
|
||||
_float4x4 Get_PreTransformMatrix() const { return m_PreTransformMatrix; };
|
||||
MODEL Get_Type() const { return m_eType; }
|
||||
_float Get_Radius() const { return m_fRadius; }
|
||||
_float3& Get_RadiusOffset() { return m_vRadiusOffset; }
|
||||
_float4x4* Get_PreTransformMatrixPtr() { return &m_PreTransformMatrix; }
|
||||
_float4x4 Get_PreTransformMatrix() const { return m_PreTransformMatrix; };
|
||||
virtual HRESULT Render(_uint iMeshIndex);
|
||||
virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation);
|
||||
#pragma endregion
|
||||
@@ -113,6 +115,9 @@ static _int Get_BoneIndex(const _char* pBoneName, vector<class CBone*> Bones); /
|
||||
_float m_fBlendTime = { 0.f };
|
||||
_float m_fBlendDuration = { 0.3f };
|
||||
|
||||
_float m_fRadius = { 0.f }; // 컬링용 Radius
|
||||
_float3 m_vRadiusOffset = {}; // 컬링용 Radius Offset
|
||||
|
||||
vector<class CAnimation*> m_Animations; // 애니메이션의 벡터,
|
||||
|
||||
class CLerpAnim* m_pLerpAnim = { nullptr }; // 럴프전용 애니메이션
|
||||
|
||||
Reference in New Issue
Block a user