mirror of
https://github.com/SMGCommunity/Petari.git
synced 2024-11-24 14:09:51 +00:00
start on some LiveActor & utilities
This commit is contained in:
parent
b591515b7d
commit
b79f2a1ed9
@ -327,8 +327,8 @@ disableCallBack__11IKJointCtrlFv,IKJointCtrl.o,LiveActor.a,false
|
||||
enableCallBack__11IKJointCtrlFv,IKJointCtrl.o,LiveActor.a,false
|
||||
for_each<PP11IKJointCtrl,Q23std26mem_fun_t<v,11IKJointCtrl>>__3stdFPP11IKJointCtrlPP11IKJointCtrlQ23std26mem_fun_t<v,11IKJointCtrl>_Q23std26mem_fun_t<v,11IKJointCtrl>,IKJointCtrl.o,LiveActor.a,false
|
||||
__ct__9LiveActorFPCc,LiveActor.o,LiveActor.a,false
|
||||
init__9LiveActorFRC12JMapInfoIter,LiveActor.o,LiveActor.a,false
|
||||
appear__9LiveActorFv,LiveActor.o,LiveActor.a,false
|
||||
init__9LiveActorFRC12JMapInfoIter,LiveActor.o,LiveActor.a,true
|
||||
appear__9LiveActorFv,LiveActor.o,LiveActor.a,true
|
||||
makeActorAppeared__9LiveActorFv,LiveActor.o,LiveActor.a,false
|
||||
kill__9LiveActorFv,LiveActor.o,LiveActor.a,false
|
||||
makeActorDead__9LiveActorFv,LiveActor.o,LiveActor.a,false
|
||||
|
|
30
csv/Util.csv
30
csv/Util.csv
@ -40,24 +40,24 @@ startRumbleWithShakeCameraWeak__2MRFPC9LiveActorPCcPCcff,ActorCameraUtil.o,Util.
|
||||
startRumbleWithShakeCameraNormalWeak__2MRFPC9LiveActorPCcPCcff,ActorCameraUtil.o,Util.a,false
|
||||
startRumbleWithShakeCameraStrong__2MRFPC9LiveActorPCcPCcff,ActorCameraUtil.o,Util.a,false
|
||||
__ct__15CameraTargetArgFv,ActorCameraUtil.o,Util.a,false
|
||||
calcDistance__2MRFPC9HitSensorPC9HitSensorPQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,false
|
||||
calcDistance__2MRFPC9LiveActorRCQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,false
|
||||
calcDistanceHorizontal__2MRFPC9LiveActorRCQ29JGeometry8TVec3<f>RCQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,false
|
||||
calcDistanceVertical__2MRFPC9LiveActorRCQ29JGeometry8TVec3<f>RCQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,false
|
||||
calcDistance__2MRFPC9HitSensorPC9HitSensorPQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,true
|
||||
calcDistance__2MRFPC9LiveActorRCQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,true
|
||||
calcDistanceHorizontal__2MRFPC9LiveActorRCQ29JGeometry8TVec3<f>RCQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,true
|
||||
calcDistanceVertical__2MRFPC9LiveActorRCQ29JGeometry8TVec3<f>RCQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,true
|
||||
calcDistanceVertical__2MRFPC9LiveActorRCQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,false
|
||||
calcDistanceToPlayer__2MRFPC9LiveActor,ActorMovementUtil.o,Util.a,false
|
||||
calcDistanceToPlayer__2MRFPC9LiveActor,ActorMovementUtil.o,Util.a,true
|
||||
calcDistanceToPlayerH__2MRFPC9LiveActor,ActorMovementUtil.o,Util.a,false
|
||||
isNear__2MRFPC9HitSensorPC9HitSensorf,ActorMovementUtil.o,Util.a,false
|
||||
isNear__2MRFPC9LiveActorPC9LiveActorf,ActorMovementUtil.o,Util.a,false
|
||||
isNear__2MRFPC9LiveActorRCQ29JGeometry8TVec3<f>f,ActorMovementUtil.o,Util.a,false
|
||||
isNearPlayer__2MRFPC9LiveActorf,ActorMovementUtil.o,Util.a,false
|
||||
isNearPlayerAnyTime__2MRFPC9LiveActorf,ActorMovementUtil.o,Util.a,false
|
||||
isNearPlayer__2MRFRCQ29JGeometry8TVec3<f>f,ActorMovementUtil.o,Util.a,false
|
||||
isNear__2MRFPC9HitSensorPC9HitSensorf,ActorMovementUtil.o,Util.a,true
|
||||
isNear__2MRFPC9LiveActorPC9LiveActorf,ActorMovementUtil.o,Util.a,true
|
||||
isNear__2MRFPC9LiveActorRCQ29JGeometry8TVec3<f>f,ActorMovementUtil.o,Util.a,true
|
||||
isNearPlayer__2MRFPC9LiveActorf,ActorMovementUtil.o,Util.a,true
|
||||
isNearPlayerAnyTime__2MRFPC9LiveActorf,ActorMovementUtil.o,Util.a,true
|
||||
isNearPlayer__2MRFRCQ29JGeometry8TVec3<f>f,ActorMovementUtil.o,Util.a,true
|
||||
isNearPlayerPose__2MRFPC9LiveActorff,ActorMovementUtil.o,Util.a,false
|
||||
isNearPlayerHorizontal__2MRFPC9LiveActorf,ActorMovementUtil.o,Util.a,false
|
||||
calcFrontVec__2MRFPQ29JGeometry8TVec3<f>PC9LiveActor,ActorMovementUtil.o,Util.a,false
|
||||
calcUpVec__2MRFPQ29JGeometry8TVec3<f>PC9LiveActor,ActorMovementUtil.o,Util.a,false
|
||||
calcSideVec__2MRFPQ29JGeometry8TVec3<f>PC9LiveActor,ActorMovementUtil.o,Util.a,false
|
||||
calcFrontVec__2MRFPQ29JGeometry8TVec3<f>PC9LiveActor,ActorMovementUtil.o,Util.a,true
|
||||
calcUpVec__2MRFPQ29JGeometry8TVec3<f>PC9LiveActor,ActorMovementUtil.o,Util.a,true
|
||||
calcSideVec__2MRFPQ29JGeometry8TVec3<f>PC9LiveActor,ActorMovementUtil.o,Util.a,true
|
||||
calcPositionUpOffset__2MRFPQ29JGeometry8TVec3<f>PC9LiveActorf,ActorMovementUtil.o,Util.a,false
|
||||
calcVecToPlayerH__2MRFPQ29JGeometry8TVec3<f>PC9LiveActorPCQ29JGeometry8TVec3<f>,ActorMovementUtil.o,Util.a,false
|
||||
calcVecFromPlayerH__2MRFPQ29JGeometry8TVec3<f>PC9LiveActor,ActorMovementUtil.o,Util.a,false
|
||||
@ -1478,7 +1478,7 @@ isValidMovement__2MRFPC9LiveActor,LiveActorUtil.o,Util.a,false
|
||||
isValidCalcAnim__2MRFPC9LiveActor,LiveActorUtil.o,Util.a,false
|
||||
isValidCalcViewAndEntry__2MRFPC9LiveActor,LiveActorUtil.o,Util.a,false
|
||||
isValidDraw__2MRFPC9LiveActor,LiveActorUtil.o,Util.a,false
|
||||
calcAnimDirect__2MRFP9LiveActor,LiveActorUtil.o,Util.a,false
|
||||
calcAnimDirect__2MRFP9LiveActor,LiveActorUtil.o,Util.a,true
|
||||
setClippingTypeSphere__2MRFP9LiveActorf,LiveActorUtil.o,Util.a,false
|
||||
setClippingTypeSphere__2MRFP9LiveActorfPCQ29JGeometry8TVec3<f>,LiveActorUtil.o,Util.a,false
|
||||
setClippingTypeSphereContainsModelBoundingBox__2MRFP9LiveActorf,LiveActorUtil.o,Util.a,false
|
||||
|
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "decompiled",
|
||||
"message": "1.5088522%",
|
||||
"message": "1.5386465%",
|
||||
"color": "blue"
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#define SceneObj_LightDirector 0x6
|
||||
#define SceneObj_StageDataHolder 0x8
|
||||
#define SceneObj_AreaObjContainer 0xD
|
||||
#define SceneObj_MarioHolder 0x14
|
||||
#define SceneObj_PlacementStateChecker 0x27
|
||||
#define SceneObj_AllLiveActorGroup 0x30
|
||||
#define SceneObj_NameObjExecuteHolder 0x58
|
||||
@ -18,4 +19,6 @@ public:
|
||||
|
||||
namespace MR {
|
||||
SceneObjHolder* getSceneObjHolder();
|
||||
|
||||
bool isExistSceneObj(int);
|
||||
};
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Game/Util/ActorMovementUtil.h"
|
||||
#include "Game/Util/ActorSensorUtil.h"
|
||||
#include "Game/Util/AreaObjUtil.h"
|
||||
#include "Game/Util/Array.h"
|
||||
|
30
include/Game/Util/ActorMovementUtil.h
Normal file
30
include/Game/Util/ActorMovementUtil.h
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <revolution.h>
|
||||
#include "JSystem/JGeometry/TVec.h"
|
||||
|
||||
class LiveActor;
|
||||
class HitSensor;
|
||||
|
||||
namespace MR {
|
||||
f32 calcDistance(const HitSensor *, const HitSensor *, TVec3f *);
|
||||
f32 calcDistance(const LiveActor *, const TVec3f &);
|
||||
f32 calcDistanceHorizontal(const LiveActor *, const TVec3f &, const TVec3f &);
|
||||
f32 calcDistanceVertical(const LiveActor *, const TVec3f &, const TVec3f &);
|
||||
f32 calcDistanceVertical(const LiveActor *, const TVec3f &);
|
||||
f32 calcDistanceToPlayer(const LiveActor *);
|
||||
f32 calcDistanceToPlayerH(const LiveActor *);
|
||||
bool isNear(const HitSensor *, const HitSensor *, f32);
|
||||
bool isNear(const LiveActor *, const LiveActor *, f32);
|
||||
bool isNear(const LiveActor *, const TVec3f &, f32);
|
||||
bool isNearPlayer(const LiveActor *, f32);
|
||||
bool isNearPlayerAnyTime(const LiveActor *, f32);
|
||||
bool isNearPlayer(const TVec3f &, f32);
|
||||
bool isNearPlayerPose(const LiveActor *, f32, f32);
|
||||
bool isNearPlayerHorizontal(const LiveActor *, f32);
|
||||
void calcFrontVec(TVec3f *, const LiveActor *);
|
||||
void calcUpVec(TVec3f *, const LiveActor *);
|
||||
void calcSideVec(TVec3f *, const LiveActor *);
|
||||
void calcPositionUpOffset(TVec3f *, const LiveActor *, f32);
|
||||
|
||||
};
|
@ -7,7 +7,9 @@ namespace MR {
|
||||
void copyTransRotateScale(const LiveActor *, LiveActor *);
|
||||
bool isDead(const LiveActor *);
|
||||
|
||||
bool isValidDraw(const LiveActor *);
|
||||
bool isClipped(const LiveActor *);
|
||||
bool isInvalidClipping(const LiveActor *);
|
||||
|
||||
ResourceHolder* getResourceHolder(const LiveActor *);
|
||||
|
||||
@ -17,4 +19,6 @@ namespace MR {
|
||||
void offEntryDrawBuffer(LiveActor *);
|
||||
|
||||
const char* getModelResName(const LiveActor *);
|
||||
|
||||
void calcAnimDirect(LiveActor *);
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "JSystem/JGeometry/TVec.h"
|
||||
#include <revolution.h>
|
||||
|
||||
class LiveActor;
|
||||
|
||||
namespace MR {
|
||||
TVec3f* getPlayerPos();
|
||||
@ -12,5 +15,9 @@ namespace MR {
|
||||
|
||||
bool isPlayerBindedBigBubble();
|
||||
|
||||
bool isPlayerHidden();
|
||||
|
||||
bool isNearPlayerAnyTime(const LiveActor *, f32);
|
||||
|
||||
void forceKillPlayerByAbyss();
|
||||
};
|
||||
|
@ -48,6 +48,7 @@ namespace JGeometry {
|
||||
|
||||
T setLength(T);
|
||||
T squared() const;
|
||||
T squared(const JGeometry::TVec3<T> &) const;
|
||||
void zero();
|
||||
|
||||
void sub(const JGeometry::TVec3<T> &);
|
||||
@ -56,6 +57,7 @@ namespace JGeometry {
|
||||
|
||||
void scale(T);
|
||||
void scale(T, const JGeometry::TVec3<T> &);
|
||||
void scale(const JGeometry::TVec3<T> &);
|
||||
|
||||
f32 dot(register const JGeometry::TVec3<f32> &rOther) const; //{
|
||||
/*register const JGeometry::TVec3<f32>* this_vec = this;
|
||||
|
@ -3,4 +3,6 @@
|
||||
#include <revolution.h>
|
||||
|
||||
const f32 PI = 3.1415927f;
|
||||
const f32 TWO_PI = 6.2831855f;
|
||||
const f32 TWO_PI = 6.2831855f;
|
||||
|
||||
const f32 FLOAT_MAX = 3.4028235e38;
|
10
source/Game/LiveActor/LiveActor.cpp
Normal file
10
source/Game/LiveActor/LiveActor.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include "Game/LiveActor/LiveActor.h"
|
||||
|
||||
void LiveActor::init(const JMapInfoIter &) {
|
||||
|
||||
}
|
||||
|
||||
void LiveActor::appear() {
|
||||
makeActorAppeared();
|
||||
}
|
||||
|
102
source/Game/Util/ActorMovementUtil.cpp
Normal file
102
source/Game/Util/ActorMovementUtil.cpp
Normal file
@ -0,0 +1,102 @@
|
||||
#include "Game/Util.h"
|
||||
#include "Game/LiveActor/LiveActor.h"
|
||||
#include "Game/LiveActor/HitSensor.h"
|
||||
#include "Game/Scene/SceneObjHolder.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "math_types.h"
|
||||
|
||||
namespace MR {
|
||||
f32 calcDistance(const HitSensor *pSensor1, const HitSensor *pSensor2, TVec3f *a3) {
|
||||
TVec3f sensor2_pos(pSensor2->mPosition);
|
||||
JMathInlineVEC::PSVECSubtract((Vec*)&sensor2_pos, (Vec*)&pSensor1->mPosition, (Vec*)&sensor2_pos);
|
||||
|
||||
f32 mag = PSVECMag((Vec*)&sensor2_pos);
|
||||
|
||||
if (a3) {
|
||||
if (mag > 0.0f) {
|
||||
PSVECScale((Vec*)&sensor2_pos, (Vec*)a3, 1.0f / mag);
|
||||
}
|
||||
else {
|
||||
a3->zero();
|
||||
}
|
||||
}
|
||||
|
||||
return mag;
|
||||
}
|
||||
|
||||
f32 calcDistance(const LiveActor *pActor, const TVec3f &rVec) {
|
||||
return PSVECDistance((Vec*)&pActor->mPosition, &(const Vec &)rVec);
|
||||
}
|
||||
|
||||
f32 calcDistanceHorizontal(const LiveActor *pActor, const TVec3f &a2, const TVec3f &a3) {
|
||||
TVec3f stack_8(a2);
|
||||
JMathInlineVEC::PSVECSubtract((Vec*)&stack_8, (Vec*)&pActor->mPosition, (Vec*)&stack_8);
|
||||
MR::vecKillElement(stack_8, a3, &stack_8);
|
||||
return PSVECMag((Vec*)&stack_8);
|
||||
}
|
||||
|
||||
f32 calcDistanceVertical(const LiveActor *pActor, const TVec3f &a2, const TVec3f &a3) {
|
||||
TVec3f stack_8(a2);
|
||||
JMathInlineVEC::PSVECSubtract((Vec*)&stack_8, (Vec*)&pActor->mPosition, (Vec*)&stack_8);
|
||||
a3.dot(stack_8);
|
||||
stack_8.scale(a3);
|
||||
return PSVECMag((Vec*)&stack_8);
|
||||
}
|
||||
|
||||
// MR::calcDistanceVertical((LiveActor const *, JGeometry::TVec3<f> const &))
|
||||
|
||||
f32 calcDistanceToPlayer(const LiveActor *pActor) {
|
||||
return (!MR::isExistSceneObj(SceneObj_MarioHolder) ? FLOAT_MAX : PSVECDistance((Vec*)&pActor->mPosition, (Vec*)MR::getPlayerPos()));
|
||||
}
|
||||
|
||||
bool isNear(const HitSensor *pSensor_1, const HitSensor *pSensor_2, f32 dist) {
|
||||
f32 sqr = pSensor_1->mPosition.squared(pSensor_2->mPosition);
|
||||
return sqr < (dist * dist);
|
||||
}
|
||||
|
||||
bool isNear(const LiveActor *pActor_1, const LiveActor *pActor_2, f32 dist) {
|
||||
f32 sqr = pActor_1->mPosition.squared(pActor_2->mPosition);
|
||||
return sqr < (dist * dist);
|
||||
}
|
||||
|
||||
bool isNear(const LiveActor *pActor, const TVec3f &rVec, f32 dist) {
|
||||
f32 sqr = pActor->mPosition.squared(rVec);
|
||||
return sqr < (dist * dist);
|
||||
}
|
||||
|
||||
bool isNearPlayer(const LiveActor *pActor, f32 dist) {
|
||||
return (MR::isPlayerHidden() ? false : MR::isNearPlayerAnyTime(pActor, dist));
|
||||
}
|
||||
|
||||
bool isNearPlayerAnyTime(const LiveActor *pActor, f32 dist) {
|
||||
f32 sqr = pActor->mPosition.squared(*MR::getPlayerPos());
|
||||
return sqr < (dist * dist);
|
||||
}
|
||||
|
||||
bool isNearPlayer(const TVec3f &rPos, f32 dist) {
|
||||
if (MR::isPlayerHidden()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
f32 sqr = MR::getPlayerPos()->squared(rPos);
|
||||
return sqr < (dist * dist);
|
||||
}
|
||||
|
||||
// MR::isNearPlayerPose((LiveActor const *, float, float))
|
||||
// MR::isNearPlayerHorizontal((LiveActor const *, float))
|
||||
|
||||
void calcFrontVec(TVec3f *pFrontVec, const LiveActor *pActor) {
|
||||
MtxPtr mtx = pActor->getBaseMtx();
|
||||
pFrontVec->set(mtx[0][2], mtx[1][2], mtx[2][2]);
|
||||
}
|
||||
|
||||
void calcUpVec(TVec3f *pUpVec, const LiveActor *pActor) {
|
||||
MtxPtr mtx = pActor->getBaseMtx();
|
||||
pUpVec->set(mtx[0][1], mtx[1][1], mtx[2][1]);
|
||||
}
|
||||
|
||||
void calcSideVec(TVec3f *pSideVec, const LiveActor *pActor) {
|
||||
MtxPtr mtx = pActor->getBaseMtx();
|
||||
pSideVec->set(mtx[0][0], mtx[1][0], mtx[2][0]);
|
||||
}
|
||||
};
|
14
source/Game/Util/LiveActorUtil.cpp
Normal file
14
source/Game/Util/LiveActorUtil.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "Game/Util.h"
|
||||
#include "Game/LiveActor/LiveActor.h"
|
||||
|
||||
namespace MR {
|
||||
void calcAnimDirect(LiveActor *pActor) {
|
||||
bool isNoCalcAnim = pActor->mFlags.mIsNoCalcAnim;
|
||||
pActor->mFlags.mIsNoCalcAnim = false;
|
||||
pActor->calcAnim();
|
||||
|
||||
if (isNoCalcAnim) {
|
||||
pActor->mFlags.mIsNoCalcAnim = true;
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user