mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Util: Implement initEventCameraObject within NpcEventFlowUtil (#728)
This commit is contained in:
parent
0c1885e17f
commit
f2b32f130c
|
|
@ -155315,7 +155315,7 @@ Util/NpcEventFlowUtil.o:
|
|||
- offset: 0x559458
|
||||
size: 228
|
||||
label: _ZN2rs21initEventCameraObjectEPN2al17EventFlowExecutorERKNS0_13ActorInitInfoEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x55953c
|
||||
size: 220
|
||||
label: _ZN2rs34initEventCameraObjectAfterKeepPoseEPN2al17EventFlowExecutorERKNS0_13ActorInitInfoEPKc
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ public:
|
|||
void start(const CameraStartInfo& startInfo) override;
|
||||
void update() override;
|
||||
|
||||
void setIsCalcNearestAtFromPreAt(bool isCalcNearestAtFromPreAt) {
|
||||
mIsCalcNearestAtFromPreAt = isCalcNearestAtFromPreAt;
|
||||
}
|
||||
|
||||
private:
|
||||
sead::Vector3f mLookAtPos = {0.0f, 0.0f, 0.0f};
|
||||
f32 mDistance = 1800.0f;
|
||||
|
|
|
|||
42
lib/al/Library/Event/EventFlowDataHolder.h
Normal file
42
lib/al/Library/Event/EventFlowDataHolder.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#pragma once
|
||||
|
||||
#include <basis/seadTypes.h>
|
||||
#include <math/seadVector.h>
|
||||
#include <prim/seadSafeString.h>
|
||||
|
||||
namespace al {
|
||||
class CameraTicket;
|
||||
class LiveActor;
|
||||
class EventFlowEventData;
|
||||
class IUseCamera;
|
||||
|
||||
class EventFlowDataHolder {
|
||||
public:
|
||||
EventFlowDataHolder();
|
||||
|
||||
bool isExistCameraInfo(const char*) const;
|
||||
const char* getCameraName(s32) const;
|
||||
void initCamera(const char*, CameraTicket*);
|
||||
void initCameraSubTargetAfterChart(const LiveActor*);
|
||||
void stopMovementByNode();
|
||||
void restartMovementByNode();
|
||||
void initCharacterName(const char16*);
|
||||
void initItemType(s32);
|
||||
void addItemType(const char*);
|
||||
void setActorFront(const sead::Vector3f&);
|
||||
const char* tryGetCharacterName() const;
|
||||
void convertActionName(sead::BufferedSafeString*, const char*) const;
|
||||
s32 sendEvent(const EventFlowEventData*);
|
||||
const char* judgeQuery(const char*) const;
|
||||
void setTalkSubActorName(const char*);
|
||||
void tryCreateCameraInfoBySystem(const char*);
|
||||
void startEventCamera(IUseCamera*, const char*, s32);
|
||||
void startEventAnimCamera(IUseCamera*, const char*, const char*, s32);
|
||||
void endEventCamera(IUseCamera*, const char*, s32, bool);
|
||||
bool tryEndEventCameraIfPlaying(IUseCamera*, const char*, s32, bool);
|
||||
void endAllEventCamera(IUseCamera*);
|
||||
bool isEndInterpoleCamera(const IUseCamera*, const char*) const;
|
||||
bool isPlayingEventAnimCamera(const char*) const;
|
||||
};
|
||||
|
||||
} // namespace al
|
||||
44
lib/al/Library/Event/EventFlowExecutor.h
Normal file
44
lib/al/Library/Event/EventFlowExecutor.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#pragma once
|
||||
|
||||
#include "Library/Event/IUseEventFlowData.h"
|
||||
#include "Library/HostIO/HioNode.h"
|
||||
|
||||
namespace al {
|
||||
class EventFlowChart;
|
||||
class EventFlowDataHolder;
|
||||
class EventFlowMovement;
|
||||
class EventFlowNode;
|
||||
class EventFlowScareCtrlBase;
|
||||
class HitSensor;
|
||||
class LiveActor;
|
||||
|
||||
class EventFlowExecutor : public HioNode, public IUseEventFlowData {
|
||||
public:
|
||||
EventFlowExecutor();
|
||||
|
||||
void init(LiveActor*, EventFlowChart*, EventFlowDataHolder*);
|
||||
void initMovement(EventFlowMovement*);
|
||||
void initScareCtrl(EventFlowScareCtrlBase*);
|
||||
void initAfterPlacement();
|
||||
void start(const char*);
|
||||
void execute();
|
||||
void attackSensor(HitSensor* self, HitSensor* other);
|
||||
void stopMovement();
|
||||
void restartMovement();
|
||||
bool isExistEntry(const char*) const;
|
||||
bool isWaitAtPointMovement() const;
|
||||
EventFlowDataHolder* getEventFlowDataHolder() const override;
|
||||
|
||||
LiveActor* getActor() const { return mActor; }
|
||||
|
||||
private:
|
||||
LiveActor* mActor;
|
||||
EventFlowChart* mEventFlowChart;
|
||||
const char* mName;
|
||||
EventFlowDataHolder* mEventFlowDataHolder;
|
||||
EventFlowNode* mEventFlowNode;
|
||||
EventFlowMovement* mEventFlowMovement;
|
||||
void* _38;
|
||||
EventFlowScareCtrlBase* mEventFlowScareCtrlBase;
|
||||
};
|
||||
} // namespace al
|
||||
10
lib/al/Library/Event/IUseEventFlowData.h
Normal file
10
lib/al/Library/Event/IUseEventFlowData.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
namespace al {
|
||||
class EventFlowDataHolder;
|
||||
|
||||
class IUseEventFlowData {
|
||||
public:
|
||||
virtual EventFlowDataHolder* getEventFlowDataHolder() const = 0;
|
||||
};
|
||||
} // namespace al
|
||||
34
src/Util/NpcEventFlowUtil.cpp
Normal file
34
src/Util/NpcEventFlowUtil.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include "Util/NpcEventFlowUtil.h"
|
||||
|
||||
#include "Library/Base/StringUtil.h"
|
||||
#include "Library/Camera/CameraPoser.h"
|
||||
#include "Library/Camera/CameraPoserFix.h"
|
||||
#include "Library/Camera/CameraPoserFunction.h"
|
||||
#include "Library/Camera/CameraTicket.h"
|
||||
#include "Library/Camera/CameraUtil.h"
|
||||
#include "Library/Event/EventFlowDataHolder.h"
|
||||
#include "Library/Event/EventFlowExecutor.h"
|
||||
#include "Library/LiveActor/LiveActor.h"
|
||||
|
||||
namespace rs {
|
||||
|
||||
void initEventCameraObject(al::EventFlowExecutor* flowExecutor, const al::ActorInitInfo& initInfo,
|
||||
const char* name) {
|
||||
al::CameraTicket* cameraTicket =
|
||||
al::initObjectCamera(flowExecutor->getActor(), initInfo, name, "会話用2点間");
|
||||
alCameraFunction::initPriorityDemoTalk(cameraTicket);
|
||||
alCameraFunction::validateKeepPreSelfPoseNextCamera(cameraTicket);
|
||||
alCameraFunction::validateCameraInterpoleEaseOut(cameraTicket);
|
||||
|
||||
if (al::isEqualString(cameraTicket->getPoser()->getName(), "固定") ||
|
||||
al::isEqualString(cameraTicket->getPoser()->getName(), "完全固定") ||
|
||||
al::isEqualString(cameraTicket->getPoser()->getName(), "出入口専用固定")) {
|
||||
al::CameraPoserFix* poser = static_cast<al::CameraPoserFix*>(cameraTicket->getPoser());
|
||||
poser->setIsCalcNearestAtFromPreAt(true);
|
||||
alCameraPoserFunction::invalidateKeepDistanceNextCameraIfNoCollide(poser);
|
||||
}
|
||||
|
||||
flowExecutor->getEventFlowDataHolder()->initCamera(name, cameraTicket);
|
||||
}
|
||||
|
||||
} // namespace rs
|
||||
|
|
@ -13,4 +13,8 @@ al::EventFlowExecutor* initEventFlow(al::LiveActor*, const al::ActorInitInfo&, c
|
|||
void startEventFlow(al::EventFlowExecutor*, const char*);
|
||||
bool updateEventFlow(al::EventFlowExecutor*);
|
||||
void initEventMessageTagDataHolder(al::EventFlowExecutor*, const al::MessageTagDataHolder*);
|
||||
void initEventCameraObject(al::EventFlowExecutor* flowExecutor, const al::ActorInitInfo& initInfo,
|
||||
const char* name);
|
||||
void initEventCameraObjectAfterKeepPose(al::EventFlowExecutor* flowExecutor,
|
||||
const al::ActorInitInfo& initInfo, const char* name);
|
||||
} // namespace rs
|
||||
|
|
|
|||
Loading…
Reference in a new issue