metaforce/Runtime/World/CWallWalker.hpp

69 lines
2.6 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2017-11-20 17:33:21 +00:00
#include "CPatterned.hpp"
2018-09-16 23:22:35 +00:00
#include "Collision/CCollisionSurface.hpp"
#include "Collision/CCollidableSphere.hpp"
2017-11-20 17:33:21 +00:00
namespace urde
{
class CWallWalker : public CPatterned
{
2018-11-12 04:21:36 +00:00
public:
enum class EWalkerType
{
Parasite = 0,
Oculus = 1,
Geemer = 2,
IceZoomer = 3,
Seedling = 4
};
2018-09-16 23:22:35 +00:00
protected:
2018-11-13 09:20:11 +00:00
CCollisionSurface x568_alignNormal = CCollisionSurface(zeus::CVector3f(),
2018-09-16 23:22:35 +00:00
zeus::CVector3f::skForward,
zeus::CVector3f::skRight, -1);
CCollidableSphere x590_colSphere;
2018-11-12 04:21:36 +00:00
float x5b0_collisionCloseMargin;
2018-11-13 09:20:11 +00:00
float x5b4_alignAngVel;
float x5b8_tumbleAngle = 0.f;
float x5bc_patrolPauseRemTime = 0.f;
2018-11-11 03:27:54 +00:00
float x5c0_advanceWpRadius;
2018-11-13 09:20:11 +00:00
float x5c4_playerObstructionMinDist;
2018-09-16 23:22:35 +00:00
float x5c8_bendingHackWeight = 0.f;
s32 x5cc_bendingHackAnim;
2018-11-12 04:21:36 +00:00
EWalkerType x5d0_walkerType;
2018-11-13 09:20:11 +00:00
s16 x5d4_thinkCounter = 0;
bool x5d6_24_alignToFloor : 1;
bool x5d6_25_hasAlignSurface : 1;
bool x5d6_26_playerObstructed : 1;
bool x5d6_27_disableMove : 1;
2018-09-16 23:22:35 +00:00
bool x5d6_28_addBendingWeight : 1;
bool x5d6_29_applyBendingHack : 1;
2018-11-13 09:20:11 +00:00
static zeus::CVector3f ProjectVectorToPlane(const zeus::CVector3f& pt, const zeus::CVector3f& plane)
2018-11-12 04:21:36 +00:00
{
2018-11-13 09:20:11 +00:00
return pt - plane * pt.dot(plane);
}
static zeus::CVector3f ProjectPointToPlane(const zeus::CVector3f& p0, const zeus::CVector3f& p1,
const zeus::CVector3f& plane)
{
return p0 - (p0 - p1).dot(plane) * plane;
2018-11-12 04:21:36 +00:00
}
void OrientToSurfaceNormal(const zeus::CVector3f& normal, float clampAngle);
2018-11-13 09:20:11 +00:00
static bool PointOnSurface(const CCollisionSurface& surf, const zeus::CVector3f& point);
void AlignToFloor(CStateManager&, float, const zeus::CVector3f&, float);
2018-11-12 04:21:36 +00:00
void GotoNextWaypoint(CStateManager& mgr);
2017-11-20 17:33:21 +00:00
public:
2018-11-13 09:20:11 +00:00
CWallWalker(ECharacter chr, TUniqueId uid, std::string_view name, EFlavorType flavType,
const CEntityInfo& eInfo, const zeus::CTransform& xf,
CModelData&& mData, const CPatternedInfo& pInfo, EMovementType mType,
EColliderType colType, EBodyType bType, const CActorParameters& aParms,
float collisionCloseMargin, float alignAngVel, EKnockBackVariant kbVariant,
float advanceWpRadius, EWalkerType wType, float playerObstructionMinDist, bool disableMove);
2018-09-16 23:22:35 +00:00
void PreThink(float, CStateManager&);
void Think(float, CStateManager&);
2018-11-12 04:21:36 +00:00
void Render(const CStateManager&) const;
2018-09-16 23:22:35 +00:00
const CCollisionPrimitive* GetCollisionPrimitive() const { return &x590_colSphere; }
void UpdateWPDestination(CStateManager&);
2017-11-20 17:33:21 +00:00
};
}