2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-08-30 17:33:59 -07:00
|
|
|
|
2022-05-23 17:26:35 -07:00
|
|
|
#include "Runtime/CToken.hpp"
|
|
|
|
#include "Runtime/Graphics/CTexture.hpp"
|
2019-09-27 19:53:03 -07:00
|
|
|
|
2022-05-23 17:26:35 -07:00
|
|
|
#include <optional>
|
2019-09-27 19:53:03 -07:00
|
|
|
|
|
|
|
#include <zeus/CAABox.hpp>
|
|
|
|
#include <zeus/CTransform.hpp>
|
2018-02-04 22:56:09 -08:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2017-03-03 20:31:08 -08:00
|
|
|
class CTexture;
|
2018-02-04 22:56:09 -08:00
|
|
|
class CStateManager;
|
2017-03-03 20:31:08 -08:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CSimpleShadow {
|
|
|
|
zeus::CTransform x0_xf;
|
|
|
|
float x30_scale;
|
|
|
|
float x34_radius = 1.f;
|
|
|
|
float x38_userAlpha;
|
|
|
|
float x3c_heightAlpha = 1.f;
|
|
|
|
float x40_maxObjHeight;
|
|
|
|
float x44_displacement;
|
2020-04-21 00:22:41 -07:00
|
|
|
bool x48_24_collision : 1 = false;
|
|
|
|
bool x48_25_alwaysCalculateRadius : 1 = true;
|
|
|
|
bool x48_26_radiusCalculated : 1 = false;
|
2018-12-07 21:30:43 -08:00
|
|
|
|
2016-08-30 17:33:59 -07:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CSimpleShadow(float scale, float userAlpha, float maxObjHeight, float displacement);
|
|
|
|
bool Valid() const { return x48_24_collision; }
|
|
|
|
zeus::CAABox GetMaxShadowBox(const zeus::CAABox& aabb) const;
|
|
|
|
zeus::CAABox GetBounds() const;
|
2022-11-17 02:06:40 -08:00
|
|
|
void SetAlwaysCalculateRadius(bool b) { x48_25_alwaysCalculateRadius = b; }
|
2018-12-07 21:30:43 -08:00
|
|
|
float GetMaxObjectHeight() const { return x40_maxObjHeight; }
|
|
|
|
void SetUserAlpha(float a) { x38_userAlpha = a; }
|
|
|
|
const zeus::CTransform& GetTransform() const { return x0_xf; }
|
2022-05-23 17:26:35 -07:00
|
|
|
void Render(TLockedToken<CTexture>& tex);
|
2018-12-07 21:30:43 -08:00
|
|
|
void Calculate(const zeus::CAABox& aabb, const zeus::CTransform& xf, const CStateManager& mgr);
|
2016-08-30 17:33:59 -07:00
|
|
|
};
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|