mirror of https://github.com/PrimeDecomp/prime.git
Link CScriptActor
This commit is contained in:
parent
c9a3995d35
commit
82e6475300
|
@ -420,7 +420,7 @@ config.libs = [
|
||||||
Object(NonMatching, "MetroidPrime/Tweaks/CTweakPlayerGun.cpp"),
|
Object(NonMatching, "MetroidPrime/Tweaks/CTweakPlayerGun.cpp"),
|
||||||
Object(NonMatching, "MetroidPrime/CPauseScreen.cpp"),
|
Object(NonMatching, "MetroidPrime/CPauseScreen.cpp"),
|
||||||
Object(NonMatching, "MetroidPrime/Tweaks/CTweakGui.cpp"),
|
Object(NonMatching, "MetroidPrime/Tweaks/CTweakGui.cpp"),
|
||||||
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptActor.cpp"),
|
Object(Matching, "MetroidPrime/ScriptObjects/CScriptActor.cpp"),
|
||||||
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptTrigger.cpp"),
|
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptTrigger.cpp"),
|
||||||
Object(Matching, "MetroidPrime/ScriptObjects/CScriptWaypoint.cpp"),
|
Object(Matching, "MetroidPrime/ScriptObjects/CScriptWaypoint.cpp"),
|
||||||
Object(NonMatching, "MetroidPrime/Enemies/CPatterned.cpp"),
|
Object(NonMatching, "MetroidPrime/Enemies/CPatterned.cpp"),
|
||||||
|
|
|
@ -1995,6 +1995,9 @@ CVector3f CPlayer::CalculateLeftStickEdgePosition(float strafeInput, float forwa
|
||||||
float f4 = CMath::Limit(f1 / (M_PIF / 4.f), 1.f);
|
float f4 = CMath::Limit(f1 / (M_PIF / 4.f), 1.f);
|
||||||
return CVector3f(f31, 0.f, 0.f) +
|
return CVector3f(f31, 0.f, 0.f) +
|
||||||
CVector3f(f4, f4, f4) * (CVector3f(f30, f29, 0.f) - CVector3f(f31, 0.f, 0.f));
|
CVector3f(f4, f4, f4) * (CVector3f(f30, f29, 0.f) - CVector3f(f31, 0.f, 0.f));
|
||||||
|
// or:
|
||||||
|
// CVector3f d = CVector3f(f30, f29, 0.f) - CVector3f(f31, 0.f, 0.f);
|
||||||
|
// return CVector3f(f31, 0.f, 0.f) + CVector3f(f4 * d.GetX(), f4 * d.GetY(), f4 * d.GetZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPlayer::AttachActorToPlayer(TUniqueId id, bool disableGun) {
|
bool CPlayer::AttachActorToPlayer(TUniqueId id, bool disableGun) {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "MetroidPrime/ScriptObjects/CScriptColorModulate.hpp"
|
#include "MetroidPrime/ScriptObjects/CScriptColorModulate.hpp"
|
||||||
#include "MetroidPrime/ScriptObjects/CScriptTrigger.hpp"
|
#include "MetroidPrime/ScriptObjects/CScriptTrigger.hpp"
|
||||||
|
|
||||||
|
#include "Kyoto/Math/CVector3f.hpp"
|
||||||
#include "Kyoto/Math/CloseEnough.hpp"
|
#include "Kyoto/Math/CloseEnough.hpp"
|
||||||
|
|
||||||
CScriptActor::CScriptActor(TUniqueId uid, const rstl::string& name, const CEntityInfo& info,
|
CScriptActor::CScriptActor(TUniqueId uid, const rstl::string& name, const CEntityInfo& info,
|
||||||
|
@ -77,18 +78,18 @@ void CScriptActor::Think(float dt, CStateManager& mgr) {
|
||||||
GetAnimationData()->IsAnimTimeRemaining(dt - FLT_EPSILON, rstl::string_l("Whole Body"));
|
GetAnimationData()->IsAnimTimeRemaining(dt - FLT_EPSILON, rstl::string_l("Whole Body"));
|
||||||
const bool loop = GetModelData()->GetIsLoop();
|
const bool loop = GetModelData()->GetIsLoop();
|
||||||
|
|
||||||
const CAdvancementDeltas deltas = CActor::UpdateAnimation(dt, mgr, true);
|
CAdvancementDeltas deltas = CActor::UpdateAnimation(dt, mgr, true);
|
||||||
|
|
||||||
if (timeRemaining || loop) {
|
if (timeRemaining || loop) {
|
||||||
x2e2_26_animating = true;
|
x2e2_26_animating = true;
|
||||||
|
|
||||||
if (x2e2_30_scaleAdvancementDelta) {
|
if (x2e2_30_scaleAdvancementDelta) {
|
||||||
CVector3f rot = GetTransform().TransposeRotate(deltas.GetOffsetDelta());
|
CVector3f pos = GetTransform().TransposeRotate(deltas.GetOffsetDelta());
|
||||||
CVector3f scale = GetModelData()->GetScale();
|
CVector3f scale = GetModelData()->GetScale();
|
||||||
// CVector3f ret = GetTransform().Rotate(scale * rot);
|
pos = CVector3f(scale.GetX() * pos.GetX(), scale.GetY() * pos.GetY(),
|
||||||
CVector3f ret = GetTransform().Rotate(CVector3f(
|
scale.GetZ() * pos.GetZ());
|
||||||
scale.GetX() * rot.GetX(), scale.GetY() * rot.GetY(), scale.GetZ() * rot.GetZ()));
|
pos = GetTransform().Rotate(pos);
|
||||||
MoveToOR(ret, dt);
|
MoveToOR(pos, dt);
|
||||||
} else {
|
} else {
|
||||||
MoveToOR(deltas.GetOffsetDelta(), dt);
|
MoveToOR(deltas.GetOffsetDelta(), dt);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue