Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions config/RSPE01_01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8196,9 +8196,9 @@ calc__14RPSndStaticMgrFv = .text:0x801B9690; // type:function size:0x16C
setupArchive__14RPSndStaticMgrFv = .text:0x801B97FC; // type:function size:0x54
__dt__14RPSndStaticMgrFv = .text:0x801B9850; // type:function size:0x68
__ct__14RPSndStaticMgrFv = .text:0x801B98B8; // type:function size:0x58
fn_801B9910 = .text:0x801B9910; // type:function size:0x1FC
fn_801B9B0C = .text:0x801B9B0C; // type:function size:0x298
fn_801B9DA4 = .text:0x801B9DA4; // type:function size:0x11C
GetMidPoint__12RPUtlDohMathFPQ34nw4r4math4VEC3PfRCQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3ff = .text:0x801B9910; // type:function size:0x1FC
MTX34Normalize__12RPUtlDohMathFPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34Q212RPUtlDohMath9AxisOrder = .text:0x801B9B0C; // type:function size:0x298
__sinit_\RPUtlDohMath_cpp = .text:0x801B9DA4; // type:function size:0x11C
fn_801B9EC0 = .text:0x801B9EC0; // type:function size:0x3C4
fn_801BA284 = .text:0x801BA284; // type:function size:0x198
fn_801BA41C = .text:0x801BA41C; // type:function size:0x218
Expand Down Expand Up @@ -14293,7 +14293,7 @@ fn_8032A7E4 = .text:0x8032A7E4; // type:function size:0x38
fn_8032A81C = .text:0x8032A81C; // type:function size:0x1AC
fn_8032A9C8 = .text:0x8032A9C8; // type:function size:0x1C
fn_8032A9E4 = .text:0x8032A9E4; // type:function size:0x4
RenderModelSet__Q27Bowling15RPBowActiveBallFv = .text:0x8032A9E8; // type:function size:0x3A0
RenderModelSet__Q27Bowling15ResetRenderStateActiveBallFv = .text:0x8032A9E8; // type:function size:0x3A0
ResetRenderState__Q27Bowling15RPBowActiveBallFv = .text:0x8032AD88; // type:function size:0x50
fn_8032ADD8 = .text:0x8032ADD8; // type:function size:0x1C
fn_8032ADF4 = .text:0x8032ADF4; // type:function size:0x4
Expand Down Expand Up @@ -19881,15 +19881,16 @@ lbl_804A4638 = .bss:0x804A4638; // type:object size:0x28 data:byte
smCommon3DManager__Q23EGG32AudioSoundActorBaseWithCamera<4> = .bss:0x804A4660; // type:object size:0x10 data:4byte
sActorList__19RPSndAudioActorBase = .bss:0x804A4670; // type:object size:0xC
sMoveParamList__17RPSndMoveParamMgr = .bss:0x804A4680; // type:object size:0x10
lbl_804A4690 = .bss:0x804A4690; // type:object size:0xC align:4 data:float
lbl_804A469C = .bss:0x804A469C; // type:object size:0xC align:4 data:float
lbl_804A46A8 = .bss:0x804A46A8; // type:object size:0xC align:4 data:float
lbl_804A46B4 = .bss:0x804A46B4; // type:object size:0xC align:4 data:float
lbl_804A46C0 = .bss:0x804A46C0; // type:object size:0xC align:4 data:float
lbl_804A46CC = .bss:0x804A46CC; // type:object size:0xC align:4 data:float
lbl_804A46D8 = .bss:0x804A46D8; // type:object size:0x10 align:4 data:float
lbl_804A46E8 = .bss:0x804A46E8; // type:object size:0x58 align:4 data:float
lbl_804A4740 = .bss:0x804A4740; // type:object size:0x10 align:4 data:float
VEC3_ZERO__12RPUtlDohMath = .bss:0x804A4690; // type:object size:0xC align:4 data:float
AXIS_XP__12RPUtlDohMath = .bss:0x804A469C; // type:object size:0xC align:4 data:float
AXIS_XN__12RPUtlDohMath = .bss:0x804A46A8; // type:object size:0xC align:4 data:float
AXIS_YP__12RPUtlDohMath = .bss:0x804A46B4; // type:object size:0xC align:4 data:float
AXIS_YN__12RPUtlDohMath = .bss:0x804A46C0; // type:object size:0xC align:4 data:float
AXIS_ZP__12RPUtlDohMath = .bss:0x804A46CC; // type:object size:0xC align:4 data:float
AXIS_ZN__12RPUtlDohMath = .bss:0x804A46D8; // type:object size:0xC align:4 data:float
MTX34_IDENT__12RPUtlDohMath = .bss:0x804A46E8; // type:object size:0x30 align:4 data:float
MTX33_IDENT__12RPUtlDohMath = .bss:0x804A4718; // type:object size:0x24 align:4 data:float
QUAT_IDENT__12RPUtlDohMath = .bss:0x804A4740; // type:object size:0x10 align:4 data:float
lbl_804A4750 = .bss:0x804A4750; // type:object size:0x10 data:4byte
lbl_804A4760 = .bss:0x804A4760; // type:object size:0x10 data:byte
lbl_804A4770 = .bss:0x804A4770; // type:object size:0xC align:4 data:float
Expand Down Expand Up @@ -21924,7 +21925,7 @@ spInstance__13RPSndAudioMgr = .sbss:0x804BF644; // type:object size:0x4 data:4by
DAT_804bf648 = .sbss:0x804BF648; // type:object size:0x8 data:4byte
spInstance__15RPSndSpeakerMgr = .sbss:0x804BF650; // type:object size:0x4 data:4byte
spSoundArchivePlayer__12RPSndUtility = .sbss:0x804BF658; // type:object size:0x4 data:4byte
lbl_804BF660 = .sbss:0x804BF660; // type:object size:0x8 align:4 data:float
VEC2_ZERO__12RPUtlDohMath = .sbss:0x804BF660; // type:object size:0x8 align:4 data:float
lbl_804BF668 = .sbss:0x804BF668; // type:object size:0x8 data:4byte
lbl_804BF670 = .sbss:0x804BF670; // type:object size:0x4 data:4byte
lbl_804BF674 = .sbss:0x804BF674; // type:object size:0x4 data:4byte
Expand Down
1 change: 1 addition & 0 deletions include/Pack/RPUtility.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef RP_PUBLIC_UTILITY_H
#define RP_PUBLIC_UTILITY_H

#include <Pack/RPUtility/RPUtlDohMath.h>
#include <Pack/RPUtility/RPUtlLoadSaveDataScene.h>
#include <Pack/RPUtility/RPUtlRandom.h>

Expand Down
103 changes: 103 additions & 0 deletions include/Pack/RPUtility/RPUtlDohMath.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#ifndef RP_UTILITY_DOH_MATH_H
#define RP_UTILITY_DOH_MATH_H
#include <Pack/types_pack.h>

#include <nw4r/math.h>

/**
* @brief Dohta's math utilities
*/
class RPUtlDohMath {
public:
/**
* @brief Axis priority order during orthonormalization
*/
enum AxisOrder {
AxisOrder_XY, //! X-axis is preserved, Y-axis is the reference
AxisOrder_XZ, //! X-axis is preserved, Z-axis is the reference

AxisOrder_YZ, //! Y-axis is preserved, Z-axis is the reference
AxisOrder_YX, //! Y-axis is preserved, X-axis is the reference

AxisOrder_ZX, //! Z-axis is preserved, X-axis is the reference
AxisOrder_ZY, //! Z-axis is preserved, Y-axis is the reference
};

/**
* @brief Matrix axis index
*/
enum AxisType {
AxisType_X, //! X-axis
AxisType_Y, //! Y-axis
AxisType_Z, //! Z-axis
};

public:
/**
* @brief Sets the specified local axis of the input matrix
*
* @param pMtx Matrix
* @param axis Axis index
* @param pBase Base vector
*/
static void MTX34SetBase(nw4r::math::MTX34* pMtx, AxisType axis,
const nw4r::math::VEC3* pBase);

/**
* @brief Constructs a right-handed orthonormal basis from the local axes of
* the specified matrix
*
* @param[out] pOut Output matrix
* @param pIn Input matrix
* @param order Axis priority order
*/
static void MTX34Normalize(nw4r::math::MTX34* pOut,
const nw4r::math::MTX34* pIn, AxisOrder order);

/**
* @brief Calculates a bend point between two endpoints
*
* @param[out] pMidPoint Bend point
* @param[out] pDistance Distance between the endpoints
* @param rBendDir Bend direction vector
* @param rPointA Endpoint A
* @param rPointB Endpoint B
* @param lengthA Length of the segment from A to the bend joint
* @param lengthB Length of the segment from the bend joint to B
*/
static void GetMidPoint(nw4r::math::VEC3* pMidPoint, f32* pDistance,
const nw4r::math::VEC3& rBendDir,
const nw4r::math::VEC3& rPointA,
const nw4r::math::VEC3& rPointB, f32 lengthA,
f32 lengthB);

public:
//! Zero vector (3D)
static const nw4r::math::VEC3 VEC3_ZERO;
//! Zero vector (2D)
static const nw4r::math::VEC2 VEC2_ZERO;

//! Positive X-axis unit vector
static const nw4r::math::VEC3 AXIS_XP;
//! Negative X-axis unit vector
static const nw4r::math::VEC3 AXIS_XN;

//! Positive Y-axis unit vector
static const nw4r::math::VEC3 AXIS_YP;
//! Negative Y-axis unit vector
static const nw4r::math::VEC3 AXIS_YN;

//! Positive Z-axis unit vector
static const nw4r::math::VEC3 AXIS_ZP;
//! Negative Z-axis unit vector
static const nw4r::math::VEC3 AXIS_ZN;

//! 3x4 identity matrix
static const nw4r::math::MTX34 MTX34_IDENT;
//! 3x3 identity matrix
static const nw4r::math::MTX33 MTX33_IDENT;
//! Identity quaternion
static const nw4r::math::QUAT QUAT_IDENT;
};

#endif
10 changes: 10 additions & 0 deletions include/nw4r/math/math_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ struct _MTX33 {

struct MTX33 : _MTX33 {
MTX33() {}

// clang-format off
MTX33(f32 f00, f32 f01, f32 f02,
f32 f10, f32 f11, f32 f12,
f32 f20, f32 f21, f32 f22) {
_00 = f00; _01 = f01; _02 = f02;
_10 = f10; _11 = f11; _12 = f12;
_20 = f20; _21 = f21; _22 = f22;
}
// clang-format on
};

/******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/Pack/RPSystem/RPSysSceneCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const RPSysSceneCreator::SceneAttr RPSysSceneCreator::SCENE_ATTR_TABLE[] = {
/**
* @brief Constructor
*
* @param pHeap Heap to use for allocations
* @param pHeap Parent heap
*/
RPSysSceneCreator::RPSysSceneCreator(EGG::Heap* pHeap)
: mpParentHeap(pHeap), mPrevSceneID(-1) {}
Expand Down
2 changes: 1 addition & 1 deletion src/Pack/RPSystem/RPSysSceneMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RP_SINGLETON_IMPL_EX(RPSysSceneMgr);
/**
* @brief Constructor
*
* @param pHeap Heap to use for allocations
* @param pHeap Parent heap
*/
RPSysSceneMgr::RPSysSceneMgr(EGG::Heap* pHeap)
: mpParentHeap(pHeap), mState(EState_Normal) {
Expand Down
Loading
Loading