Complete CCollisionActor imp, initial CJoinCollisionDescription

This commit is contained in:
Phillip Stephens 2017-03-12 18:07:03 -07:00
parent 22989ff47c
commit b15e61c258
4 changed files with 47 additions and 2 deletions

View File

@ -65,7 +65,30 @@ CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, bo
void CCollisionActor::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CCollisionActor::AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) {}
void CCollisionActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr)
{
switch(msg)
{
case EScriptObjectMessage::ToggleActive:
case EScriptObjectMessage::Deleted:
case EScriptObjectMessage::Constructed:
break;
case EScriptObjectMessage::Alert:
case EScriptObjectMessage::InternalMessage10:
case EScriptObjectMessage::InternalMessage11:
{
CEntity* ent = mgr.ObjectById(x25c_owner);
if (ent)
mgr.SendScriptMsg(ent, x2fc_lastTouched, msg);
}
break;
default:
mgr.SendScriptMsgAlways(x25c_owner, x8_uid, msg);
break;
}
CActor::AcceptScriptMsg(msg, uid, mgr);
}
CHealthInfo* CCollisionActor::HealthInfo() { return &x28c_healthInfo; }

View File

@ -7,4 +7,15 @@ CCollisionActorManager::CCollisionActorManager(CStateManager&, TUniqueId, TAreaI
const std::vector<CJointCollisionDescription>&, bool)
{
}
u32 CCollisionActorManager::GetNumCollisionActors() const
{
return x0_jointDescriptions.size();
}
CJointCollisionDescription CCollisionActorManager::GetCollisionDescFromIndex(u32 idx) const
{
return x0_jointDescriptions[idx];
}
}

View File

@ -29,7 +29,7 @@ public:
void SetActive(CStateManager&, bool);
u32 GetNumCollisionActors() const;
CJointCollisionDescription GetCollisionDescFfromIndex(u32) const;
CJointCollisionDescription GetCollisionDescFromIndex(u32) const;
zeus::CTransform GetWRLocatorTransform(const CAnimData&, CSegId, const zeus::CTransform&, const zeus::CTransform&);
};
}

View File

@ -19,6 +19,17 @@ public:
};
private:
u32 x0_;
u32 x4_;
CSegId x8_;
CSegId x9_;
zeus::CVector3f xc_;
zeus::CVector3f x18_;
float x24_;
float x28_;
std::string x2c_;
TUniqueId x3c_;
float x40_;
public:
CJointCollisionDescription(ECollisionType, CSegId, CSegId, const zeus::CVector3f&, const zeus::CVector3f&, float,
float, EOrientationType, const std::string&, float);