add mesh interface functions
This commit is contained in:
parent
0d114974ff
commit
2bd0c980b5
|
@ -433,6 +433,103 @@ bool BMTexture_SetVideoFormat(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(Lib
|
||||||
|
|
||||||
#pragma region CKMesh
|
#pragma region CKMesh
|
||||||
|
|
||||||
|
bool BMMesh_GetVertexCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKDWORD, out_count)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
BMPARAM_OUT_ASSIGN(out_count, obj->GetVertexCount());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_SetVertexCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, count)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
obj->SetVertexCount(count);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_GetVertexPositions(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxVector3*, out_mem)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
BMPARAM_OUT_ASSIGN(out_mem, obj->GetVertexPositions());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_GetVertexNormals(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxVector3*, out_mem)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
BMPARAM_OUT_ASSIGN(out_mem, obj->GetVertexNormals());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_GetVertexUVs(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxVector2*, out_mem)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
BMPARAM_OUT_ASSIGN(out_mem, obj->GetVertexUVs());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BMMesh_GetFaceCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKDWORD, out_count)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
BMPARAM_OUT_ASSIGN(out_count, obj->GetFaceCount());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_SetFaceCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, count)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
obj->SetFaceCount(count);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_GetFaceIndices(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKWORD*, out_mem)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
BMPARAM_OUT_ASSIGN(out_mem, obj->GetFaceIndices());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_GetFaceMaterialSlotIndexs(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKWORD*, out_mem)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
BMPARAM_OUT_ASSIGN(out_mem, obj->GetFaceMaterialSlotIndexs());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BMMesh_GetMaterialSlotCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKDWORD, out_count)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
BMPARAM_OUT_ASSIGN(out_count, obj->GetMaterialSlotCount());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_SetMaterialSlotCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, count)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
|
||||||
|
obj->SetMaterialSlotCount(count);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_GetMaterialSlot(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, index), BMPARAM_OUT(LibCmo::CK2::CK_ID, out_mtlid)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
if (obj == nullptr) return false;
|
||||||
|
if (index >= obj->GetMaterialSlotCount()) return false;
|
||||||
|
|
||||||
|
BMPARAM_OUT_ASSIGN(out_mtlid, SafeGetID(obj->GetMaterialSlots()[index]));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool BMMesh_SetMaterialSlot(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, index), BMPARAM_IN(LibCmo::CK2::CK_ID, mtlid)) {
|
||||||
|
auto obj = CheckCKMesh(bmfile, objid);
|
||||||
|
auto mtlobj = CheckCKMaterial(bmfile, mtlid);
|
||||||
|
if (obj == nullptr /*|| mtlobj == nullptr*/) return false; // allow nullptr assign
|
||||||
|
if (index >= obj->GetMaterialSlotCount()) return false;
|
||||||
|
|
||||||
|
obj->GetMaterialSlots()[index] = mtlobj;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region CK3dObject
|
#pragma region CK3dObject
|
||||||
|
@ -464,7 +561,7 @@ bool BM3dEntity_GetCurrentMesh(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(L
|
||||||
bool BM3dEntity_SetCurrentMesh(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CK2::CK_ID, meshid)) {
|
bool BM3dEntity_SetCurrentMesh(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CK2::CK_ID, meshid)) {
|
||||||
auto obj = CheckCK3dObject(bmfile, objid);
|
auto obj = CheckCK3dObject(bmfile, objid);
|
||||||
auto meshobj = CheckCKMesh(bmfile, meshid);
|
auto meshobj = CheckCKMesh(bmfile, meshid);
|
||||||
if (obj == nullptr || meshobj == nullptr) return false;
|
if (obj == nullptr /*|| meshobj == nullptr*/) return false; //allow nullptr assign
|
||||||
|
|
||||||
obj->SetCurrentMesh(meshobj);
|
obj->SetCurrentMesh(meshobj);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -163,10 +163,78 @@ LIBCMO_EXPORT bool BMTexture_SetVideoFormat(BMPARAM_OBJECT_DECL(bmfile, objid),
|
||||||
|
|
||||||
#pragma region CKMaterial
|
#pragma region CKMaterial
|
||||||
|
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetDiffuse(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxColor, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetDiffuse(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VxColor, col));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetAmbient(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxColor, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetAmbient(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VxColor, col));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetSpecular(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxColor, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetSpecular(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VxColor, col));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetEmissive(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxColor, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetEmissive(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VxColor, col));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetSpecularPower(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKFLOAT, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetSpecularPower(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKFLOAT, val));
|
||||||
|
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetTexture(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CK2::CK_ID, out_tex));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetTexture(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CK2::CK_ID, tex));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetTextureBorderColor(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKDWORD, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetTextureBorderColor(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, val));
|
||||||
|
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetTextureBlendMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXTEXTURE_BLENDMODE, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetTextureBlendMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXTEXTURE_BLENDMODE, val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetTextureMinMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXTEXTURE_FILTERMODE, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetTextureMinMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXTEXTURE_FILTERMODE, val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetTextureMagMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXTEXTURE_FILTERMODE, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetTextureMagMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXTEXTURE_FILTERMODE, val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetTextureAddressMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXTEXTURE_ADDRESSMODE, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetTextureAddressMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXTEXTURE_ADDRESSMODE, val));
|
||||||
|
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetSourceBlend(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXBLEND_MODE, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetSourceBlend(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXBLEND_MODE, val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetDestBlend(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXBLEND_MODE, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetDestBlend(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXBLEND_MODE, val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetFillMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXFILL_MODE, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetFillMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXFILL_MODE, val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetShadeMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXSHADE_MODE, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetShadeMode(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXSHADE_MODE, val));
|
||||||
|
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetAlphaTestEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(bool, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetAlphaTestEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(bool, enabled));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetAlphaBlendEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(bool, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetAlphaBlendEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(bool, enabled));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetPerspectiveCorrectionEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(bool, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetPerspectiveCorrectionEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(bool, enabled));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetZWriteEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(bool, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetZWriteEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(bool, enabled));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetTwoSidedEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(bool, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetTwoSidedEnabled(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(bool, enabled));
|
||||||
|
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetAlphaRef(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKBYTE, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetAlphaRef(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKBYTE, val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetAlphaFunc(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXCMPFUNC, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetAlphaFunc(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXCMPFUNC, val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_GetZFunc(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VXCMPFUNC, out_val));
|
||||||
|
LIBCMO_EXPORT bool BMMaterial_SetZFunc(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::VxMath::VXCMPFUNC, val));
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region CKMesh
|
#pragma region CKMesh
|
||||||
|
|
||||||
|
LIBCMO_EXPORT bool BMMesh_GetVertexCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKDWORD, out_count));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_SetVertexCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, count));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_GetVertexPositions(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxVector3*, out_mem));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_GetVertexNormals(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxVector3*, out_mem));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_GetVertexUVs(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::VxMath::VxVector2*, out_mem));
|
||||||
|
|
||||||
|
LIBCMO_EXPORT bool BMMesh_GetFaceCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKDWORD, out_count));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_SetFaceCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, count));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_GetFaceIndices(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKWORD*, out_mem));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_GetFaceMaterialSlotIndexs(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKWORD*, out_mem));
|
||||||
|
|
||||||
|
LIBCMO_EXPORT bool BMMesh_GetMaterialSlotCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKDWORD, out_count));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_SetMaterialSlotCount(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, count));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_GetMaterialSlot(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, index), BMPARAM_OUT(LibCmo::CK2::CK_ID, out_mtlid));
|
||||||
|
LIBCMO_EXPORT bool BMMesh_SetMaterialSlot(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKDWORD, index), BMPARAM_IN(LibCmo::CK2::CK_ID, mtlid));
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region CK3dObject
|
#pragma region CK3dObject
|
||||||
|
|
|
@ -310,8 +310,10 @@ namespace LibCmo::CK2::ObjImpls {
|
||||||
|
|
||||||
void CK3dEntity::SetCurrentMesh(CKMesh* mesh) {
|
void CK3dEntity::SetCurrentMesh(CKMesh* mesh) {
|
||||||
m_CurrentMesh = mesh;
|
m_CurrentMesh = mesh;
|
||||||
|
if (mesh != nullptr) {
|
||||||
AddPotentialMesh(mesh);
|
AddPotentialMesh(mesh);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace LibCmo::CK2::ObjImpls {
|
||||||
m_VertexPosition(), m_VertexNormal(), m_VertexUV(),
|
m_VertexPosition(), m_VertexNormal(), m_VertexUV(),
|
||||||
m_VertexColor(), m_VertexSpecularColor(),
|
m_VertexColor(), m_VertexSpecularColor(),
|
||||||
// init mtl slots
|
// init mtl slots
|
||||||
m_MtlSlotCount(0),
|
m_MaterialSlotCount(0),
|
||||||
m_MaterialSlot(),
|
m_MaterialSlot(),
|
||||||
// init face data
|
// init face data
|
||||||
m_FaceCount(0),
|
m_FaceCount(0),
|
||||||
|
@ -577,22 +577,27 @@ namespace LibCmo::CK2::ObjImpls {
|
||||||
}
|
}
|
||||||
|
|
||||||
VxMath::VxVector3* CKMesh::GetVertexPositions() {
|
VxMath::VxVector3* CKMesh::GetVertexPositions() {
|
||||||
|
if (m_VertexCount == 0) return nullptr;
|
||||||
return m_VertexPosition.data();
|
return m_VertexPosition.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
VxMath::VxVector3* CKMesh::GetVertexNormals() {
|
VxMath::VxVector3* CKMesh::GetVertexNormals() {
|
||||||
|
if (m_VertexCount == 0) return nullptr;
|
||||||
return m_VertexNormal.data();
|
return m_VertexNormal.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
VxMath::VxVector2* CKMesh::GetVertexUVs() {
|
VxMath::VxVector2* CKMesh::GetVertexUVs() {
|
||||||
|
if (m_VertexCount == 0) return nullptr;
|
||||||
return m_VertexUV.data();
|
return m_VertexUV.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
CKDWORD* CKMesh::GetVertexColors() {
|
CKDWORD* CKMesh::GetVertexColors() {
|
||||||
|
if (m_VertexCount == 0) return nullptr;
|
||||||
return m_VertexColor.data();
|
return m_VertexColor.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
CKDWORD* CKMesh::GetVertexSpecularColors() {
|
CKDWORD* CKMesh::GetVertexSpecularColors() {
|
||||||
|
if (m_VertexCount == 0) return nullptr;
|
||||||
return m_VertexSpecularColor.data();
|
return m_VertexSpecularColor.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,15 +606,16 @@ namespace LibCmo::CK2::ObjImpls {
|
||||||
#pragma region Material Slot Section
|
#pragma region Material Slot Section
|
||||||
|
|
||||||
CKDWORD CKMesh::GetMaterialSlotCount() const {
|
CKDWORD CKMesh::GetMaterialSlotCount() const {
|
||||||
return m_MtlSlotCount;
|
return m_MaterialSlotCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CKMesh::SetMaterialSlotCount(CKDWORD count) {
|
void CKMesh::SetMaterialSlotCount(CKDWORD count) {
|
||||||
m_MtlSlotCount = count;
|
m_MaterialSlotCount = count;
|
||||||
m_MaterialSlot.resize(count, nullptr);
|
m_MaterialSlot.resize(count, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
CKMaterial** CKMesh::GetMaterialSlots() {
|
CKMaterial** CKMesh::GetMaterialSlots() {
|
||||||
|
if (m_MaterialSlotCount == 0) return nullptr;
|
||||||
return m_MaterialSlot.data();
|
return m_MaterialSlot.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,15 +635,19 @@ namespace LibCmo::CK2::ObjImpls {
|
||||||
}
|
}
|
||||||
|
|
||||||
CKWORD* CKMesh::GetFaceIndices() {
|
CKWORD* CKMesh::GetFaceIndices() {
|
||||||
|
if (m_FaceCount == 0) return nullptr;
|
||||||
return m_FaceIndices.data();
|
return m_FaceIndices.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
CKWORD* CKMesh::GetFaceMaterialSlotIndexs() {
|
CKWORD* CKMesh::GetFaceMaterialSlotIndexs() {
|
||||||
return m_FaceIndices.data();
|
if (m_FaceCount == 0) return nullptr;
|
||||||
|
return m_FaceMtlIndex.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
VxMath::VxVector3* CKMesh::GetFaceNormals(CKDWORD& stride) {
|
VxMath::VxVector3* CKMesh::GetFaceNormals(CKDWORD& stride) {
|
||||||
stride = CKSizeof(FaceData_t);
|
stride = CKSizeof(FaceData_t);
|
||||||
|
|
||||||
|
if (m_FaceCount == 0) return nullptr;
|
||||||
return &m_FaceOthers.data()->m_Normal;
|
return &m_FaceOthers.data()->m_Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -655,6 +665,7 @@ namespace LibCmo::CK2::ObjImpls {
|
||||||
}
|
}
|
||||||
|
|
||||||
CKWORD* CKMesh::GetLineIndices() {
|
CKWORD* CKMesh::GetLineIndices() {
|
||||||
|
if (m_LineCount == 0) return nullptr;
|
||||||
return m_LineIndices.data();
|
return m_LineIndices.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace LibCmo::CK2::ObjImpls {
|
||||||
VxMath::VXMESH_FLAGS m_Flags;
|
VxMath::VXMESH_FLAGS m_Flags;
|
||||||
CKDWORD m_VertexCount;
|
CKDWORD m_VertexCount;
|
||||||
CKDWORD m_LineCount;
|
CKDWORD m_LineCount;
|
||||||
CKDWORD m_MtlSlotCount;
|
CKDWORD m_MaterialSlotCount;
|
||||||
CKDWORD m_FaceCount;
|
CKDWORD m_FaceCount;
|
||||||
|
|
||||||
XContainer::XArray<VxMath::VxVector3> m_VertexPosition;
|
XContainer::XArray<VxMath::VxVector3> m_VertexPosition;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user