mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-26 01:17:55 -05:00
Implement/match LegoAnimationManager::FUN_10062650 (#896)
* Implement/match LegoAnimationManager::FUN_10062650 * Shorten code
This commit is contained in:
parent
6a8fb3f46b
commit
556cbdaab3
3 changed files with 25 additions and 7 deletions
|
@ -140,7 +140,7 @@ class LegoAnimationManager : public MxCore {
|
|||
MxBool FUN_100623a0(AnimInfo& p_info);
|
||||
MxBool ModelExists(AnimInfo& p_info, const char* p_name);
|
||||
void FUN_10062580(AnimInfo& p_info);
|
||||
MxBool FUN_10062650(Vector3&, float, LegoROI*);
|
||||
MxBool FUN_10062650(Vector3& p_position, float p_und, LegoROI* p_roi);
|
||||
MxBool FUN_10062710(AnimInfo& p_info);
|
||||
void FUN_10063aa0();
|
||||
void FUN_10063d10();
|
||||
|
|
|
@ -1309,6 +1309,7 @@ MxU16 LegoAnimationManager::FUN_10062110(
|
|||
if (direction.Dot(&direction, &p_direction) > 0.707) {
|
||||
Mx3DPointFloat position(p_roi->GetWorldPosition());
|
||||
|
||||
// TODO: Fix call
|
||||
((Vector3&) position).Sub(&p_position);
|
||||
float len = position.LenSquared();
|
||||
float min, max;
|
||||
|
@ -1389,7 +1390,7 @@ MxBool LegoAnimationManager::FUN_100623a0(AnimInfo& p_info)
|
|||
LegoEntityList* entityList = world->GetEntityList();
|
||||
|
||||
if (entityList != NULL) {
|
||||
Mx3DPointFloat vec(p_info.m_unk0x10[0], p_info.m_unk0x10[1], p_info.m_unk0x10[2]);
|
||||
Mx3DPointFloat position(p_info.m_unk0x10[0], p_info.m_unk0x10[1], p_info.m_unk0x10[2]);
|
||||
float und = p_info.m_unk0x10[3];
|
||||
|
||||
LegoEntityListCursor cursor(entityList);
|
||||
|
@ -1400,7 +1401,7 @@ MxBool LegoAnimationManager::FUN_100623a0(AnimInfo& p_info)
|
|||
if (entity != actor && entity->IsA("LegoPathActor")) {
|
||||
LegoROI* roi = entity->GetROI();
|
||||
|
||||
if (roi->GetVisibility() && FUN_10062650(vec, und, roi)) {
|
||||
if (roi->GetVisibility() && FUN_10062650(position, und, roi)) {
|
||||
if (!ModelExists(p_info, roi->GetName())) {
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1467,13 +1468,30 @@ void LegoAnimationManager::FUN_10062580(AnimInfo& p_info)
|
|||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10062650
|
||||
// FUNCTION: LEGO1 0x10062650
|
||||
// FUNCTION: BETA10 0x100436e2
|
||||
MxBool LegoAnimationManager::FUN_10062650(Vector3&, float, LegoROI*)
|
||||
MxBool LegoAnimationManager::FUN_10062650(Vector3& p_position, float p_und, LegoROI* p_roi)
|
||||
{
|
||||
if (p_roi != NULL) {
|
||||
Mx3DPointFloat position(p_position);
|
||||
|
||||
// TODO: Fix call
|
||||
((Vector3&) position).Sub(p_roi->GetWorldPosition());
|
||||
|
||||
float len = position.LenSquared();
|
||||
if (len <= 0.0f) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
len = sqrt(len);
|
||||
if (p_roi->GetWorldBoundingSphere().Radius() + p_und >= len) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10062710
|
||||
// FUNCTION: BETA10 0x10043787
|
||||
MxBool LegoAnimationManager::FUN_10062710(AnimInfo& p_info)
|
||||
|
|
|
@ -123,7 +123,7 @@ class Vector2 {
|
|||
virtual void Add(Vector2* p_other) { AddImpl(p_other->m_data); } // vtable+0x48
|
||||
|
||||
// FUNCTION: LEGO1 0x100021f0
|
||||
virtual void Sub(float* p_other) { SubImpl(p_other); } // vtable+0x58
|
||||
virtual void Sub(const float* p_other) { SubImpl((float*) p_other); } // vtable+0x58
|
||||
|
||||
// FUNCTION: LEGO1 0x10002200
|
||||
virtual void Sub(const Vector2* p_other) { SubImpl((float*) p_other->m_data); } // vtable+0x54
|
||||
|
|
Loading…
Reference in a new issue