mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(model): load attachments in CM2Model::InitializeLoaded
This commit is contained in:
parent
4168a96bd2
commit
67264fbaf6
@ -970,7 +970,19 @@ int32_t CM2Model::InitializeLoaded() {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
// TODO texture transforms
|
||||
|
||||
if (this->m_shared->m_data->attachments.Count()) {
|
||||
this->m_attachments = reinterpret_cast<M2ModelAttachment*>(&data[0]);
|
||||
data += (sizeof(M2ModelAttachment) * this->m_shared->m_data->attachments.Count());
|
||||
|
||||
for (int32_t i = 0; i < this->m_shared->m_data->attachments.Count(); i++) {
|
||||
new (&this->m_attachments[i]) M2ModelAttachment();
|
||||
|
||||
auto& modelAttachment = this->m_attachments[i];
|
||||
modelAttachment.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->m_shared->m_data->lights.Count()) {
|
||||
this->m_lights = reinterpret_cast<M2ModelLight*>(&data[0]);
|
||||
|
||||
@ -13,6 +13,7 @@ class CM2Scene;
|
||||
class CM2Shared;
|
||||
struct M2Batch;
|
||||
struct M2Data;
|
||||
struct M2ModelAttachment;
|
||||
struct M2ModelBone;
|
||||
struct M2ModelBoneSeq;
|
||||
struct M2ModelCamera;
|
||||
@ -82,7 +83,7 @@ class CM2Model {
|
||||
CM2Model** m_animatePrev = nullptr;
|
||||
CM2Model* m_animateNext = nullptr;
|
||||
CM2Model* m_attachParent = nullptr;
|
||||
// TODO m_attachments; (presumably M2ModelAttachment)
|
||||
M2ModelAttachment* m_attachments = nullptr;
|
||||
uint32_t m_attachId = -1;
|
||||
uint32_t m_attachIndex = 0xFFFF;
|
||||
CM2Model* m_attachList = nullptr;
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
template<class T>
|
||||
class M2Track;
|
||||
|
||||
class CM2Model;
|
||||
|
||||
template<class T>
|
||||
struct M2ModelTrack {
|
||||
uint32_t currentKey = 0;
|
||||
@ -18,6 +20,9 @@ struct M2ModelTrack {
|
||||
};
|
||||
|
||||
struct M2ModelAttachment {
|
||||
CM2Model* model = nullptr;
|
||||
int32_t linkPoint = 0;
|
||||
bool visible = false;
|
||||
};
|
||||
|
||||
struct M2ModelBoneSeq {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user