metaforce/Runtime/World/CActor.hpp

131 lines
3.7 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CACTOR_HPP__
#define __URDE_CACTOR_HPP__
2015-08-22 01:58:41 +00:00
#include "CEntity.hpp"
2016-04-29 10:08:46 +00:00
#include "Audio/CSfxHandle.hpp"
2016-03-04 23:04:53 +00:00
#include "zeus/zeus.hpp"
2016-04-25 05:46:28 +00:00
#include "Collision/CMaterialFilter.hpp"
2016-04-22 20:22:45 +00:00
#include "Character/CModelData.hpp"
#include "Particle/CCollisionResponseData.hpp"
2015-08-22 01:58:41 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-22 01:58:41 +00:00
{
2015-08-22 01:58:41 +00:00
class CActorParameters;
class CWeaponMode;
2016-04-19 00:17:49 +00:00
class CHealthInfo;
class CDamageVulnerability;
class CLightParameters;
2016-04-29 10:08:46 +00:00
class CSfxHandle;
2015-08-22 01:58:41 +00:00
class CActor : public CEntity
{
protected:
2015-11-21 01:16:07 +00:00
enum class Flags
{
Unknown5 = (1 << 5),
Unknown6 = (1 << 6),
Unknown7 = (1 << 7),
};
2016-03-04 23:04:53 +00:00
zeus::CTransform x34_transform;
2016-04-22 20:22:45 +00:00
std::unique_ptr<CModelData> x64_modelData;
2016-04-29 10:08:46 +00:00
CMaterialList x68_material;
2016-04-25 05:46:28 +00:00
CMaterialFilter x70_;
2016-04-29 10:08:46 +00:00
s16 x88_sfxId;
std::unique_ptr<CSfxHandle> x8c_sfxHandle;
TUniqueId xc6_ = kInvalidUniqueId;
float xbc_time;
2016-04-22 20:22:45 +00:00
union
{
struct
{
bool xe4_27_ : 1;
bool xe4_28_ : 1;
bool xe4_29_ : 1;
2016-04-23 10:51:53 +00:00
bool xe4_30_ : 1;
2016-04-22 20:22:45 +00:00
bool xe5_0_opaque : 1;
bool xe5_26_muted : 1;
bool xe5_27_useInSortedLists : 1;
bool xe5_28_callTouch : 1;
};
u32 dummy1 = 0;
};
union
{
struct
{
bool xe7_29_ : 1;
};
u32 dummy2 = 0;
};
2015-08-22 01:58:41 +00:00
public:
CActor(TUniqueId, bool, const std::string&, const CEntityInfo&,
2016-04-22 20:22:45 +00:00
const zeus::CTransform&, CModelData&&, const CMaterialList&,
2015-08-22 01:58:41 +00:00
const CActorParameters&, TUniqueId);
2016-04-23 10:51:53 +00:00
virtual void AddToRenderer(const zeus::CFrustum&, CStateManager&) {}
virtual void Render(CStateManager&) {}
2016-04-29 10:08:46 +00:00
virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
2016-04-22 20:22:45 +00:00
virtual void SetActive(bool active)
{
xe4_27_ = true;
xe4_28_ = true;
xe4_29_ = true;
xe7_29_ = true;
CEntity::SetActive(active);
}
2016-03-04 23:04:53 +00:00
virtual zeus::CVector3f GetAimPosition(const CStateManager&, float)
2016-04-29 10:08:46 +00:00
{ return x34_transform.origin; }
virtual bool ValidAimTarget() { return true; }
virtual bool ValidOrbitTarget() { return true; }
virtual bool GetOrbitDistanceCheck() { return true; }
2016-04-23 00:29:55 +00:00
virtual zeus::CVector3f GetOrbitPosition(const CStateManager&)
2016-04-29 10:08:46 +00:00
{ return x34_transform.origin; }
void RemoveEmitter();
2016-04-29 10:08:46 +00:00
virtual std::experimental::optional<zeus::CAABox> GetTouchBounds() const { return {} ; }
2016-04-25 05:46:28 +00:00
virtual EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, CWeaponMode&, int) { return EWeaponCollisionResponseTypes::Unknown13; }
2016-04-22 20:22:45 +00:00
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
void RemoveMaterial(EMaterialTypes, EMaterialTypes, CStateManager&);
void RemoveMaterial(EMaterialTypes, CStateManager&);
void AddMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
void AddMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
void AddMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
void AddMaterial(EMaterialTypes, EMaterialTypes, CStateManager&);
void AddMaterial(EMaterialTypes, CStateManager&);
2016-04-22 20:22:45 +00:00
void SetCallTouch(bool callTouch)
{
2016-04-22 20:22:45 +00:00
xe5_28_callTouch = callTouch;
}
2016-04-22 20:22:45 +00:00
bool GetCallTouch() const
{
2016-04-22 20:22:45 +00:00
return xe5_28_callTouch;
}
2016-04-22 20:22:45 +00:00
void SetUseInSortedList(bool use)
{
xe5_27_useInSortedLists = use;
}
bool GetUseInSortedLists() const
{
return xe5_27_useInSortedLists;
}
2016-04-25 05:46:28 +00:00
const CMaterialFilter& GetMaterialFilter() const { return x70_; }
2016-04-29 10:08:46 +00:00
bool HasModelData() const;
2015-08-22 01:58:41 +00:00
};
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CACTOR_HPP__