mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Library/LiveActor: Implement ActorParamHolder (#748)
This commit is contained in:
parent
8f9440ed86
commit
a59feae933
|
|
@ -250298,79 +250298,81 @@ Library/LiveActor/ActorParamHolder.o:
|
|||
- offset: 0x8ebba0
|
||||
size: 12
|
||||
label: _ZN2al16ActorParamHolder11getYamlNameEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ebbac
|
||||
size: 20
|
||||
label:
|
||||
- _ZN2al14ActorParamInfoC1Ev
|
||||
- _ZN2al14ActorParamInfoC2Ev
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ebbc0
|
||||
size: 220
|
||||
label: _ZN2al16ActorParamHolder9tryCreateEPNS_9LiveActorEPKNS_8ResourceEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ebc9c
|
||||
size: 140
|
||||
label: _ZNK2al16ActorParamHolder12findParamS32EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ebd28
|
||||
size: 120
|
||||
label: _ZNK2al16ActorParamHolder22tryFindParamInfoByNameEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ebda0
|
||||
size: 140
|
||||
label: _ZNK2al16ActorParamHolder12findParamF32EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ebe2c
|
||||
size: 148
|
||||
label: _ZNK2al16ActorParamHolder13findParamMoveEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ebec0
|
||||
size: 148
|
||||
label: _ZNK2al16ActorParamHolder13findParamJumpEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ebf54
|
||||
size: 148
|
||||
label: _ZNK2al16ActorParamHolder14findParamSightEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ebfe8
|
||||
size: 148
|
||||
label: _ZNK2al16ActorParamHolder16findParamReboundEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ec07c
|
||||
size: 876
|
||||
label:
|
||||
- _ZN2al16ActorParamHolderC1EPNS_9LiveActorEPKNS_8ResourceEPKc
|
||||
- _ZN2al16ActorParamHolderC2EPNS_9LiveActorEPKNS_8ResourceEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
Library/LiveActor/ActorParamHolderUtil.o:
|
||||
'.text':
|
||||
- offset: 0x8ec3e8
|
||||
size: 24
|
||||
label: _ZN2al17findActorParamF32EPKNS_9LiveActorEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ec400
|
||||
size: 24
|
||||
label: _ZN2al17findActorParamS32EPKNS_9LiveActorEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ec418
|
||||
size: 24
|
||||
label: _ZN2al18findActorParamMoveEPKNS_9LiveActorEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ec430
|
||||
size: 24
|
||||
label: _ZN2al18findActorParamJumpEPKNS_9LiveActorEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ec448
|
||||
size: 24
|
||||
label: _ZN2al19findActorParamSightEPKNS_9LiveActorEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ec460
|
||||
size: 24
|
||||
label: _ZN2al21findActorParamReboundEPKNS_9LiveActorEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x8ec478
|
||||
size: 20
|
||||
label: _ZN2al17setActorParamMoveEPNS_14ActorParamMoveEffff
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
Library/LiveActor/ActorPoseKeeper.o:
|
||||
'.text':
|
||||
- offset: 0x8ec48c
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "Library/Collision/CollisionPartsTriangle.h"
|
||||
#include "Library/HitSensor/SensorFunction.h"
|
||||
#include "Library/LiveActor/ActorCollisionFunction.h"
|
||||
#include "Library/LiveActor/ActorParamMove.h"
|
||||
#include "Library/LiveActor/ActorParamHolder.h"
|
||||
#include "Library/LiveActor/ActorPoseKeeper.h"
|
||||
#include "Library/LiveActor/ActorPoseUtil.h"
|
||||
#include "Library/LiveActor/ActorSensorUtil.h"
|
||||
|
|
@ -1557,26 +1557,26 @@ void walkAndTurnPoseToDirection(LiveActor* actor, const sead::Vector3f& dir,
|
|||
if (getQuatPtr(actor)) {
|
||||
frontPtr = &frontForQuat;
|
||||
calcFrontDir(&frontForQuat, actor);
|
||||
turnToDirection(actor, dir, param.turnDegrees);
|
||||
turnToDirection(actor, dir, param.turnSpeedDegree);
|
||||
} else if (getFrontPtr(actor)) {
|
||||
frontPtr = getFrontPtr(actor);
|
||||
turnDirectionDegree(actor, frontPtr, dir, param.turnDegrees);
|
||||
turnDirectionDegree(actor, frontPtr, dir, param.turnSpeedDegree);
|
||||
} else
|
||||
return;
|
||||
|
||||
if (turnAlongGround)
|
||||
turnDirectionAlongGround(actor);
|
||||
|
||||
f32 forceFront = param.forceFront;
|
||||
f32 moveAccel = param.moveAccel;
|
||||
sead::Vector3f velFront;
|
||||
tryNormalizeOrZero(&velFront, *frontPtr);
|
||||
addVelocityInline(actor, velFront, forceFront);
|
||||
addVelocityInline(actor, velFront, moveAccel);
|
||||
|
||||
if (!isOnGround(actor, 3))
|
||||
addVelocityToGravity(actor, param.forceGravity);
|
||||
addVelocityToGravity(actor, param.gravity);
|
||||
|
||||
// BUG: should have been param.decay (_8)
|
||||
scaleVelocity(actor, param.forceFront);
|
||||
scaleVelocity(actor, param.moveAccel);
|
||||
}
|
||||
|
||||
void walkAndTurnToTarget(LiveActor* actor, const sead::Vector3f& target, f32 forceFront,
|
||||
|
|
@ -1711,8 +1711,8 @@ bool flyAndTurnToPlayer(LiveActor* actor, const ActorParamMove& param) {
|
|||
sead::Vector3f playerPos = {0.0f, 0.0f, 0.0f};
|
||||
if (!tryFindNearestPlayerPos(&playerPos, actor))
|
||||
return false;
|
||||
flyAndTurnToTarget(actor, playerPos, param.forceFront, param.forceGravity, param.decay,
|
||||
param.turnDegrees);
|
||||
flyAndTurnToTarget(actor, playerPos, param.moveAccel, param.gravity, param.moveFriction,
|
||||
param.turnSpeedDegree);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
163
lib/al/Library/LiveActor/ActorParamHolder.cpp
Normal file
163
lib/al/Library/LiveActor/ActorParamHolder.cpp
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
#include "Library/LiveActor/ActorParamHolder.h"
|
||||
|
||||
#include "Library/Base/StringUtil.h"
|
||||
#include "Library/LiveActor/ActorResourceFunction.h"
|
||||
#include "Library/Resource/ResourceFunction.h"
|
||||
#include "Library/Yaml/ByamlIter.h"
|
||||
|
||||
namespace al {
|
||||
|
||||
static ActorParamS32 gParamS32;
|
||||
static ActorParamF32 gParamF32;
|
||||
static ActorParamMove gParamMove;
|
||||
static ActorParamJump gParamJump;
|
||||
static ActorParamSight gParamSight;
|
||||
static ActorParamRebound gParamRebound;
|
||||
|
||||
ActorParamInfo::ActorParamInfo() = default;
|
||||
|
||||
const char* ActorParamHolder::getYamlName() {
|
||||
return "ActorParam";
|
||||
}
|
||||
|
||||
ActorParamHolder* ActorParamHolder::tryCreate(LiveActor* actor, const Resource* resource,
|
||||
const char* suffix) {
|
||||
sead::FixedSafeString<0x80> fileName;
|
||||
tryGetActorInitFileName(&fileName, resource, getYamlName(), suffix);
|
||||
|
||||
if (!isExistResourceYaml(resource, fileName.cstr(), nullptr))
|
||||
return nullptr;
|
||||
|
||||
return new ActorParamHolder(actor, resource, suffix);
|
||||
}
|
||||
|
||||
ActorParamHolder::ActorParamHolder(LiveActor* actor, const Resource* resource, const char* suffix) {
|
||||
ByamlIter actorParamIter;
|
||||
|
||||
tryGetActorInitFileIter(&actorParamIter, resource, getYamlName(), suffix);
|
||||
mSize = actorParamIter.getSize();
|
||||
mInfoArray = new ActorParamInfo[mSize];
|
||||
|
||||
for (s32 i = 0; i < mSize; i++) {
|
||||
ActorParamInfo* info = &mInfoArray[i];
|
||||
ByamlIter iter;
|
||||
actorParamIter.tryGetIterByIndex(&iter, i);
|
||||
|
||||
iter.tryGetStringByKey(&info->name, "ParamName");
|
||||
|
||||
ByamlIter iterKey;
|
||||
if (iter.tryGetIterByKey(&iterKey, "S32")) {
|
||||
info->type = ActorParamType::S32;
|
||||
iterKey.tryGetIntByKey(&info->paramS32.value, "ParamS32");
|
||||
continue;
|
||||
}
|
||||
if (iter.tryGetIterByKey(&iterKey, "F32")) {
|
||||
info->type = ActorParamType::F32;
|
||||
iterKey.tryGetFloatByKey(&info->paramF32.value, "ParamF32");
|
||||
continue;
|
||||
}
|
||||
if (iter.tryGetIterByKey(&iterKey, "ActorParamMove")) {
|
||||
info->type = ActorParamType::Move;
|
||||
ActorParamMove* param = new ActorParamMove;
|
||||
iterKey.tryGetFloatByKey(¶m->moveAccel, "MoveAccel");
|
||||
iterKey.tryGetFloatByKey(¶m->gravity, "Gravity");
|
||||
iterKey.tryGetFloatByKey(¶m->moveFriction, "MoveFriction");
|
||||
iterKey.tryGetFloatByKey(¶m->turnSpeedDegree, "TurnSpeedDegree");
|
||||
info->paramMove = param;
|
||||
continue;
|
||||
}
|
||||
if (iter.tryGetIterByKey(&iterKey, "ActorParamJump")) {
|
||||
info->type = ActorParamType::Jump;
|
||||
ActorParamJump* param = new ActorParamJump;
|
||||
iterKey.tryGetFloatByKey(¶m->speedFront, "SpeedFront");
|
||||
iterKey.tryGetFloatByKey(¶m->speedUp, "SpeedUp");
|
||||
info->paramJump = param;
|
||||
continue;
|
||||
}
|
||||
if (iter.tryGetIterByKey(&iterKey, "ActorParamSight")) {
|
||||
info->type = ActorParamType::Sight;
|
||||
ActorParamSight* param = new ActorParamSight;
|
||||
iterKey.tryGetFloatByKey(¶m->distance, "Distance");
|
||||
iterKey.tryGetFloatByKey(¶m->degreeH, "DegreeH");
|
||||
iterKey.tryGetFloatByKey(¶m->degreeV, "DegreeV");
|
||||
info->paramSight = param;
|
||||
continue;
|
||||
}
|
||||
if (iter.tryGetIterByKey(&iterKey, "ActorParamRebound")) {
|
||||
info->type = ActorParamType::Rebound;
|
||||
ActorParamRebound* param = new ActorParamRebound;
|
||||
iterKey.tryGetFloatByKey(¶m->reboundRate, "ReboundRate");
|
||||
iterKey.tryGetFloatByKey(¶m->speedMinToRebound, "SpeedMinToRebound");
|
||||
iterKey.tryGetFloatByKey(¶m->frictionH, "FrictionH");
|
||||
info->paramRebound = param;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ActorParamInfo* ActorParamHolder::tryFindParamInfoByName(const char* name) const {
|
||||
for (s32 i = 0; i < mSize; i++) {
|
||||
ActorParamInfo* info = &mInfoArray[i];
|
||||
|
||||
if (isEqualString(info->name, name))
|
||||
return info;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ActorParamS32* ActorParamHolder::findParamS32(const char* name) const {
|
||||
ActorParamInfo* info = tryFindParamInfoByName(name);
|
||||
|
||||
if (!info)
|
||||
return &gParamS32;
|
||||
|
||||
return &info->paramS32;
|
||||
}
|
||||
|
||||
ActorParamF32* ActorParamHolder::findParamF32(const char* name) const {
|
||||
ActorParamInfo* info = tryFindParamInfoByName(name);
|
||||
|
||||
if (!info)
|
||||
return &gParamF32;
|
||||
|
||||
return &info->paramF32;
|
||||
}
|
||||
|
||||
ActorParamMove* ActorParamHolder::findParamMove(const char* name) const {
|
||||
ActorParamInfo* info = tryFindParamInfoByName(name);
|
||||
|
||||
if (!info)
|
||||
return &gParamMove;
|
||||
|
||||
return info->paramMove;
|
||||
}
|
||||
|
||||
ActorParamJump* ActorParamHolder::findParamJump(const char* name) const {
|
||||
ActorParamInfo* info = tryFindParamInfoByName(name);
|
||||
|
||||
if (!info)
|
||||
return &gParamJump;
|
||||
|
||||
return info->paramJump;
|
||||
}
|
||||
|
||||
ActorParamSight* ActorParamHolder::findParamSight(const char* name) const {
|
||||
ActorParamInfo* info = tryFindParamInfoByName(name);
|
||||
|
||||
if (!info)
|
||||
return &gParamSight;
|
||||
|
||||
return info->paramSight;
|
||||
}
|
||||
|
||||
ActorParamRebound* ActorParamHolder::findParamRebound(const char* name) const {
|
||||
ActorParamInfo* info = tryFindParamInfoByName(name);
|
||||
|
||||
if (!info)
|
||||
return &gParamRebound;
|
||||
|
||||
return info->paramRebound;
|
||||
}
|
||||
|
||||
} // namespace al
|
||||
|
|
@ -6,18 +6,102 @@ namespace al {
|
|||
class LiveActor;
|
||||
class Resource;
|
||||
|
||||
enum class ActorParamType : s32 {
|
||||
None = -1,
|
||||
S32 = 0,
|
||||
F32 = 1,
|
||||
Move = 2,
|
||||
Jump = 3,
|
||||
Sight = 4,
|
||||
Rebound = 5,
|
||||
};
|
||||
|
||||
struct ActorParamS32 {
|
||||
s32 value;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ActorParamS32) == 0x4);
|
||||
|
||||
struct ActorParamF32 {
|
||||
f32 value;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ActorParamF32) == 0x4);
|
||||
|
||||
struct ActorParamMove {
|
||||
f32 moveAccel;
|
||||
f32 gravity;
|
||||
f32 moveFriction;
|
||||
f32 turnSpeedDegree;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ActorParamMove) == 0x10);
|
||||
|
||||
struct ActorParamJump {
|
||||
f32 speedFront;
|
||||
f32 speedUp;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ActorParamJump) == 0x8);
|
||||
|
||||
struct ActorParamSight {
|
||||
f32 distance;
|
||||
f32 degreeH;
|
||||
f32 degreeV;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ActorParamSight) == 0xc);
|
||||
|
||||
struct ActorParamRebound {
|
||||
f32 reboundRate;
|
||||
f32 speedMinToRebound;
|
||||
f32 frictionH;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ActorParamRebound) == 0xc);
|
||||
|
||||
struct ActorParamInfo {
|
||||
ActorParamInfo();
|
||||
|
||||
const char* name = nullptr;
|
||||
ActorParamType type = ActorParamType::None;
|
||||
|
||||
union {
|
||||
ActorParamS32 paramS32 = {.value = 0};
|
||||
ActorParamF32 paramF32;
|
||||
ActorParamMove* paramMove;
|
||||
ActorParamJump* paramJump;
|
||||
ActorParamSight* paramSight;
|
||||
ActorParamRebound* paramRebound;
|
||||
};
|
||||
};
|
||||
|
||||
static_assert(sizeof(ActorParamInfo) == 0x18);
|
||||
|
||||
class ActorParamHolder {
|
||||
public:
|
||||
static const char* getYamlName();
|
||||
static ActorParamHolder* tryCreate(LiveActor* actor, const Resource* resource,
|
||||
const char* suffix);
|
||||
|
||||
f32 findParamF32(const char*);
|
||||
// NOTE: for all of these: if the name and type of `findParam` do not align,
|
||||
// it will just re-cast the memory and potentially return garbage/crash
|
||||
|
||||
ActorParamS32* findParamS32(const char* name) const;
|
||||
ActorParamF32* findParamF32(const char* name) const;
|
||||
ActorParamMove* findParamMove(const char* name) const;
|
||||
ActorParamJump* findParamJump(const char* name) const;
|
||||
ActorParamSight* findParamSight(const char* name) const;
|
||||
ActorParamRebound* findParamRebound(const char* name) const;
|
||||
|
||||
private:
|
||||
ActorParamHolder(LiveActor* actor, const Resource* resource, const char* suffix);
|
||||
ActorParamInfo* tryFindParamInfoByName(const char* name) const;
|
||||
|
||||
s32 mSize = 0;
|
||||
ActorParamInfo* mInfoArray = nullptr;
|
||||
};
|
||||
|
||||
f32* findActorParamF32(const LiveActor* actor, const char* paramName);
|
||||
s32* findActorParamS32(const LiveActor* actor, const char* paramName);
|
||||
static_assert(sizeof(ActorParamHolder) == 0x10);
|
||||
|
||||
} // namespace al
|
||||
|
|
|
|||
65
lib/al/Library/LiveActor/ActorParamHolderUtil.cpp
Normal file
65
lib/al/Library/LiveActor/ActorParamHolderUtil.cpp
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
#include "Library/LiveActor/ActorParamHolderUtil.h"
|
||||
|
||||
#include "Library/LiveActor/ActorParamHolder.h"
|
||||
#include "Library/LiveActor/LiveActor.h"
|
||||
|
||||
namespace al {
|
||||
|
||||
static ActorParamS32 gParamS32;
|
||||
static ActorParamF32 gParamF32;
|
||||
static ActorParamMove gParamMove;
|
||||
static ActorParamJump gParamJump;
|
||||
static ActorParamSight gParamSight;
|
||||
static ActorParamRebound gParamRebound;
|
||||
|
||||
ActorParamF32* findActorParamF32(const LiveActor* actor, const char* paramName) {
|
||||
if (actor->getActorParamHolder())
|
||||
return actor->getActorParamHolder()->findParamF32(paramName);
|
||||
|
||||
return &gParamF32;
|
||||
}
|
||||
|
||||
ActorParamS32* findActorParamS32(const LiveActor* actor, const char* paramName) {
|
||||
if (actor->getActorParamHolder())
|
||||
return actor->getActorParamHolder()->findParamS32(paramName);
|
||||
|
||||
return &gParamS32;
|
||||
}
|
||||
|
||||
ActorParamMove* findActorParamMove(const LiveActor* actor, const char* paramName) {
|
||||
if (actor->getActorParamHolder())
|
||||
return actor->getActorParamHolder()->findParamMove(paramName);
|
||||
|
||||
return &gParamMove;
|
||||
}
|
||||
|
||||
ActorParamJump* findActorParamJump(const LiveActor* actor, const char* paramName) {
|
||||
if (actor->getActorParamHolder())
|
||||
return actor->getActorParamHolder()->findParamJump(paramName);
|
||||
|
||||
return &gParamJump;
|
||||
}
|
||||
|
||||
ActorParamSight* findActorParamSight(const LiveActor* actor, const char* paramName) {
|
||||
if (actor->getActorParamHolder())
|
||||
return actor->getActorParamHolder()->findParamSight(paramName);
|
||||
|
||||
return &gParamSight;
|
||||
}
|
||||
|
||||
ActorParamRebound* findActorParamRebound(const LiveActor* actor, const char* paramName) {
|
||||
if (actor->getActorParamHolder())
|
||||
return actor->getActorParamHolder()->findParamRebound(paramName);
|
||||
|
||||
return &gParamRebound;
|
||||
}
|
||||
|
||||
void setActorParamMove(ActorParamMove* paramMove, f32 moveAccel, f32 gravity, f32 moveFriction,
|
||||
f32 turnSpeedDegree) {
|
||||
paramMove->moveAccel = moveAccel;
|
||||
paramMove->gravity = gravity;
|
||||
paramMove->moveFriction = moveFriction;
|
||||
paramMove->turnSpeedDegree = turnSpeedDegree;
|
||||
}
|
||||
|
||||
} // namespace al
|
||||
23
lib/al/Library/LiveActor/ActorParamHolderUtil.h
Normal file
23
lib/al/Library/LiveActor/ActorParamHolderUtil.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <basis/seadTypes.h>
|
||||
|
||||
namespace al {
|
||||
struct ActorParamF32;
|
||||
struct ActorParamJump;
|
||||
struct ActorParamMove;
|
||||
struct ActorParamRebound;
|
||||
struct ActorParamS32;
|
||||
struct ActorParamSight;
|
||||
class LiveActor;
|
||||
|
||||
ActorParamF32* findActorParamF32(const LiveActor* actor, const char* paramName);
|
||||
ActorParamS32* findActorParamS32(const LiveActor* actor, const char* paramName);
|
||||
ActorParamMove* findActorParamMove(const LiveActor* actor, const char* paramName);
|
||||
ActorParamJump* findActorParamJump(const LiveActor* actor, const char* paramName);
|
||||
ActorParamSight* findActorParamSight(const LiveActor* actor, const char* paramName);
|
||||
ActorParamRebound* findActorParamRebound(const LiveActor* actor, const char* paramName);
|
||||
void setActorParamMove(ActorParamMove* paramMove, f32 moveAccel, f32 gravity, f32 moveFriction,
|
||||
f32 turnSpeedDegree);
|
||||
|
||||
} // namespace al
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <basis/seadTypes.h>
|
||||
|
||||
namespace al {
|
||||
struct ActorParamMove {
|
||||
public:
|
||||
f32 forceFront;
|
||||
f32 forceGravity;
|
||||
f32 decay;
|
||||
f32 turnDegrees;
|
||||
};
|
||||
} // namespace al
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "Library/LiveActor/ActorActionFunction.h"
|
||||
#include "Library/LiveActor/ActorMovementFunction.h"
|
||||
#include "Library/LiveActor/ActorParamMove.h"
|
||||
#include "Library/LiveActor/ActorParamHolder.h"
|
||||
#include "Library/LiveActor/ActorPoseUtil.h"
|
||||
#include "Library/Math/MathUtil.h"
|
||||
#include "Library/Nerve/NerveSetupUtil.h"
|
||||
|
|
@ -40,9 +40,8 @@ void FlyerStateWander::exeWander() {
|
|||
}
|
||||
|
||||
const al::ActorParamMove* actorParamMove = mFlyerStateWanderParam->getActorParamMove();
|
||||
al::flyAndTurnToTarget(mActor, mStartTrans, actorParamMove->forceFront,
|
||||
actorParamMove->forceGravity, actorParamMove->decay,
|
||||
actorParamMove->turnDegrees);
|
||||
al::flyAndTurnToTarget(mActor, mStartTrans, actorParamMove->moveAccel, actorParamMove->gravity,
|
||||
actorParamMove->moveFriction, actorParamMove->turnSpeedDegree);
|
||||
|
||||
if (al::isGreaterEqualStep(this, mNerveTime))
|
||||
al::setNerve(this, &Wait);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "Library/LiveActor/ActorInitInfo.h"
|
||||
#include "Library/LiveActor/ActorInitUtil.h"
|
||||
#include "Library/LiveActor/ActorMovementFunction.h"
|
||||
#include "Library/LiveActor/ActorParamMove.h"
|
||||
#include "Library/LiveActor/ActorParamHolder.h"
|
||||
#include "Library/LiveActor/ActorPoseKeeper.h"
|
||||
#include "Library/LiveActor/ActorPoseUtil.h"
|
||||
#include "Library/LiveActor/ActorSensorUtil.h"
|
||||
|
|
@ -47,7 +47,7 @@ NERVES_MAKE_STRUCT(KaronWing, Wait, Hack, Swoon, Break, Revive, HackStart, Wande
|
|||
DamageCap, Turn, Find, Chase, ReviveAppear);
|
||||
} // namespace
|
||||
|
||||
const al::ActorParamMove cMoveParam{0.1f, 0.0f, 0.95f, 0.7f};
|
||||
static al::ActorParamMove cMoveParam{0.1f, 0.0f, 0.95f, 0.7f};
|
||||
static FlyerStateWanderParam cWanderParam{30, 540, 180, "EnemyFly", &cMoveParam};
|
||||
|
||||
// NON_MATCHING: creating the `EnemyStateSwoonInitParam` (https://decomp.me/scratch/CDB2W)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "Player/HackCapThrowParam.h"
|
||||
|
||||
#include "Library/LiveActor/ActorParamHolder.h"
|
||||
#include "Library/LiveActor/ActorParamHolderUtil.h"
|
||||
|
||||
HackCapThrowParam::HackCapThrowParam(al::LiveActor* actor) {
|
||||
mHackThrowHeight = al::findActorParamF32(actor, "投げる高さ");
|
||||
|
|
|
|||
|
|
@ -3,36 +3,38 @@
|
|||
#include <basis/seadTypes.h>
|
||||
|
||||
namespace al {
|
||||
struct ActorParamF32;
|
||||
struct ActorParamS32;
|
||||
class LiveActor;
|
||||
}
|
||||
} // namespace al
|
||||
|
||||
class HackCapThrowParam {
|
||||
public:
|
||||
HackCapThrowParam(al::LiveActor* actor);
|
||||
|
||||
private:
|
||||
f32* mHackThrowHeight;
|
||||
f32* mMaxVel;
|
||||
f32* mContinuousThrowSpeed;
|
||||
s32* mBreakTime;
|
||||
f32* mMaxDist;
|
||||
s32* mEndpointStopTime;
|
||||
s32* mMaxEndpointStopTime;
|
||||
f32* mReturnStrength;
|
||||
f32* mMaxRetSpeed;
|
||||
f32* mTurnAngleLimit;
|
||||
f32* mWaterMaxSpeed;
|
||||
f32* mWaterDist;
|
||||
s32* mWaterBreakTime;
|
||||
f32* mWaterMaxRetSpeed;
|
||||
f32* mTornadoDist;
|
||||
f32* mTornadoMaxDist;
|
||||
s32* mTornadoReflectTime;
|
||||
f32* mRollSpeed;
|
||||
f32* mRollDistTop;
|
||||
f32* mRollDistBottom;
|
||||
s32* mRollBrakeTimeTop;
|
||||
s32* mRollBrakeTimeBottom;
|
||||
f32* mRollGroundGroundedPoseTrack;
|
||||
f32* mRollGroundAerialPoseTrack;
|
||||
al::ActorParamF32* mHackThrowHeight;
|
||||
al::ActorParamF32* mMaxVel;
|
||||
al::ActorParamF32* mContinuousThrowSpeed;
|
||||
al::ActorParamS32* mBreakTime;
|
||||
al::ActorParamF32* mMaxDist;
|
||||
al::ActorParamS32* mEndpointStopTime;
|
||||
al::ActorParamS32* mMaxEndpointStopTime;
|
||||
al::ActorParamF32* mReturnStrength;
|
||||
al::ActorParamF32* mMaxRetSpeed;
|
||||
al::ActorParamF32* mTurnAngleLimit;
|
||||
al::ActorParamF32* mWaterMaxSpeed;
|
||||
al::ActorParamF32* mWaterDist;
|
||||
al::ActorParamS32* mWaterBreakTime;
|
||||
al::ActorParamF32* mWaterMaxRetSpeed;
|
||||
al::ActorParamF32* mTornadoDist;
|
||||
al::ActorParamF32* mTornadoMaxDist;
|
||||
al::ActorParamS32* mTornadoReflectTime;
|
||||
al::ActorParamF32* mRollSpeed;
|
||||
al::ActorParamF32* mRollDistTop;
|
||||
al::ActorParamF32* mRollDistBottom;
|
||||
al::ActorParamS32* mRollBrakeTimeTop;
|
||||
al::ActorParamS32* mRollBrakeTimeBottom;
|
||||
al::ActorParamF32* mRollGroundGroundedPoseTrack;
|
||||
al::ActorParamF32* mRollGroundAerialPoseTrack;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue