mirror of https://github.com/zeldaret/botw.git
ksys: Change isSensorLayer to getContactLayerType
The == 0 and == 1 comparisons suggest that the function actually returns a ContactLayerType rather than a boolean
This commit is contained in:
parent
c0a24e1611
commit
fb8f0c636e
|
@ -79375,7 +79375,7 @@ Address,Quality,Size,Name
|
||||||
0x0000007100e93db0,U,000492,
|
0x0000007100e93db0,U,000492,
|
||||||
0x0000007100e93f9c,U,000288,NPCBase::m2
|
0x0000007100e93f9c,U,000288,NPCBase::m2
|
||||||
0x0000007100e940bc,U,000092,NPCBase::m3
|
0x0000007100e940bc,U,000092,NPCBase::m3
|
||||||
0x0000007100e94118,O,000028,_ZN4ksys4phys13isSensorLayerENS0_12ContactLayerE
|
0x0000007100e94118,O,000028,_ZN4ksys4phys19getContactLayerTypeENS0_12ContactLayerE
|
||||||
0x0000007100e94134,O,000044,_ZN4ksys4phys20makeContactLayerMaskENS0_12ContactLayerE
|
0x0000007100e94134,O,000044,_ZN4ksys4phys20makeContactLayerMaskENS0_12ContactLayerE
|
||||||
0x0000007100e94160,O,000016,_ZN4ksys4phys19getContactLayerBaseENS0_16ContactLayerTypeE
|
0x0000007100e94160,O,000016,_ZN4ksys4phys19getContactLayerBaseENS0_16ContactLayerTypeE
|
||||||
0x0000007100e94170,O,000040,_ZN4ksys4phys32getContactLayerBaseRelativeValueENS0_12ContactLayerE
|
0x0000007100e94170,O,000040,_ZN4ksys4phys32getContactLayerBaseRelativeValueENS0_12ContactLayerE
|
||||||
|
|
Can't render this file because it is too large.
|
|
@ -83,7 +83,8 @@ public:
|
||||||
bool no_char_standing_on = false;
|
bool no_char_standing_on = false;
|
||||||
|
|
||||||
bool isDynamicSensor() const {
|
bool isDynamicSensor() const {
|
||||||
return isSensorLayer(contact_layer) == 1 && motion_type == MotionType::Dynamic;
|
return getContactLayerType(contact_layer) == ContactLayerType::Sensor &&
|
||||||
|
motion_type == MotionType::Dynamic;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
KSYS_CHECK_SIZE_NX150(RigidBodyParamView, 0x90);
|
KSYS_CHECK_SIZE_NX150(RigidBodyParamView, 0x90);
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
namespace ksys::phys {
|
namespace ksys::phys {
|
||||||
|
|
||||||
u32 isSensorLayer(ContactLayer layer) {
|
ContactLayerType getContactLayerType(ContactLayer layer) {
|
||||||
return layer > ContactLayer::EntityEnd;
|
if (layer > ContactLayer::EntityEnd)
|
||||||
|
return ContactLayerType::Sensor;
|
||||||
|
return ContactLayerType::Entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 makeContactLayerMask(ContactLayer layer) {
|
u32 makeContactLayerMask(ContactLayer layer) {
|
||||||
|
|
|
@ -164,7 +164,7 @@ enum class MotionType {
|
||||||
Unknown = 3,
|
Unknown = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
u32 isSensorLayer(ContactLayer layer);
|
ContactLayerType getContactLayerType(ContactLayer layer);
|
||||||
u32 makeContactLayerMask(ContactLayer layer);
|
u32 makeContactLayerMask(ContactLayer layer);
|
||||||
u32 getContactLayerBase(ContactLayerType type);
|
u32 getContactLayerBase(ContactLayerType type);
|
||||||
u32 getContactLayerBaseRelativeValue(ContactLayer layer);
|
u32 getContactLayerBaseRelativeValue(ContactLayer layer);
|
||||||
|
|
|
@ -89,7 +89,7 @@ void InstanceSet::sub_7100FBA9BC() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstanceSet::sub_7100FBACE0(phys::ContactLayer layer) {
|
void InstanceSet::sub_7100FBACE0(phys::ContactLayer layer) {
|
||||||
bool sensor = phys::isSensorLayer(layer);
|
bool sensor = phys::getContactLayerType(layer) != ContactLayerType::Entity;
|
||||||
|
|
||||||
for (auto& rb : mRigidBodySets) {
|
for (auto& rb : mRigidBodySets) {
|
||||||
rb.disableCollisionMaybe(layer);
|
rb.disableCollisionMaybe(layer);
|
||||||
|
|
Loading…
Reference in New Issue