mirror of https://github.com/zeldaret/botw.git
ksys/phys: Rename RigidBodyParamView to RigidBodyInstanceParam for clarity
This commit is contained in:
parent
3d9664ed52
commit
278b088bd1
|
|
@ -83270,11 +83270,11 @@ Address,Quality,Size,Name
|
|||
0x0000007100f99050,U,000008,
|
||||
0x0000007100f99058,U,000204,
|
||||
0x0000007100f99124,U,000092,
|
||||
0x0000007100f99180,O,000188,_ZN4ksys4phys16RigidBodyFactory12createSphereEPNS0_18RigidBodyParamViewEPN4sead4HeapE
|
||||
0x0000007100f9923c,O,000188,_ZN4ksys4phys16RigidBodyFactory13createCapsuleEPNS0_18RigidBodyParamViewEPN4sead4HeapE
|
||||
0x0000007100f992f8,O,000188,_ZN4ksys4phys16RigidBodyFactory14createCylinderEPNS0_18RigidBodyParamViewEPN4sead4HeapE
|
||||
0x0000007100f993b4,O,000188,_ZN4ksys4phys16RigidBodyFactory19createWaterCylinderEPNS0_18RigidBodyParamViewEPN4sead4HeapE
|
||||
0x0000007100f99470,O,000188,_ZN4ksys4phys16RigidBodyFactory9createBoxEPNS0_18RigidBodyParamViewEPN4sead4HeapE
|
||||
0x0000007100f99180,O,000188,_ZN4ksys4phys16RigidBodyFactory12createSphereEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f9923c,O,000188,_ZN4ksys4phys16RigidBodyFactory13createCapsuleEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f992f8,O,000188,_ZN4ksys4phys16RigidBodyFactory14createCylinderEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f993b4,O,000188,_ZN4ksys4phys16RigidBodyFactory19createWaterCylinderEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f99470,O,000188,_ZN4ksys4phys16RigidBodyFactory9createBoxEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f9952c,U,000188,
|
||||
0x0000007100f995e8,U,000188,
|
||||
0x0000007100f996a4,U,000188,
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -4,20 +4,20 @@
|
|||
|
||||
namespace ksys::phys {
|
||||
|
||||
class BoxView;
|
||||
class BoxParam;
|
||||
|
||||
struct BoxBody {
|
||||
virtual ~BoxBody();
|
||||
|
||||
RigidBody* init(u32 flag, RigidBodyParamView* view, sead::Heap* heap);
|
||||
RigidBody* init(u32 flag, RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
};
|
||||
|
||||
struct BoxShape {
|
||||
BoxBody* init(sead::Heap* heap);
|
||||
};
|
||||
|
||||
class BoxView : public RigidBodyParamView {
|
||||
SEAD_RTTI_OVERRIDE(BoxView, RigidBodyParamView)
|
||||
class BoxParam : public RigidBodyInstanceParam {
|
||||
SEAD_RTTI_OVERRIDE(BoxParam, RigidBodyInstanceParam)
|
||||
public:
|
||||
u8 _90;
|
||||
float _94;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class hkpShape;
|
|||
|
||||
namespace ksys::phys {
|
||||
|
||||
class CapsuleView;
|
||||
class CapsuleParam;
|
||||
struct CapsuleBody;
|
||||
|
||||
struct CapsuleShape {
|
||||
|
|
@ -42,7 +42,7 @@ struct CapsuleBody {
|
|||
virtual void updateChanges();
|
||||
virtual void scaleVerts(f32 scale);
|
||||
|
||||
RigidBody* init(u32 flag, RigidBodyParamView* view, sead::Heap* heap);
|
||||
RigidBody* init(u32 flag, RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
CapsuleBody* clone(sead::Heap* heap);
|
||||
f32 getRadius() const;
|
||||
void getVertices(sead::Vector3f* va, sead::Vector3f* vb) const;
|
||||
|
|
@ -60,8 +60,8 @@ struct CapsuleBody {
|
|||
hkpShape* shape;
|
||||
};
|
||||
|
||||
class CapsuleView : public RigidBodyParamView {
|
||||
SEAD_RTTI_OVERRIDE(CapsuleView, RigidBodyParamView)
|
||||
class CapsuleParam : public RigidBodyInstanceParam {
|
||||
SEAD_RTTI_OVERRIDE(CapsuleParam, RigidBodyInstanceParam)
|
||||
public:
|
||||
u8 _90;
|
||||
float _94;
|
||||
|
|
|
|||
|
|
@ -4,20 +4,20 @@
|
|||
|
||||
namespace ksys::phys {
|
||||
|
||||
class CylinderView;
|
||||
class CylinderParam;
|
||||
|
||||
struct CylinderBody {
|
||||
virtual ~CylinderBody();
|
||||
|
||||
RigidBody* init(u32 flag, RigidBodyParamView* view, sead::Heap* heap);
|
||||
RigidBody* init(u32 flag, RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
};
|
||||
|
||||
struct CylinderShape {
|
||||
CylinderBody* init(sead::Heap* heap);
|
||||
};
|
||||
|
||||
class CylinderView : public RigidBodyParamView {
|
||||
SEAD_RTTI_OVERRIDE(CylinderView, RigidBodyParamView)
|
||||
class CylinderParam : public RigidBodyInstanceParam {
|
||||
SEAD_RTTI_OVERRIDE(CylinderParam, RigidBodyInstanceParam)
|
||||
public:
|
||||
u8 _90;
|
||||
float _94;
|
||||
|
|
|
|||
|
|
@ -4,20 +4,20 @@
|
|||
|
||||
namespace ksys::phys {
|
||||
|
||||
class SphereView;
|
||||
class SphereParam;
|
||||
|
||||
struct SphereBody {
|
||||
virtual ~SphereBody();
|
||||
|
||||
RigidBody* init(u32 flag, RigidBodyParamView* view, sead::Heap* heap);
|
||||
RigidBody* init(u32 flag, RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
};
|
||||
|
||||
struct SphereShape {
|
||||
SphereBody* init(sead::Heap* heap);
|
||||
};
|
||||
|
||||
class SphereView : public RigidBodyParamView {
|
||||
SEAD_RTTI_OVERRIDE(SphereView, RigidBodyParamView)
|
||||
class SphereParam : public RigidBodyInstanceParam {
|
||||
SEAD_RTTI_OVERRIDE(SphereParam, RigidBodyInstanceParam)
|
||||
public:
|
||||
u8 _90;
|
||||
float _94;
|
||||
|
|
|
|||
|
|
@ -4,20 +4,20 @@
|
|||
|
||||
namespace ksys::phys {
|
||||
|
||||
class WaterCylinderView;
|
||||
class WaterCylinderParam;
|
||||
|
||||
struct WaterCylinderBody {
|
||||
virtual ~WaterCylinderBody();
|
||||
|
||||
RigidBody* init(u32 flag, RigidBodyParamView* view, sead::Heap* heap);
|
||||
RigidBody* init(u32 flag, RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
};
|
||||
|
||||
struct WaterCylinderShape {
|
||||
WaterCylinderBody* init(sead::Heap* heap);
|
||||
};
|
||||
|
||||
class WaterCylinderView : public RigidBodyParamView {
|
||||
SEAD_RTTI_OVERRIDE(WaterCylinderView, RigidBodyParamView)
|
||||
class WaterCylinderParam : public RigidBodyInstanceParam {
|
||||
SEAD_RTTI_OVERRIDE(WaterCylinderParam, RigidBodyInstanceParam)
|
||||
public:
|
||||
u8 _90;
|
||||
float _94;
|
||||
|
|
|
|||
|
|
@ -8,49 +8,49 @@
|
|||
|
||||
namespace ksys::phys {
|
||||
|
||||
RigidBody* RigidBodyFactory::createSphere(RigidBodyParamView* view, sead::Heap* heap) {
|
||||
if (view->isDynamicSensor())
|
||||
view->motion_type = MotionType::Keyframed;
|
||||
RigidBody* RigidBodyFactory::createSphere(RigidBodyInstanceParam* params, sead::Heap* heap) {
|
||||
if (params->isDynamicSensor())
|
||||
params->motion_type = MotionType::Keyframed;
|
||||
|
||||
auto* v = sead::DynamicCast<SphereView>(view);
|
||||
auto* v = sead::DynamicCast<SphereParam>(params);
|
||||
SphereBody* body = v->shape.init(heap);
|
||||
return body->init(1, view, heap);
|
||||
return body->init(1, params, heap);
|
||||
}
|
||||
|
||||
RigidBody* RigidBodyFactory::createCapsule(RigidBodyParamView* view, sead::Heap* heap) {
|
||||
if (view->isDynamicSensor())
|
||||
view->motion_type = MotionType::Keyframed;
|
||||
RigidBody* RigidBodyFactory::createCapsule(RigidBodyInstanceParam* params, sead::Heap* heap) {
|
||||
if (params->isDynamicSensor())
|
||||
params->motion_type = MotionType::Keyframed;
|
||||
|
||||
auto* v = sead::DynamicCast<CapsuleView>(view);
|
||||
auto* v = sead::DynamicCast<CapsuleParam>(params);
|
||||
CapsuleBody* body = v->shape.init(heap);
|
||||
return body->init(1, view, heap);
|
||||
return body->init(1, params, heap);
|
||||
}
|
||||
|
||||
RigidBody* RigidBodyFactory::createCylinder(RigidBodyParamView* view, sead::Heap* heap) {
|
||||
if (view->isDynamicSensor())
|
||||
view->motion_type = MotionType::Keyframed;
|
||||
RigidBody* RigidBodyFactory::createCylinder(RigidBodyInstanceParam* params, sead::Heap* heap) {
|
||||
if (params->isDynamicSensor())
|
||||
params->motion_type = MotionType::Keyframed;
|
||||
|
||||
auto* v = sead::DynamicCast<CylinderView>(view);
|
||||
auto* v = sead::DynamicCast<CylinderParam>(params);
|
||||
CylinderBody* body = v->shape.init(heap);
|
||||
return body->init(1, view, heap);
|
||||
return body->init(1, params, heap);
|
||||
}
|
||||
|
||||
RigidBody* RigidBodyFactory::createWaterCylinder(RigidBodyParamView* view, sead::Heap* heap) {
|
||||
if (view->isDynamicSensor())
|
||||
view->motion_type = MotionType::Keyframed;
|
||||
RigidBody* RigidBodyFactory::createWaterCylinder(RigidBodyInstanceParam* params, sead::Heap* heap) {
|
||||
if (params->isDynamicSensor())
|
||||
params->motion_type = MotionType::Keyframed;
|
||||
|
||||
auto* v = sead::DynamicCast<WaterCylinderView>(view);
|
||||
auto* v = sead::DynamicCast<WaterCylinderParam>(params);
|
||||
WaterCylinderBody* body = v->shape.init(heap);
|
||||
return body->init(1, view, heap);
|
||||
return body->init(1, params, heap);
|
||||
}
|
||||
|
||||
RigidBody* RigidBodyFactory::createBox(RigidBodyParamView* view, sead::Heap* heap) {
|
||||
if (view->isDynamicSensor())
|
||||
view->motion_type = MotionType::Keyframed;
|
||||
RigidBody* RigidBodyFactory::createBox(RigidBodyInstanceParam* params, sead::Heap* heap) {
|
||||
if (params->isDynamicSensor())
|
||||
params->motion_type = MotionType::Keyframed;
|
||||
|
||||
auto* v = sead::DynamicCast<BoxView>(view);
|
||||
auto* v = sead::DynamicCast<BoxParam>(params);
|
||||
BoxBody* body = v->shape.init(heap);
|
||||
return body->init(1, view, heap);
|
||||
return body->init(1, params, heap);
|
||||
}
|
||||
|
||||
} // namespace ksys::phys
|
||||
|
|
|
|||
|
|
@ -9,18 +9,18 @@ class Heap;
|
|||
namespace ksys::phys {
|
||||
|
||||
class RigidBody;
|
||||
struct RigidBodyParamView;
|
||||
struct RigidBodyInstanceParam;
|
||||
|
||||
class RigidBodyFactory {
|
||||
public:
|
||||
static RigidBody* createSphere(RigidBodyParamView* view, sead::Heap* heap);
|
||||
static RigidBody* createCapsule(RigidBodyParamView* view, sead::Heap* heap);
|
||||
static RigidBody* createCylinder(RigidBodyParamView* view, sead::Heap* heap);
|
||||
static RigidBody* createWaterCylinder(RigidBodyParamView* view, sead::Heap* heap);
|
||||
static RigidBody* createBox(RigidBodyParamView* view, sead::Heap* heap);
|
||||
static RigidBody* createWaterBox(RigidBodyParamView* view, sead::Heap* heap);
|
||||
static RigidBody* createPolytope(RigidBodyParamView* view, sead::Heap* heap);
|
||||
static RigidBody* createCollection(RigidBodyParamView* view, sead::Heap* heap);
|
||||
static RigidBody* createSphere(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static RigidBody* createCapsule(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static RigidBody* createCylinder(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static RigidBody* createWaterCylinder(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static RigidBody* createBox(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static RigidBody* createWaterBox(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static RigidBody* createPolytope(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static RigidBody* createCollection(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
};
|
||||
|
||||
} // namespace ksys::phys
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ enum class NavMeshSubMaterial {
|
|||
|
||||
struct ShapeParam;
|
||||
|
||||
struct RigidBodyParamView {
|
||||
SEAD_RTTI_BASE(RigidBodyParamView)
|
||||
struct RigidBodyInstanceParam {
|
||||
SEAD_RTTI_BASE(RigidBodyInstanceParam)
|
||||
public:
|
||||
const char* name = "no name";
|
||||
u32 _10 = -1;
|
||||
|
|
@ -87,7 +87,7 @@ public:
|
|||
motion_type == MotionType::Dynamic;
|
||||
}
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(RigidBodyParamView, 0x90);
|
||||
KSYS_CHECK_SIZE_NX150(RigidBodyInstanceParam, 0x90);
|
||||
|
||||
struct RigidBodyParam : agl::utl::ParameterList {
|
||||
struct Info : agl::utl::ParameterObj {
|
||||
|
|
@ -152,7 +152,7 @@ struct RigidBodyParam : agl::utl::ParameterList {
|
|||
|
||||
// TODO: types and names
|
||||
void* createRigidBody(void* x, sead::Heap* heap, bool y);
|
||||
bool getParams(RigidBodyParamView* view) const;
|
||||
bool getParams(RigidBodyInstanceParam* params) const;
|
||||
void* createEntityShape(void* x, void* y, sead::Heap* heap);
|
||||
|
||||
ContactLayer getContactLayer() const;
|
||||
|
|
|
|||
|
|
@ -127,17 +127,18 @@ void InstanceSet::sub_7100FBB00C(phys::RigidBody* body, phys::RigidBodyParam* pa
|
|||
if (body == nullptr)
|
||||
return;
|
||||
|
||||
phys::RigidBodyParamView view;
|
||||
param->getParams(&view);
|
||||
if (view.contact_layer == phys::ContactLayer::SensorCustomReceiver) {
|
||||
body->sub_7100F8F9E8(&view.flags, _188[body->isMassScaling()]);
|
||||
} else if (view.info_5e0) {
|
||||
body->sub_7100F8FA44(view.contact_layer, view.info_5e0);
|
||||
phys::RigidBodyInstanceParam instance_params;
|
||||
param->getParams(&instance_params);
|
||||
if (instance_params.contact_layer == phys::ContactLayer::SensorCustomReceiver) {
|
||||
body->sub_7100F8F9E8(&instance_params.flags, _188[body->isMassScaling()]);
|
||||
} else if (instance_params.info_5e0) {
|
||||
body->sub_7100F8FA44(instance_params.contact_layer, instance_params.info_5e0);
|
||||
} else {
|
||||
body->sub_7100F8F8CC(view.contact_layer, view.groundhit, _188[body->isMassScaling()]);
|
||||
body->sub_7100F8F8CC(instance_params.contact_layer, instance_params.groundhit,
|
||||
_188[body->isMassScaling()]);
|
||||
}
|
||||
body->setCollideGround(view.no_hit_ground == 0);
|
||||
body->setCollideWater(view.no_hit_water == 0);
|
||||
body->setCollideGround(instance_params.no_hit_ground == 0);
|
||||
body->setCollideWater(instance_params.no_hit_water == 0);
|
||||
body->sub_7100F8F51C();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue