mirror of https://github.com/zeldaret/botw.git
ksys/phys: Add ShapeParam
This commit is contained in:
parent
502df1d149
commit
f59bc21b3a
|
@ -37709,11 +37709,11 @@
|
||||||
0x000000710061f41c,sub_710061F41C,72,
|
0x000000710061f41c,sub_710061F41C,72,
|
||||||
0x000000710061f464,AI_Behavior_DisableContactLayer::rtti1,204,
|
0x000000710061f464,AI_Behavior_DisableContactLayer::rtti1,204,
|
||||||
0x000000710061f530,AI_Behavior_DisableContactLayer::rtti2,92,
|
0x000000710061f530,AI_Behavior_DisableContactLayer::rtti2,92,
|
||||||
0x000000710061f58c,sub_710061F58C,428,
|
0x000000710061f58c,sub_710061F58C,428,_ZN4ksys4phys12ContactLayer5text_Ei
|
||||||
0x000000710061f738,j__ZdlPv_177,4,
|
0x000000710061f738,j__ZdlPv_177,4,_ZN4sead15FixedSafeStringILi912EED0Ev
|
||||||
0x000000710061f73c,_ZN4sead19FixedSafeStringBaseIcLi170EEaSERKNS_14SafeStringBaseIcEE,240,
|
0x000000710061f73c,_ZN4sead15FixedSafeStringILi912EEaSERKNS_14SafeStringBaseIcEE,240,_ZN4sead15FixedSafeStringILi912EEaSERKNS_14SafeStringBaseIcEE
|
||||||
0x000000710061f82c,j__ZdlPv_178,4,
|
0x000000710061f82c,j__ZdlPv_178,4,_ZN4sead19FixedSafeStringBaseIcLi912EED0Ev
|
||||||
0x000000710061f830,_ZN4sead15FixedSafeStringILi33EEaSERKNS_14SafeStringBaseIcEE,240,
|
0x000000710061f830,_ZN4sead19FixedSafeStringBaseIcLi912EEaSERKNS_14SafeStringBaseIcEE,240,_ZN4sead19FixedSafeStringBaseIcLi912EEaSERKNS_14SafeStringBaseIcEE
|
||||||
0x000000710061f920,AI_Behavior_DisableForbidJob::ctor,48,
|
0x000000710061f920,AI_Behavior_DisableForbidJob::ctor,48,
|
||||||
0x000000710061f950,AI_Behavior_DisableForbidJob::dtor_null,4,
|
0x000000710061f950,AI_Behavior_DisableForbidJob::dtor_null,4,
|
||||||
0x000000710061f954,j__ZdlPv_179,4,
|
0x000000710061f954,j__ZdlPv_179,4,
|
||||||
|
@ -73199,7 +73199,7 @@
|
||||||
0x0000007100d2b5a8,sub_7100D2B5A8,8,
|
0x0000007100d2b5a8,sub_7100D2B5A8,8,
|
||||||
0x0000007100d2b5b0,sub_7100D2B5B0,8,
|
0x0000007100d2b5b0,sub_7100D2B5B0,8,
|
||||||
0x0000007100d2b5b8,j__ZdlPv_842,4,
|
0x0000007100d2b5b8,j__ZdlPv_842,4,
|
||||||
0x0000007100d2b5bc,_ZN4sead19FixedSafeStringBaseIcLi141EEaSERKNS_14SafeStringBaseIcEE,240,
|
0x0000007100d2b5bc,xxx,240,
|
||||||
0x0000007100d2b6ac,sub_7100D2B6AC,60,
|
0x0000007100d2b6ac,sub_7100D2B6AC,60,
|
||||||
0x0000007100d2b6e8,sub_7100D2B6E8,188,
|
0x0000007100d2b6e8,sub_7100D2B6E8,188,
|
||||||
0x0000007100d2b7a4,sub_7100D2B7A4,36,
|
0x0000007100d2b7a4,sub_7100D2B7A4,36,
|
||||||
|
@ -79379,32 +79379,32 @@
|
||||||
0x0000007100e94134,getPowerOfTwo,44,
|
0x0000007100e94134,getPowerOfTwo,44,
|
||||||
0x0000007100e94160,sub_7100E94160,16,
|
0x0000007100e94160,sub_7100E94160,16,
|
||||||
0x0000007100e94170,sub_7100E94170,40,
|
0x0000007100e94170,sub_7100E94170,40,
|
||||||
0x0000007100e94198,sub_7100E94198,4,
|
0x0000007100e94198,sub_7100E94198,4,_ZN4ksys4phys18contactLayerToTextENS0_12ContactLayerE
|
||||||
0x0000007100e9419c,findQuest,288,
|
0x0000007100e9419c,_ZN4ksys4phys20contactLayerFromTextERKN4sead14SafeStringBaseIcEE,288,_ZN4ksys4phys20contactLayerFromTextERKN4sead14SafeStringBaseIcEE
|
||||||
0x0000007100e942bc,j_getMaterialType,4,
|
0x0000007100e942bc,j_getMaterialType,4,_ZN4ksys4phys14materialToTextENS0_8MaterialE
|
||||||
0x0000007100e942c0,sub_7100E942C0,288,
|
0x0000007100e942c0,sub_7100E942C0,288,_ZN4ksys4phys16materialFromTextERKN4sead14SafeStringBaseIcEE
|
||||||
0x0000007100e943e0,sub_7100E943E0,288,
|
0x0000007100e943e0,sub_7100E943E0,288,
|
||||||
0x0000007100e94500,sub_7100E94500,288,
|
0x0000007100e94500,sub_7100E94500,288,_ZN4ksys4phys17floorCodeFromTextERKN4sead14SafeStringBaseIcEE
|
||||||
0x0000007100e94620,sub_7100E94620,288,
|
0x0000007100e94620,sub_7100E94620,288,_ZN4ksys4phys16wallCodeFromTextERKN4sead14SafeStringBaseIcEE
|
||||||
0x0000007100e94740,sub_7100E94740,40,
|
0x0000007100e94740,sub_7100E94740,40,
|
||||||
0x0000007100e94768,sub_7100E94768,36,
|
0x0000007100e94768,sub_7100E94768,36,
|
||||||
0x0000007100e9478c,sub_7100E9478C,336,
|
0x0000007100e9478c,sub_7100E9478C,336,
|
||||||
0x0000007100e948dc,getMaterialType,428,
|
0x0000007100e948dc,getMaterialType,428,_ZN4ksys4phys8Material5text_Ei
|
||||||
0x0000007100e94a88,j__ZdlPv_935,4,
|
0x0000007100e94a88,j__ZdlPv_935,4,_ZN4sead15FixedSafeStringILi259EED0Ev
|
||||||
0x0000007100e94a8c,_ZN4sead19FixedSafeStringBaseIcLi6EEaSERKNS_14SafeStringBaseIcEE,240,
|
0x0000007100e94a8c,_ZN4sead15FixedSafeStringILi259EEaSERKNS_14SafeStringBaseIcEE,240,_ZN4sead15FixedSafeStringILi259EEaSERKNS_14SafeStringBaseIcEE
|
||||||
0x0000007100e94b7c,j__ZdlPv_936,4,
|
0x0000007100e94b7c,j__ZdlPv_936,4,_ZN4sead19FixedSafeStringBaseIcLi259EED0Ev
|
||||||
0x0000007100e94b80,_ZN4sead15FixedSafeStringILi119EEaSERKNS_14SafeStringBaseIcEE,240,
|
0x0000007100e94b80,_ZN4sead19FixedSafeStringBaseIcLi259EEaSERKNS_14SafeStringBaseIcEE,240,_ZN4sead19FixedSafeStringBaseIcLi259EEaSERKNS_14SafeStringBaseIcEE
|
||||||
0x0000007100e94c70,sub_7100E94C70,428,
|
0x0000007100e94c70,sub_7100E94C70,428,
|
||||||
0x0000007100e94e1c,j__ZdlPv_937,4,
|
0x0000007100e94e1c,j__ZdlPv_937,4,_ZN4sead15FixedSafeStringILi141EED0Ev
|
||||||
0x0000007100e94e20,_ZN4sead19FixedSafeStringBaseIcLi119EEaSERKNS_14SafeStringBaseIcEE,240,
|
0x0000007100e94e20,_ZN4sead15FixedSafeStringILi141EEaSERKNS_14SafeStringBaseIcEE,240,_ZN4sead15FixedSafeStringILi141EEaSERKNS_14SafeStringBaseIcEE
|
||||||
0x0000007100e94f10,j__ZdlPv_938,4,
|
0x0000007100e94f10,j__ZdlPv_938,4,_ZN4sead19FixedSafeStringBaseIcLi141EED0Ev
|
||||||
0x0000007100e94f14,_ZN4sead15FixedSafeStringILi22EEaSERKNS_14SafeStringBaseIcEE,240,
|
0x0000007100e94f14,_ZN4sead19FixedSafeStringBaseIcLi141EEaSERKNS_14SafeStringBaseIcEE,240,_ZN4sead19FixedSafeStringBaseIcLi141EEaSERKNS_14SafeStringBaseIcEE
|
||||||
0x0000007100e95004,sub_7100E95004,428,
|
0x0000007100e95004,sub_7100E95004,428,_ZN4ksys4phys9FloorCode5text_Ei
|
||||||
0x0000007100e951b0,sub_7100E951B0,428,
|
0x0000007100e951b0,sub_7100E951B0,428,_ZN4ksys4phys8WallCode5text_Ei
|
||||||
0x0000007100e9535c,j__ZdlPv_939,4,
|
0x0000007100e9535c,j__ZdlPv_939,4,_ZN4sead15FixedSafeStringILi94EED0Ev
|
||||||
0x0000007100e95360,_ZN4sead19FixedSafeStringBaseIcLi153EEaSERKNS_14SafeStringBaseIcEE,240,
|
0x0000007100e95360,_ZN4sead15FixedSafeStringILi94EEaSERKNS_14SafeStringBaseIcEE,240,_ZN4sead15FixedSafeStringILi94EEaSERKNS_14SafeStringBaseIcEE
|
||||||
0x0000007100e95450,j__ZdlPv_940,4,
|
0x0000007100e95450,j__ZdlPv_940,4,_ZN4sead19FixedSafeStringBaseIcLi94EED0Ev
|
||||||
0x0000007100e95454,_ZN4sead15FixedSafeStringILi76EEaSERKNS_14SafeStringBaseIcEE,240,
|
0x0000007100e95454,_ZN4sead19FixedSafeStringBaseIcLi94EEaSERKNS_14SafeStringBaseIcEE,240,_ZN4sead19FixedSafeStringBaseIcLi94EEaSERKNS_14SafeStringBaseIcEE
|
||||||
0x0000007100e95544,sub_7100E95544,412,
|
0x0000007100e95544,sub_7100E95544,412,
|
||||||
0x0000007100e956e0,sub_7100E956E0,64,
|
0x0000007100e956e0,sub_7100E956E0,64,
|
||||||
0x0000007100e95720,sub_7100E95720,344,
|
0x0000007100e95720,sub_7100E95720,344,
|
||||||
|
@ -94787,17 +94787,17 @@
|
||||||
0x0000007101283698,j__ZdlPv_1282,4,
|
0x0000007101283698,j__ZdlPv_1282,4,
|
||||||
0x000000710128369c,sub_710128369C,40,
|
0x000000710128369c,sub_710128369C,40,
|
||||||
0x00000071012836c4,j__ZdlPv_1283,4,
|
0x00000071012836c4,j__ZdlPv_1283,4,
|
||||||
0x00000071012836c8,bphysicsParseShapeParam,1996,
|
0x00000071012836c8,bphysicsParseShapeParam,1996,_ZN4ksys4phys10ShapeParamC1Ev
|
||||||
0x0000007101283e94,sub_7101283E94,188,
|
0x0000007101283e94,sub_7101283E94,188,_ZN4ksys4phys10ShapeParamD1Ev
|
||||||
0x0000007101283f50,sub_7101283F50,108,
|
0x0000007101283f50,sub_7101283F50,108,_ZN4ksys4phys10ShapeParamD0Ev
|
||||||
0x0000007101283fbc,sub_7101283FBC,508,
|
0x0000007101283fbc,sub_7101283FBC,508,_ZN4ksys4phys10ShapeParam5parseERKN3agl3utl15ResParameterObjEPN4sead4HeapE
|
||||||
0x00000071012841b8,sub_71012841B8,664,
|
0x00000071012841b8,sub_71012841B8,664,_ZNK4ksys4phys10ShapeParam8getShapeEv
|
||||||
0x0000007101284450,sub_7101284450,132,
|
0x0000007101284450,sub_7101284450,132,_ZNK4ksys4phys10ShapeParam9getSphereEPNS0_11SphereParamE
|
||||||
0x00000071012844d4,sub_71012844D4,156,
|
0x00000071012844d4,sub_71012844D4,156,_ZNK4ksys4phys10ShapeParam10getCapsuleEPNS0_12CapsuleParamE
|
||||||
0x0000007101284570,sub_7101284570,164,
|
0x0000007101284570,sub_7101284570,164,_ZNK4ksys4phys10ShapeParam11getCylinderEPNS0_13CylinderParamE
|
||||||
0x0000007101284614,sub_7101284614,180,
|
0x0000007101284614,sub_7101284614,180,_ZNK4ksys4phys10ShapeParam6getBoxEPNS0_8BoxParamE
|
||||||
0x00000071012846c8,sub_71012846C8,108,
|
0x00000071012846c8,sub_71012846C8,108,_ZNK4ksys4phys10ShapeParam11getPolytopeEPNS0_13PolytopeParamE
|
||||||
0x0000007101284734,sub_7101284734,156,
|
0x0000007101284734,sub_7101284734,156,_ZNK4ksys4phys10ShapeParam17getCharacterPrismEPNS0_19CharacterPrismParamE
|
||||||
0x00000071012847d0,sub_71012847D0,32,
|
0x00000071012847d0,sub_71012847D0,32,
|
||||||
0x00000071012847f0,nullsub_4756,4,
|
0x00000071012847f0,nullsub_4756,4,
|
||||||
0x00000071012847f4,j__ZdlPv_1284,4,
|
0x00000071012847f4,j__ZdlPv_1284,4,
|
||||||
|
@ -100841,7 +100841,7 @@
|
||||||
0x00000071013f9c98,_ZN3agl11GPUMemBlockINS_2fx17OccludedEffectMgr3VtxEED0Ev,52,
|
0x00000071013f9c98,_ZN3agl11GPUMemBlockINS_2fx17OccludedEffectMgr3VtxEED0Ev,52,
|
||||||
0x00000071013f9ccc,sub_71013F9CCC,20,
|
0x00000071013f9ccc,sub_71013F9CCC,20,
|
||||||
0x00000071013f9ce0,sub_71013F9CE0,52,
|
0x00000071013f9ce0,sub_71013F9CE0,52,
|
||||||
0x00000071013f9d14,_ZN4sead15FixedSafeStringILi141EEaSERKNS_14SafeStringBaseIcEE,528,
|
0x00000071013f9d14,xxx,528,
|
||||||
0x00000071013f9f24,sub_71013F9F24,100,
|
0x00000071013f9f24,sub_71013F9F24,100,
|
||||||
0x00000071013f9f88,_ZN3agl2fx17OccludedEffectMgr11TextureInfoD0Ev,88,
|
0x00000071013f9f88,_ZN3agl2fx17OccludedEffectMgr11TextureInfoD0Ev,88,
|
||||||
0x00000071013f9fe0,_ZN4sead6BufferIN3agl2fx17OccludedEffectMgr8Resource10ResTexInfoEE14tryAllocBufferEiPNS_4HeapEi,384,
|
0x00000071013f9fe0,_ZN4sead6BufferIN3agl2fx17OccludedEffectMgr8Resource10ResTexInfoEE14tryAllocBufferEiPNS_4HeapEi,384,
|
||||||
|
|
Can't render this file because it is too large.
|
2
lib/sead
2
lib/sead
|
@ -1 +1 @@
|
||||||
Subproject commit 7b9f11e3880789dff46aa834c0f42c5c2328fb8e
|
Subproject commit b9f62df29f493e055ab32759ac0e204f806ede31
|
|
@ -9,6 +9,10 @@ target_sources(uking PRIVATE
|
||||||
RigidBody/physEdgeRigidBodyParam.h
|
RigidBody/physEdgeRigidBodyParam.h
|
||||||
SupportBone/physSupportBoneParam.cpp
|
SupportBone/physSupportBoneParam.cpp
|
||||||
SupportBone/physSupportBoneParam.h
|
SupportBone/physSupportBoneParam.h
|
||||||
|
System/physDefines.cpp
|
||||||
|
System/physDefines.h
|
||||||
System/physParamSet.cpp
|
System/physParamSet.cpp
|
||||||
System/physParamSet.h
|
System/physParamSet.h
|
||||||
|
System/physShapeParam.cpp
|
||||||
|
System/physShapeParam.h
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
#include "KingSystem/Physics/System/physDefines.h"
|
||||||
|
|
||||||
|
namespace ksys::phys {
|
||||||
|
|
||||||
|
const char* contactLayerToText(ContactLayer layer) {
|
||||||
|
return layer.text();
|
||||||
|
}
|
||||||
|
|
||||||
|
ContactLayer contactLayerFromText(const sead::SafeString& text) {
|
||||||
|
for (auto layer : ContactLayer()) {
|
||||||
|
if (text == layer.text())
|
||||||
|
return layer;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* materialToText(Material material) {
|
||||||
|
return material.text();
|
||||||
|
}
|
||||||
|
|
||||||
|
Material materialFromText(const sead::SafeString& text) {
|
||||||
|
for (auto material : Material()) {
|
||||||
|
if (text == material.text())
|
||||||
|
return material;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* floorCodeToText(FloorCode code) {
|
||||||
|
return code.text();
|
||||||
|
}
|
||||||
|
|
||||||
|
FloorCode floorCodeFromText(const sead::SafeString& text) {
|
||||||
|
for (auto code : FloorCode()) {
|
||||||
|
if (text == code.text())
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* wallCodeToText(WallCode code) {
|
||||||
|
return code.text();
|
||||||
|
}
|
||||||
|
|
||||||
|
WallCode wallCodeFromText(const sead::SafeString& text) {
|
||||||
|
for (auto code : WallCode()) {
|
||||||
|
if (text == code.text())
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace ksys::phys
|
|
@ -0,0 +1,147 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <prim/seadEnum.h>
|
||||||
|
#include <prim/seadSafeString.h>
|
||||||
|
|
||||||
|
namespace ksys::phys {
|
||||||
|
|
||||||
|
SEAD_ENUM(ContactLayer,
|
||||||
|
EntityObject,\
|
||||||
|
EntitySmallObject,\
|
||||||
|
EntityGroundObject,\
|
||||||
|
EntityPlayer,\
|
||||||
|
EntityNPC,\
|
||||||
|
EntityRagdoll,\
|
||||||
|
EntityWater,\
|
||||||
|
EntityAirWall,\
|
||||||
|
EntityGround,\
|
||||||
|
EntityGroundSmooth,\
|
||||||
|
EntityGroundRough,\
|
||||||
|
EntityRope,\
|
||||||
|
EntityTree,\
|
||||||
|
EntityNPC_NoHitPlayer,\
|
||||||
|
EntityHitOnlyWater,\
|
||||||
|
EntityWallForClimb,\
|
||||||
|
EntityHitOnlyGround,\
|
||||||
|
EntityQueryCustomReceiver,\
|
||||||
|
EntityForbidden18,\
|
||||||
|
EntityNoHit,\
|
||||||
|
EntityMeshVisualizer,\
|
||||||
|
EntityForbidden21,\
|
||||||
|
EntityForbidden22,\
|
||||||
|
EntityForbidden23,\
|
||||||
|
EntityForbidden24,\
|
||||||
|
EntityForbidden25,\
|
||||||
|
EntityForbidden26,\
|
||||||
|
EntityForbidden27,\
|
||||||
|
EntityForbidden28,\
|
||||||
|
EntityForbidden29,\
|
||||||
|
EntityForbidden30,\
|
||||||
|
EntityEnd,\
|
||||||
|
SensorObject,\
|
||||||
|
SensorSmallObject,\
|
||||||
|
SensorPlayer,\
|
||||||
|
SensorEnemy,\
|
||||||
|
SensorNPC,\
|
||||||
|
SensorHorse,\
|
||||||
|
SensorRope,\
|
||||||
|
SensorAttackPlayer,\
|
||||||
|
SensorAttackEnemy,\
|
||||||
|
SensorChemical,\
|
||||||
|
SensorTerror,\
|
||||||
|
SensorHitOnlyInDoor,\
|
||||||
|
SensorInDoor,\
|
||||||
|
SensorReserve13,\
|
||||||
|
SensorReserve14,\
|
||||||
|
SensorChemicalElement,\
|
||||||
|
SensorAttackCommon,\
|
||||||
|
SensorQueryOnly,\
|
||||||
|
SensorTree,\
|
||||||
|
SensorCamera,\
|
||||||
|
SensorMeshVisualizer,\
|
||||||
|
SensorNoHit,\
|
||||||
|
SensorReserve20,\
|
||||||
|
SensorCustomReceiver,\
|
||||||
|
SensorEnd)
|
||||||
|
|
||||||
|
SEAD_ENUM(Material,
|
||||||
|
Undefined,\
|
||||||
|
Soil,\
|
||||||
|
Stone,\
|
||||||
|
Sand,\
|
||||||
|
Metal,\
|
||||||
|
WireNet,\
|
||||||
|
Grass,\
|
||||||
|
Wood,\
|
||||||
|
Water,\
|
||||||
|
Snow,\
|
||||||
|
Ice,\
|
||||||
|
Lava,\
|
||||||
|
Bog,\
|
||||||
|
HeavySand,\
|
||||||
|
Cloth,\
|
||||||
|
Glass,\
|
||||||
|
Bone,\
|
||||||
|
Rope,\
|
||||||
|
CharControl,\
|
||||||
|
Ragdoll,\
|
||||||
|
Surfing,\
|
||||||
|
GuardianFoot,\
|
||||||
|
HeavySnow,\
|
||||||
|
Unused0,\
|
||||||
|
LaunchPad,\
|
||||||
|
Conveyer,\
|
||||||
|
Rail,\
|
||||||
|
Grudge,\
|
||||||
|
Meat,\
|
||||||
|
Vegetable,\
|
||||||
|
Bomb,\
|
||||||
|
MagicBall,\
|
||||||
|
Barrier,\
|
||||||
|
AirWall,\
|
||||||
|
Misc,\
|
||||||
|
GrudgeSlow
|
||||||
|
)
|
||||||
|
|
||||||
|
SEAD_ENUM(FloorCode,
|
||||||
|
None,\
|
||||||
|
Return,\
|
||||||
|
FlowStraight,\
|
||||||
|
FlowLeft,\
|
||||||
|
FlowRight,\
|
||||||
|
Slip,\
|
||||||
|
NarrowPlace,\
|
||||||
|
TopBroadleafTree,\
|
||||||
|
TopConiferousTree,\
|
||||||
|
Fall,\
|
||||||
|
Attach,\
|
||||||
|
NoImpulseUpperMove,\
|
||||||
|
NoPreventFall
|
||||||
|
)
|
||||||
|
|
||||||
|
SEAD_ENUM(WallCode,
|
||||||
|
None,\
|
||||||
|
NoClimb,\
|
||||||
|
Hang,\
|
||||||
|
LadderUp,\
|
||||||
|
Ladder,\
|
||||||
|
Slip,\
|
||||||
|
LadderSide,\
|
||||||
|
NoSlipRain,\
|
||||||
|
NoDashUpAndNoClimb,\
|
||||||
|
IceMakerBlock
|
||||||
|
)
|
||||||
|
|
||||||
|
const char* contactLayerToText(ContactLayer layer);
|
||||||
|
ContactLayer contactLayerFromText(const sead::SafeString& text);
|
||||||
|
|
||||||
|
const char* materialToText(Material material);
|
||||||
|
Material materialFromText(const sead::SafeString& text);
|
||||||
|
|
||||||
|
const char* floorCodeToText(FloorCode code);
|
||||||
|
FloorCode floorCodeFromText(const sead::SafeString& text);
|
||||||
|
|
||||||
|
const char* wallCodeToText(WallCode code);
|
||||||
|
WallCode wallCodeFromText(const sead::SafeString& text);
|
||||||
|
|
||||||
|
} // namespace ksys::phys
|
|
@ -0,0 +1,105 @@
|
||||||
|
#include "KingSystem/Physics/System/physShapeParam.h"
|
||||||
|
|
||||||
|
namespace ksys::phys {
|
||||||
|
|
||||||
|
ShapeParam::ShapeParam()
|
||||||
|
: shape_type(sead::SafeString::cEmptyString, "shape_type", this), radius(1.0, "radius", this),
|
||||||
|
convex_radius(0.05, "convex_radius", this),
|
||||||
|
translate_0(sead::Vector3f::zero, "translate_0", this),
|
||||||
|
translate_1(sead::Vector3f::zero, "translate_1", this),
|
||||||
|
rotate(sead::Vector3f::zero, "rotate", this), vertex_num(0, "vertex_num", this),
|
||||||
|
material(sead::SafeString::cEmptyString, "material", this),
|
||||||
|
sub_material(sead::SafeString::cEmptyString, "sub_material", this),
|
||||||
|
wall_code({"None"}, "wall_code", this), floor_code({"None"}, "floor_code", this),
|
||||||
|
item_code_disable_stick(false, "item_code_disable_stick", this) {}
|
||||||
|
|
||||||
|
ShapeParam::~ShapeParam() {
|
||||||
|
vertices.freeBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ShapeParam::parse(const agl::utl::ResParameterObj& res_obj, sead::Heap* heap) {
|
||||||
|
vertices.freeBuffer();
|
||||||
|
|
||||||
|
applyResParameterObj(res_obj, nullptr);
|
||||||
|
|
||||||
|
const int num_vertices = vertex_num.ref();
|
||||||
|
if (num_vertices > 0) {
|
||||||
|
vertices.allocBufferAssert(num_vertices, heap);
|
||||||
|
for (int i = 0; i < num_vertices; ++i) {
|
||||||
|
sead::FormatFixedSafeString<32> name("vertex_%d", i);
|
||||||
|
vertices[i].init(sead::Vector3f::zero, name, "頂点", this);
|
||||||
|
}
|
||||||
|
|
||||||
|
applyResParameterObj(res_obj, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShapeParam::Shape ShapeParam::getShape() const {
|
||||||
|
if (*shape_type == "sphere")
|
||||||
|
return Shape::Sphere;
|
||||||
|
if (*shape_type == "capsule")
|
||||||
|
return Shape::Capsule;
|
||||||
|
if (*shape_type == "cylinder")
|
||||||
|
return Shape::Cylinder;
|
||||||
|
if (*shape_type == "box")
|
||||||
|
return Shape::Box;
|
||||||
|
if (*shape_type == "polytope")
|
||||||
|
return Shape::Polytope;
|
||||||
|
if (*shape_type == "character_prism")
|
||||||
|
return Shape::CharacterPrism;
|
||||||
|
|
||||||
|
return Shape::Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeParam::getCommon(CommonShapeParam* param) const {
|
||||||
|
param->material = materialFromText(*material);
|
||||||
|
param->sub_material = sub_material->cstr();
|
||||||
|
param->floor_code = floorCodeFromText(*floor_code);
|
||||||
|
param->wall_code = wallCodeFromText(*wall_code);
|
||||||
|
param->item_code_disable_stick = *item_code_disable_stick;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeParam::getSphere(SphereParam* param) const {
|
||||||
|
param->radius = *radius;
|
||||||
|
param->translate = *translate_0;
|
||||||
|
getCommon(¶m->common);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeParam::getCapsule(CapsuleParam* param) const {
|
||||||
|
param->radius = *radius;
|
||||||
|
param->translate_0 = *translate_0;
|
||||||
|
param->translate_1 = *translate_1;
|
||||||
|
getCommon(¶m->common);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeParam::getCylinder(CylinderParam* param) const {
|
||||||
|
param->radius = *radius;
|
||||||
|
param->convex_radius = *convex_radius;
|
||||||
|
param->translate_0 = *translate_0;
|
||||||
|
param->translate_1 = *translate_1;
|
||||||
|
getCommon(¶m->common);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeParam::getBox(BoxParam* param) const {
|
||||||
|
param->translate_0 = *translate_0;
|
||||||
|
param->translate_1 = *translate_1;
|
||||||
|
param->rotate = *rotate;
|
||||||
|
param->convex_radius = *convex_radius;
|
||||||
|
getCommon(¶m->common);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeParam::getPolytope(PolytopeParam* param) const {
|
||||||
|
param->vertex_num = *vertex_num;
|
||||||
|
getCommon(¶m->common);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeParam::getCharacterPrism(CharacterPrismParam* param) const {
|
||||||
|
param->radius = *radius;
|
||||||
|
param->translate_0 = *translate_0;
|
||||||
|
param->translate_1 = *translate_1;
|
||||||
|
getCommon(¶m->common);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace ksys::phys
|
|
@ -0,0 +1,109 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <agl/Utils/aglParameter.h>
|
||||||
|
#include <agl/Utils/aglParameterObj.h>
|
||||||
|
#include <container/seadBuffer.h>
|
||||||
|
#include <prim/seadSafeString.h>
|
||||||
|
#include "KingSystem/Physics/System/physDefines.h"
|
||||||
|
#include "KingSystem/Utils/Types.h"
|
||||||
|
|
||||||
|
namespace ksys::phys {
|
||||||
|
|
||||||
|
struct CommonShapeParam {
|
||||||
|
Material material;
|
||||||
|
const char* sub_material;
|
||||||
|
FloorCode floor_code;
|
||||||
|
WallCode wall_code;
|
||||||
|
bool item_code_disable_stick;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SphereParam {
|
||||||
|
sead::Vector3f translate;
|
||||||
|
float radius;
|
||||||
|
CommonShapeParam common;
|
||||||
|
};
|
||||||
|
KSYS_CHECK_SIZE_NX150(SphereParam, 0x30);
|
||||||
|
|
||||||
|
struct CapsuleParam {
|
||||||
|
sead::Vector3f translate_0;
|
||||||
|
sead::Vector3f translate_1;
|
||||||
|
float radius;
|
||||||
|
CommonShapeParam common;
|
||||||
|
};
|
||||||
|
KSYS_CHECK_SIZE_NX150(CapsuleParam, 0x40);
|
||||||
|
|
||||||
|
struct CylinderParam {
|
||||||
|
sead::Vector3f translate_0;
|
||||||
|
float radius;
|
||||||
|
sead::Vector3f translate_1;
|
||||||
|
float convex_radius;
|
||||||
|
CommonShapeParam common;
|
||||||
|
};
|
||||||
|
KSYS_CHECK_SIZE_NX150(CylinderParam, 0x40);
|
||||||
|
|
||||||
|
struct BoxParam {
|
||||||
|
sead::Vector3f translate_1;
|
||||||
|
sead::Vector3f translate_0;
|
||||||
|
sead::Vector3f rotate;
|
||||||
|
float convex_radius;
|
||||||
|
CommonShapeParam common;
|
||||||
|
};
|
||||||
|
KSYS_CHECK_SIZE_NX150(BoxParam, 0x48);
|
||||||
|
|
||||||
|
struct PolytopeParam {
|
||||||
|
u16 vertex_num;
|
||||||
|
CommonShapeParam common;
|
||||||
|
};
|
||||||
|
KSYS_CHECK_SIZE_NX150(PolytopeParam, 0x28);
|
||||||
|
|
||||||
|
struct CharacterPrismParam {
|
||||||
|
float radius;
|
||||||
|
sead::Vector3f translate_0;
|
||||||
|
sead::Vector3f translate_1;
|
||||||
|
CommonShapeParam common;
|
||||||
|
};
|
||||||
|
KSYS_CHECK_SIZE_NX150(CharacterPrismParam, 0x40);
|
||||||
|
|
||||||
|
struct ShapeParam : agl::utl::ParameterObj {
|
||||||
|
enum class Shape {
|
||||||
|
Sphere = 0,
|
||||||
|
Capsule = 1,
|
||||||
|
Box = 2,
|
||||||
|
Cylinder = 3,
|
||||||
|
Polytope = 4,
|
||||||
|
CharacterPrism = 6,
|
||||||
|
Unknown = -1,
|
||||||
|
};
|
||||||
|
|
||||||
|
ShapeParam();
|
||||||
|
~ShapeParam() override;
|
||||||
|
ShapeParam(const ShapeParam&) = delete;
|
||||||
|
auto operator=(const ShapeParam&) = delete;
|
||||||
|
|
||||||
|
bool parse(const agl::utl::ResParameterObj& res_obj, sead::Heap* heap);
|
||||||
|
|
||||||
|
Shape getShape() const;
|
||||||
|
void getCommon(CommonShapeParam* param) const;
|
||||||
|
void getSphere(SphereParam* param) const;
|
||||||
|
void getCapsule(CapsuleParam* param) const;
|
||||||
|
void getCylinder(CylinderParam* param) const;
|
||||||
|
void getBox(BoxParam* param) const;
|
||||||
|
void getPolytope(PolytopeParam* param) const;
|
||||||
|
void getCharacterPrism(CharacterPrismParam* param) const;
|
||||||
|
|
||||||
|
agl::utl::Parameter<sead::FixedSafeString<32>> shape_type;
|
||||||
|
agl::utl::Parameter<float> radius;
|
||||||
|
agl::utl::Parameter<float> convex_radius;
|
||||||
|
agl::utl::Parameter<sead::Vector3f> translate_0;
|
||||||
|
agl::utl::Parameter<sead::Vector3f> translate_1;
|
||||||
|
agl::utl::Parameter<sead::Vector3f> rotate;
|
||||||
|
agl::utl::Parameter<int> vertex_num;
|
||||||
|
sead::Buffer<agl::utl::Parameter<sead::Vector3f>> vertices;
|
||||||
|
agl::utl::Parameter<sead::FixedSafeString<32>> material;
|
||||||
|
agl::utl::Parameter<sead::FixedSafeString<32>> sub_material;
|
||||||
|
agl::utl::Parameter<sead::FixedSafeString<32>> wall_code;
|
||||||
|
agl::utl::Parameter<sead::FixedSafeString<32>> floor_code;
|
||||||
|
agl::utl::Parameter<bool> item_code_disable_stick;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace ksys::phys
|
Loading…
Reference in New Issue