mirror of https://github.com/AxioDL/metaforce.git
Update submodules
This commit is contained in:
parent
366d6b96ee
commit
80dbc1920c
|
@ -4,7 +4,7 @@
|
||||||
#define MP1_USE_BOO 0
|
#define MP1_USE_BOO 0
|
||||||
#endif
|
#endif
|
||||||
#ifndef MP1_VARIABLE_DELTA_TIME
|
#ifndef MP1_VARIABLE_DELTA_TIME
|
||||||
#define MP1_VARIABLE_DELTA_TIME 0
|
#define MP1_VARIABLE_DELTA_TIME 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "IMain.hpp"
|
#include "IMain.hpp"
|
||||||
|
|
|
@ -31,6 +31,7 @@ CPuffer::CPuffer(TUniqueId uid, std::string_view name, const CEntityInfo& info,
|
||||||
CreateShadow(false);
|
CreateShadow(false);
|
||||||
x460_knockBackController.SetImpulseDurationIdx(1);
|
x460_knockBackController.SetImpulseDurationIdx(1);
|
||||||
x574_cloudEffect.Lock();
|
x574_cloudEffect.Lock();
|
||||||
|
x450_bodyController->SetRestrictedFlyerMoveSpeed(hoverSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPuffer::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
void CPuffer::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
||||||
|
@ -65,8 +66,7 @@ void CPuffer::Think(float dt, CStateManager& mgr) {
|
||||||
|
|
||||||
x450_bodyController->GetCommandMgr().ClearLocomotionCmds();
|
x450_bodyController->GetCommandMgr().ClearLocomotionCmds();
|
||||||
if (moveVector.canBeNormalized()) {
|
if (moveVector.canBeNormalized()) {
|
||||||
//zeus::CVector3f vec = x5c0_move * (1.f - (dt / 0.5f)) + (moveVector * (dt / 0.5f));
|
x5c0_move = (x5c0_move * (1.f - (dt / 0.5f)) + (moveVector * (dt / 0.5f))).normalized();
|
||||||
x5c0_move = moveVector.normalized();
|
|
||||||
x450_bodyController->GetCommandMgr().DeliverCmd(CBCLocomotionCmd(x5c0_move, x568_face, 1.f));
|
x450_bodyController->GetCommandMgr().DeliverCmd(CBCLocomotionCmd(x5c0_move, x568_face, 1.f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,9 +114,29 @@ void CPuffer::sub8025bfa4(CStateManager& mgr) {
|
||||||
|
|
||||||
if (x5d4_gasLocators.empty()) {
|
if (x5d4_gasLocators.empty()) {
|
||||||
for (u32 i = 0; i < 14; ++i)
|
for (u32 i = 0; i < 14; ++i)
|
||||||
x5d4_gasLocators.push_back(GetScaledLocatorTransform(GasLocators[i]).frontVector());
|
x5d4_gasLocators.push_back(GetScaledLocatorTransform(GasLocators[i]).basis[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moveVector.canBeNormalized()) {}
|
if (moveVector.canBeNormalized()) {
|
||||||
|
zeus::CVector3f moveNorm = -moveVector.normalized();
|
||||||
|
for (u32 i = 0; i < 14; ++i) {
|
||||||
|
zeus::CVector3f tmp = GetTransform().rotate(x5d4_gasLocators[i]);
|
||||||
|
bool enable = std::cos(zeus::degToRad(45.f)) < moveNorm.dot(tmp);
|
||||||
|
printf("%s -> %i\n", GesJetLocators[i], enable);
|
||||||
|
if ((x5d0_enabledParticles & (1 << i)) != enable) {
|
||||||
|
GetModelData()->GetAnimationData()->SetParticleEffectState(GesJetLocators[i], enable, mgr);
|
||||||
|
}
|
||||||
|
if (enable)
|
||||||
|
x5d0_enabledParticles |= (1 << i);
|
||||||
|
else
|
||||||
|
x5d0_enabledParticles &= ~(1 << i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (u32 i = 0; i < 14; ++i) {
|
||||||
|
if ((x5d0_enabledParticles & (1 << i)))
|
||||||
|
GetModelData()->GetAnimationData()->SetParticleEffectState(GesJetLocators[i], false, mgr);
|
||||||
|
}
|
||||||
|
x5d0_enabledParticles = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} // namespace urde::MP1
|
} // namespace urde::MP1
|
||||||
|
|
|
@ -21,7 +21,7 @@ class CPuffer : public CPatterned {
|
||||||
CAssetId x5bc_cloudSteam;
|
CAssetId x5bc_cloudSteam;
|
||||||
zeus::CVector3f x5c0_move;
|
zeus::CVector3f x5c0_move;
|
||||||
TUniqueId x5cc_ = kInvalidUniqueId;
|
TUniqueId x5cc_ = kInvalidUniqueId;
|
||||||
s32 x5d0_ = 0;
|
s32 x5d0_enabledParticles = 0;
|
||||||
rstl::reserved_vector<zeus::CVector3f, 14> x5d4_gasLocators;
|
rstl::reserved_vector<zeus::CVector3f, 14> x5d4_gasLocators;
|
||||||
|
|
||||||
void sub8025bfa4(CStateManager&);
|
void sub8025bfa4(CStateManager&);
|
||||||
|
|
|
@ -378,7 +378,7 @@ void CScriptPlayerActor::Render(const CStateManager& mgr) const {
|
||||||
CBooModel::SetReflectionCube(m_reflectionCube);
|
CBooModel::SetReflectionCube(m_reflectionCube);
|
||||||
|
|
||||||
bool phazonSuit = x2e8_suitRes.GetCharacterNodeId() == 3;
|
bool phazonSuit = x2e8_suitRes.GetCharacterNodeId() == 3;
|
||||||
if (phazonSuit && false) {
|
if (phazonSuit) {
|
||||||
// Draw into alpha buffer
|
// Draw into alpha buffer
|
||||||
CModelFlags flags = xb4_drawFlags;
|
CModelFlags flags = xb4_drawFlags;
|
||||||
flags.x4_color = zeus::skWhite;
|
flags.x4_color = zeus::skWhite;
|
||||||
|
@ -399,7 +399,7 @@ void CScriptPlayerActor::Render(const CStateManager& mgr) const {
|
||||||
x314_beamModelData->Render(mgr, modelXf, x90_actorLights.get(), flags);
|
x314_beamModelData->Render(mgr, modelXf, x90_actorLights.get(), flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phazonSuit && false) {
|
if (phazonSuit) {
|
||||||
zeus::CVector3f vecFromCam =
|
zeus::CVector3f vecFromCam =
|
||||||
GetBoundingBox().center() - mgr.GetCameraManager()->GetCurrentCamera(mgr)->GetTranslation();
|
GetBoundingBox().center() - mgr.GetCameraManager()->GetCurrentCamera(mgr)->GetTranslation();
|
||||||
float radius = zeus::clamp(0.25f, (6.f - vecFromCam.magnitude()) / 6.f, 2.f);
|
float radius = zeus::clamp(0.25f, (6.f - vecFromCam.magnitude()) / 6.f, 2.f);
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
#include "Runtime/World/CVisorFlare.hpp"
|
#include "Runtime/World/CVisorFlare.hpp"
|
||||||
|
|
||||||
#include "Runtime/CSimplePool.hpp"
|
#include "Runtime/Camera/CCameraManager.hpp"
|
||||||
|
#include "Runtime/Camera/CGameCamera.hpp"
|
||||||
|
#include "Runtime/World/CPlayer.hpp"
|
||||||
#include "Runtime/GameGlobalObjects.hpp"
|
#include "Runtime/GameGlobalObjects.hpp"
|
||||||
|
#include "Runtime/CStateManager.hpp"
|
||||||
|
#include "Runtime/CSimplePool.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
|
|
||||||
std::optional<CVisorFlare::CFlareDef> CVisorFlare::LoadFlareDef(CInputStream& in) {
|
std::optional<CVisorFlare::CFlareDef> CVisorFlare::LoadFlareDef(CInputStream& in) {
|
||||||
u32 propCount = in.readUint32Big();
|
u32 propCount = in.readUint32Big();
|
||||||
if (propCount != 4)
|
if (propCount != 4)
|
||||||
return {};
|
return std::nullopt;
|
||||||
|
|
||||||
CAssetId txtrId = in.readUint32Big();
|
CAssetId txtrId = in.readUint32Big();
|
||||||
float f1 = in.readFloatBig();
|
float f1 = in.readFloatBig();
|
||||||
float f2 = in.readFloatBig();
|
float f2 = in.readFloatBig();
|
||||||
zeus::CColor color = zeus::CColor::ReadRGBABig(in);
|
zeus::CColor color = zeus::CColor::ReadRGBABig(in);
|
||||||
if (!txtrId.IsValid())
|
if (!txtrId.IsValid())
|
||||||
return {};
|
return std::nullopt;
|
||||||
|
|
||||||
TToken<CTexture> tex = g_SimplePool->GetObj(SObjectTag{FOURCC('TXTR'), txtrId});
|
TToken<CTexture> tex = g_SimplePool->GetObj(SObjectTag{FOURCC('TXTR'), txtrId});
|
||||||
|
|
||||||
|
@ -27,14 +31,67 @@ CVisorFlare::CVisorFlare(EBlendMode blendMode, bool b1, float f1, float f2, floa
|
||||||
: x0_blendMode(blendMode)
|
: x0_blendMode(blendMode)
|
||||||
, x4_flareDefs(flares)
|
, x4_flareDefs(flares)
|
||||||
, x14_b1(b1)
|
, x14_b1(b1)
|
||||||
, x18_f1(std::max(f1, 0.0001f))
|
, x18_f1(std::max(f1, FLT_EPSILON))
|
||||||
, x1c_f2(f2)
|
, x1c_f2(f2)
|
||||||
, x20_f3(f3)
|
, x20_f3(f3)
|
||||||
, x2c_w1(w1)
|
, x2c_w1(w1)
|
||||||
, x30_w2(w2) {}
|
, x30_w2(w2) {}
|
||||||
|
|
||||||
void CVisorFlare::Update(float dt, const zeus::CVector3f& pos, const CActor* act, CStateManager& mgr) {}
|
void CVisorFlare::Update(float dt, const zeus::CVector3f& pos, const CActor* act, CStateManager& mgr) {
|
||||||
|
const CPlayerState::EPlayerVisor visor = mgr.GetPlayerState()->GetCurrentVisor();
|
||||||
|
|
||||||
void CVisorFlare::Render(const zeus::CVector3f& pos, const CStateManager& mgr) const {}
|
if ((visor == CPlayerState::EPlayerVisor::Combat || (x2c_w1 != 1 && visor == CPlayerState::EPlayerVisor::Thermal)) &&
|
||||||
|
mgr.GetPlayer().GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphed) {
|
||||||
|
|
||||||
|
zeus::CVector3f camPos = mgr.GetCameraManager()->GetCurrentCamera(mgr)->GetTranslation();
|
||||||
|
zeus::CVector3f camDiff = pos - camPos;
|
||||||
|
const float mag = (camDiff.magnitude());
|
||||||
|
rstl::reserved_vector<TUniqueId, 1024> near;
|
||||||
|
mgr.BuildNearList(near, camPos, camDiff * (1.f / mag), mag,
|
||||||
|
CMaterialFilter::MakeInclude({EMaterialTypes::Occluder}), act);
|
||||||
|
TUniqueId id;
|
||||||
|
CRayCastResult result = mgr.RayWorldIntersection(
|
||||||
|
id, camPos, camDiff, mag,
|
||||||
|
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {EMaterialTypes::SeeThrough}), near);
|
||||||
|
|
||||||
|
if (result.IsValid()) {
|
||||||
|
x28_ -= mag;
|
||||||
|
} else {
|
||||||
|
x28_ += mag;
|
||||||
|
}
|
||||||
|
x28_ = zeus::clamp(0.f, x28_, x18_f1);
|
||||||
|
x24_ = 1.f - (x28_ / x18_f1);
|
||||||
|
|
||||||
|
const CGameCamera* curCam = mgr.GetCameraManager()->GetCurrentCamera(mgr);
|
||||||
|
x24_ *= std::max(0.f, 1.f - (4.f * x1c_f2 * (1.f - (pos - curCam->GetTranslation()).dot(curCam->GetTransform().basis[1]))));
|
||||||
|
|
||||||
|
if (x2c_w1 == 2) {
|
||||||
|
mgr.SetThermalColdScale2(mgr.GetThermalColdScale2() + x24_);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%08X %f %f\n", act->GetEditorId().id, x24_, x28_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CVisorFlare::Render(const zeus::CVector3f& pos, const CStateManager& mgr) const {
|
||||||
|
if (zeus::close_enough(x28_, x18_f1) &&
|
||||||
|
mgr.GetPlayer().GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphed) {
|
||||||
|
int iVar;
|
||||||
|
const auto visor = mgr.GetPlayerState()->GetActiveVisor(mgr);
|
||||||
|
if (visor == CPlayerState::EPlayerVisor::Thermal) {
|
||||||
|
iVar = x2c_w1;
|
||||||
|
} else if (visor == CPlayerState::EPlayerVisor::XRay) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
iVar = x30_w2;
|
||||||
|
}
|
||||||
|
if (iVar != 0)
|
||||||
|
return;
|
||||||
|
CGraphics::DisableAllLights();
|
||||||
|
// g_Renderer->SetDepthReadWrite(false, false);
|
||||||
|
//const CGameCamera* cam = mgr.GetCameraManager()->GetCurrentCamera(mgr);
|
||||||
|
//zeus::CVector3f camPos = cam->GetTranslation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
x0_tex.Lock();
|
x0_tex.Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
TToken<CTexture> GetTexture() const;
|
TToken<CTexture> GetTexture() const { return x0_tex; }
|
||||||
zeus::CColor GetColor() const { return x10_color; }
|
zeus::CColor GetColor() const { return x10_color; }
|
||||||
float GetScale() const;
|
float GetScale() const;
|
||||||
float GetPosition() const;
|
float GetPosition() const;
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 57bfd8cb3fefb3e57caddef46b636d762ec642a1
|
Subproject commit 1f18d2503af136d68fa64c06f3a8fae473315695
|
2
specter
2
specter
|
@ -1 +1 @@
|
||||||
Subproject commit 2a50903a4130d415aa3f8f4f8e53c3d72c398c08
|
Subproject commit 1c2c58f296a54c085854785d73c1ebdd548c5dca
|
Loading…
Reference in New Issue