mirror of https://github.com/zeldaret/botw.git
ksys/phys: Add more RigidBody functions
This commit is contained in:
parent
ddef936b26
commit
adad4553d6
|
@ -83022,7 +83022,7 @@ Address,Quality,Size,Name
|
|||
0x0000007100f8fad8,U,000044,phys::RigidBody::x_32
|
||||
0x0000007100f8fb04,U,000004,phys::RigidBody::x_33_nop
|
||||
0x0000007100f8fb08,U,000360,phys::RigidBody::x_34_setTransform
|
||||
0x0000007100f8fc70,U,000196,phys::RigidBody::x_35
|
||||
0x0000007100f8fc70,O,000196,_ZN4ksys4phys9RigidBody11setPositionERKN4sead7Vector3IfEEb
|
||||
0x0000007100f8fd34,U,000012,phys::RigidBody::x_36
|
||||
0x0000007100f8fd40,U,000124,phys::RigidBody::x_37
|
||||
0x0000007100f8fdbc,U,000328,phys::RigidBody::x_38
|
||||
|
@ -83069,45 +83069,45 @@ Address,Quality,Size,Name
|
|||
0x0000007100f93348,O,000180,_ZN4ksys4phys9RigidBody7setMassEf
|
||||
0x0000007100f933fc,O,000156,_ZNK4ksys4phys9RigidBody7getMassEv
|
||||
0x0000007100f93498,O,000156,_ZNK4ksys4phys9RigidBody10getMassInvEv
|
||||
0x0000007100f93534,U,000168,phys::RigidBody::x_69_setInertiaLocal
|
||||
0x0000007100f935dc,U,000176,phys::RigidBody::x_70
|
||||
0x0000007100f9368c,U,000196,phys::RigidBody::x_71_getInertia
|
||||
0x0000007100f93750,U,000180,phys::RigidBody::x_72_setLinearDamping
|
||||
0x0000007100f93804,U,000156,phys::RigidBody::x_73_getLinearDamping
|
||||
0x0000007100f938a0,U,000180,phys::RigidBody::x_74_setAngularDamping
|
||||
0x0000007100f93954,U,000156,phys::RigidBody::x_75_getAngularDamping
|
||||
0x0000007100f939f0,U,000172,phys::RigidBody::setGravityFactor
|
||||
0x0000007100f93a9c,U,000156,phys::RigidBody::x_76_getGravityFactor
|
||||
0x0000007100f93b38,U,000736,phys::RigidBody::m8
|
||||
0x0000007100f93e18,U,000016,phys::RigidBody::x_78
|
||||
0x0000007100f93e28,U,000176,phys::RigidBody::x_79
|
||||
0x0000007100f93ed8,U,000156,phys::RigidBody::x_80
|
||||
0x0000007100f93f74,U,000008,phys::RigidBody::m12
|
||||
0x0000007100f93f7c,U,000008,phys::RigidBody::m4
|
||||
0x0000007100f93f84,U,000152,phys::RigidBody::x_81
|
||||
0x0000007100f9401c,U,000148,phys::RigidBody::x_82
|
||||
0x0000007100f940b0,U,000152,phys::RigidBody::x_83
|
||||
0x0000007100f94148,U,000148,phys::RigidBody::x_84
|
||||
0x0000007100f941dc,U,000152,phys::RigidBody::x_85
|
||||
0x0000007100f94274,U,000148,phys::RigidBody::x_86
|
||||
0x0000007100f94308,U,000172,phys::RigidBody::x_87
|
||||
0x0000007100f943b4,U,000148,phys::RigidBody::x_88
|
||||
0x0000007100f94448,U,000316,phys::RigidBody::x_89
|
||||
0x0000007100f94584,U,000152,phys::RigidBody::x_90
|
||||
0x0000007100f9461c,U,000148,phys::RigidBody::x_91
|
||||
0x0000007100f946b0,U,000204,phys::RigidBody::x_92
|
||||
0x0000007100f9477c,U,000160,phys::RigidBody::x_93
|
||||
0x0000007100f9481c,U,000204,phys::RigidBody::x_94
|
||||
0x0000007100f948e8,U,000156,phys::RigidBody::x_95
|
||||
0x0000007100f94984,U,000204,phys::RigidBody::x_96
|
||||
0x0000007100f94a50,U,000160,phys::RigidBody::x_97
|
||||
0x0000007100f94af0,U,000204,phys::RigidBody::x_98
|
||||
0x0000007100f94bbc,U,000160,phys::RigidBody::x_99
|
||||
0x0000007100f94c5c,U,000156,phys::RigidBody::x_100
|
||||
0x0000007100f94cf8,U,000148,phys::RigidBody::x_101
|
||||
0x0000007100f93534,O,000168,_ZN4ksys4phys9RigidBody15setInertiaLocalERKN4sead7Vector3IfEE
|
||||
0x0000007100f935dc,O,000176,_ZNK4ksys4phys9RigidBody15getInertiaLocalEPN4sead7Vector3IfEE
|
||||
0x0000007100f9368c,O,000196,_ZNK4ksys4phys9RigidBody15getInertiaLocalEv
|
||||
0x0000007100f93750,O,000180,_ZN4ksys4phys9RigidBody16setLinearDampingEf
|
||||
0x0000007100f93804,O,000156,_ZNK4ksys4phys9RigidBody16getLinearDampingEv
|
||||
0x0000007100f938a0,O,000180,_ZN4ksys4phys9RigidBody17setAngularDampingEf
|
||||
0x0000007100f93954,O,000156,_ZNK4ksys4phys9RigidBody17getAngularDampingEv
|
||||
0x0000007100f939f0,O,000172,_ZN4ksys4phys9RigidBody16setGravityFactorEf
|
||||
0x0000007100f93a9c,O,000156,_ZNK4ksys4phys9RigidBody16getGravityFactorEv
|
||||
0x0000007100f93b38,O,000736,_ZN4ksys4phys9RigidBody13setTimeFactorEf
|
||||
0x0000007100f93e18,O,000016,_ZNK4ksys4phys9RigidBody13getTimeFactorEv
|
||||
0x0000007100f93e28,O,000176,_ZN4ksys4phys9RigidBody18setLinkedRigidBodyEPS1_
|
||||
0x0000007100f93ed8,O,000156,_ZNK4ksys4phys9RigidBody26isSensorMotionFlag40000SetEv
|
||||
0x0000007100f93f74,O,000008,_ZN4ksys4phys9RigidBody3m12Eff
|
||||
0x0000007100f93f7c,O,000008,_ZN4ksys4phys9RigidBody2m4Ev
|
||||
0x0000007100f93f84,O,000152,_ZN4ksys4phys9RigidBody21setWaterBuoyancyScaleEf
|
||||
0x0000007100f9401c,O,000148,_ZNK4ksys4phys9RigidBody21getWaterBuoyancyScaleEv
|
||||
0x0000007100f940b0,O,000152,_ZN4ksys4phys9RigidBody25setWaterFlowEffectiveRateEf
|
||||
0x0000007100f94148,O,000148,_ZNK4ksys4phys9RigidBody25getWaterFlowEffectiveRateEv
|
||||
0x0000007100f941dc,O,000152,_ZN4ksys4phys9RigidBody16setFrictionScaleEf
|
||||
0x0000007100f94274,O,000148,_ZNK4ksys4phys9RigidBody16getFrictionScaleEv
|
||||
0x0000007100f94308,O,000172,_ZN4ksys4phys9RigidBody19setRestitutionScaleEf
|
||||
0x0000007100f943b4,O,000148,_ZNK4ksys4phys9RigidBody19getRestitutionScaleEv
|
||||
0x0000007100f94448,O,000316,_ZNK4ksys4phys9RigidBody28getEffectiveRestitutionScaleEv
|
||||
0x0000007100f94584,O,000152,_ZN4ksys4phys9RigidBody13setMaxImpulseEf
|
||||
0x0000007100f9461c,O,000148,_ZNK4ksys4phys9RigidBody13getMaxImpulseEv
|
||||
0x0000007100f946b0,O,000204,_ZN4ksys4phys9RigidBody22clearEntityMotionFlag4Eb
|
||||
0x0000007100f9477c,O,000160,_ZNK4ksys4phys9RigidBody22isEntityMotionFlag4OffEv
|
||||
0x0000007100f9481c,O,000204,_ZN4ksys4phys9RigidBody20setEntityMotionFlag8Eb
|
||||
0x0000007100f948e8,O,000156,_ZNK4ksys4phys9RigidBody21isEntityMotionFlag8OnEv
|
||||
0x0000007100f94984,O,000204,_ZN4ksys4phys9RigidBody23clearEntityMotionFlag10Eb
|
||||
0x0000007100f94a50,O,000160,_ZNK4ksys4phys9RigidBody23isEntityMotionFlag10OffEv
|
||||
0x0000007100f94af0,O,000204,_ZN4ksys4phys9RigidBody23clearEntityMotionFlag20Eb
|
||||
0x0000007100f94bbc,O,000160,_ZNK4ksys4phys9RigidBody23isEntityMotionFlag20OffEv
|
||||
0x0000007100f94c5c,O,000156,_ZN4ksys4phys9RigidBody18setColImpulseScaleEf
|
||||
0x0000007100f94cf8,O,000148,_ZNK4ksys4phys9RigidBody18getColImpulseScaleEv
|
||||
0x0000007100f94d8c,U,000228,phys::RigidBody::x_102
|
||||
0x0000007100f94e70,U,000008,phys::RigidBody::lockCS
|
||||
0x0000007100f94e78,U,000008,phys::RigidBody::unlockCS
|
||||
0x0000007100f94e70,O,000008,_ZN4ksys4phys9RigidBody4lockEv
|
||||
0x0000007100f94e78,O,000008,_ZN4ksys4phys9RigidBody6unlockEv
|
||||
0x0000007100f94e80,U,000152,phys::RigidBody::x_103
|
||||
0x0000007100f94f18,U,000404,phys::RigidBody::x_104
|
||||
0x0000007100f950ac,U,000328,phys::RigidBody::x_105
|
||||
|
@ -83127,8 +83127,8 @@ Address,Quality,Size,Name
|
|||
0x0000007100f964dc,U,000148,phys::RigidBody::x_117
|
||||
0x0000007100f96570,U,000008,phys::RigidBody::m10
|
||||
0x0000007100f96578,U,000008,phys::RigidBody::m11
|
||||
0x0000007100f96580,U,000240,phys::RigidBody::m13
|
||||
0x0000007100f96670,U,000144,phys::RigidBody::m14
|
||||
0x0000007100f96580,O,000240,_ZN4ksys4phys9RigidBody13resetPositionEv
|
||||
0x0000007100f96670,O,000144,_ZN4ksys4phys9RigidBody7getNameEv
|
||||
0x0000007100f96700,U,000068,phys::RigidBody::m5
|
||||
0x0000007100f96744,U,000176,phys::RigidBody::x_118
|
||||
0x0000007100f967f4,U,000428,phys::RigidBody::x_119
|
||||
|
|
Can't render this file because it is too large.
|
|
@ -243,6 +243,31 @@ void RigidBody::resetLinkedRigidBody() const {
|
|||
accessor->resetLinkedRigidBody();
|
||||
}
|
||||
|
||||
bool RigidBody::setLinkedRigidBody(RigidBody* body) {
|
||||
if (!isSensor())
|
||||
return false;
|
||||
|
||||
if (body != nullptr && hasFlag(Flag::_20))
|
||||
return false;
|
||||
|
||||
if (!mMotionAccessor)
|
||||
return false;
|
||||
|
||||
auto* accessor = sead::DynamicCast<RigidBodyMotionSensor>(mMotionAccessor);
|
||||
if (!accessor)
|
||||
return false;
|
||||
|
||||
accessor->setLinkedRigidBody(body);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RigidBody::isSensorMotionFlag40000Set() const {
|
||||
auto* accessor = getSensorMotionAccessor();
|
||||
if (!accessor)
|
||||
return false;
|
||||
return accessor->isFlag40000Set();
|
||||
}
|
||||
|
||||
MotionType RigidBody::getMotionType() const {
|
||||
if (mMotionFlags.isOn(MotionFlag::Dynamic))
|
||||
return MotionType::Dynamic;
|
||||
|
@ -276,6 +301,15 @@ void RigidBody::setContactNone() {
|
|||
mContactMask.makeAllZero();
|
||||
}
|
||||
|
||||
void RigidBody::setPosition(const sead::Vector3f& position, bool propagate_to_linked_motions) {
|
||||
if (isVectorInvalid(position)) {
|
||||
onInvalidParameter();
|
||||
return;
|
||||
}
|
||||
|
||||
mMotionAccessor->setPosition(position, propagate_to_linked_motions);
|
||||
}
|
||||
|
||||
void RigidBody::getPosition(sead::Vector3f* position) const {
|
||||
if (mMotionAccessor)
|
||||
mMotionAccessor->getPosition(position);
|
||||
|
@ -502,14 +536,264 @@ float RigidBody::getMassInv() const {
|
|||
return getEntityMotionAccessor()->getMassInv();
|
||||
}
|
||||
|
||||
void RigidBody::lock(bool also_lock_world) {
|
||||
if (also_lock_world)
|
||||
MemSystem::instance()->lockWorld(getLayerType());
|
||||
void RigidBody::setInertiaLocal(const sead::Vector3f& inertia) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
getEntityMotionAccessor()->setInertiaLocal(inertia);
|
||||
}
|
||||
|
||||
void RigidBody::getInertiaLocal(sead::Vector3f* inertia) const {
|
||||
if (isEntity()) {
|
||||
getEntityMotionAccessor()->getInertiaLocal(inertia);
|
||||
} else {
|
||||
inertia->set(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void RigidBody::setLinearDamping(float value) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
getEntityMotionAccessor()->setLinearDamping(value);
|
||||
}
|
||||
|
||||
float RigidBody::getLinearDamping() const {
|
||||
if (!isEntity())
|
||||
return 0.0;
|
||||
return getEntityMotionAccessor()->getLinearDamping();
|
||||
}
|
||||
|
||||
void RigidBody::setAngularDamping(float value) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
getEntityMotionAccessor()->setAngularDamping(value);
|
||||
}
|
||||
|
||||
float RigidBody::getAngularDamping() const {
|
||||
if (!isEntity())
|
||||
return 0.0;
|
||||
return getEntityMotionAccessor()->getAngularDamping();
|
||||
}
|
||||
|
||||
void RigidBody::setGravityFactor(float value) {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return;
|
||||
getEntityMotionAccessor()->setGravityFactor(value);
|
||||
}
|
||||
|
||||
float RigidBody::getGravityFactor() const {
|
||||
if (!mMotionAccessor || !isEntity())
|
||||
return 1.0;
|
||||
return getEntityMotionAccessor()->getGravityFactor();
|
||||
}
|
||||
|
||||
bool RigidBody::setTimeFactor(float value) {
|
||||
if (!mMotionAccessor)
|
||||
return false;
|
||||
|
||||
const float current_time_factor = getTimeFactor();
|
||||
if (sead::Mathf::equalsEpsilon(current_time_factor, value, 0.001))
|
||||
return false;
|
||||
|
||||
if (hasFlag(Flag::_80000))
|
||||
return false;
|
||||
|
||||
mMotionAccessor->setTimeFactor(value);
|
||||
|
||||
if (value != 0.0 && current_time_factor != 0.0 && isEntity()) {
|
||||
setLinearDamping(getLinearDamping());
|
||||
setAngularDamping(getAngularDamping());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
float RigidBody::getTimeFactor() const {
|
||||
return mMotionAccessor->getTimeFactor();
|
||||
}
|
||||
|
||||
sead::Vector3f RigidBody::getInertiaLocal() const {
|
||||
sead::Vector3f inertia;
|
||||
getInertiaLocal(&inertia);
|
||||
return inertia;
|
||||
}
|
||||
|
||||
float RigidBody::m12(float x, float y) {
|
||||
return y;
|
||||
}
|
||||
|
||||
float RigidBody::m4() {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
void RigidBody::setWaterBuoyancyScale(float scale) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
getEntityMotionAccessor()->setWaterBuoyancyScale(scale);
|
||||
}
|
||||
|
||||
float RigidBody::getWaterBuoyancyScale() const {
|
||||
if (!isEntity())
|
||||
return 0.0;
|
||||
return getEntityMotionAccessor()->getWaterBuoyancyScale();
|
||||
}
|
||||
|
||||
void RigidBody::setWaterFlowEffectiveRate(float rate) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
getEntityMotionAccessor()->setWaterFlowEffectiveRate(rate);
|
||||
}
|
||||
|
||||
float RigidBody::getWaterFlowEffectiveRate() const {
|
||||
if (!isEntity())
|
||||
return 0.0;
|
||||
return getEntityMotionAccessor()->getWaterFlowEffectiveRate();
|
||||
}
|
||||
|
||||
void RigidBody::setMagneMassScalingFactor(float factor) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
getEntityMotionAccessor()->setMagneMassScalingFactor(factor);
|
||||
}
|
||||
|
||||
float RigidBody::getMagneMassScalingFactor() const {
|
||||
if (!isEntity())
|
||||
return 0.0;
|
||||
return getEntityMotionAccessor()->getMagneMassScalingFactor();
|
||||
}
|
||||
|
||||
void RigidBody::setFrictionScale(float scale) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
getEntityMotionAccessor()->setFrictionScale(scale);
|
||||
}
|
||||
|
||||
float RigidBody::getFrictionScale() const {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return 1.0;
|
||||
return getEntityMotionAccessor()->getFrictionScale();
|
||||
}
|
||||
|
||||
void RigidBody::setRestitutionScale(float scale) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
scale = sead::Mathf::clamp(scale, 0.0, 1.0);
|
||||
getEntityMotionAccessor()->setRestitutionScale(scale);
|
||||
}
|
||||
|
||||
float RigidBody::getRestitutionScale() const {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return 1.0;
|
||||
return getEntityMotionAccessor()->getRestitutionScale();
|
||||
}
|
||||
|
||||
float RigidBody::getEffectiveRestitutionScale() const {
|
||||
if (hasFlag(Flag::_2000) || hasFlag(Flag::_4000) || hasFlag(Flag::_8000) ||
|
||||
hasFlag(Flag::_10000)) {
|
||||
return getRestitutionScale() * 0.5f;
|
||||
}
|
||||
|
||||
return getRestitutionScale();
|
||||
}
|
||||
|
||||
void RigidBody::setMaxImpulse(float max) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
getEntityMotionAccessor()->setMaxImpulse(max);
|
||||
}
|
||||
|
||||
float RigidBody::getMaxImpulse() const {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return 1.0;
|
||||
return getEntityMotionAccessor()->getMaxImpulse();
|
||||
}
|
||||
|
||||
void RigidBody::clearEntityMotionFlag4(bool clear) {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return;
|
||||
getEntityMotionAccessor()->changeFlag(RigidBodyMotionEntity::Flag::_4, !clear);
|
||||
}
|
||||
|
||||
bool RigidBody::isEntityMotionFlag4Off() const {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return false;
|
||||
return !getEntityMotionAccessor()->hasFlag(RigidBodyMotionEntity::Flag::_4);
|
||||
}
|
||||
|
||||
void RigidBody::setEntityMotionFlag8(bool set) {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return;
|
||||
getEntityMotionAccessor()->changeFlag(RigidBodyMotionEntity::Flag::_8, set);
|
||||
}
|
||||
|
||||
bool RigidBody::isEntityMotionFlag8On() const {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return false;
|
||||
return getEntityMotionAccessor()->hasFlag(RigidBodyMotionEntity::Flag::_8);
|
||||
}
|
||||
|
||||
void RigidBody::clearEntityMotionFlag10(bool clear) {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return;
|
||||
getEntityMotionAccessor()->changeFlag(RigidBodyMotionEntity::Flag::_10, !clear);
|
||||
}
|
||||
|
||||
bool RigidBody::isEntityMotionFlag10Off() const {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return false;
|
||||
return !getEntityMotionAccessor()->hasFlag(RigidBodyMotionEntity::Flag::_10);
|
||||
}
|
||||
|
||||
void RigidBody::clearEntityMotionFlag20(bool clear) {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return;
|
||||
getEntityMotionAccessor()->changeFlag(RigidBodyMotionEntity::Flag::_20, !clear);
|
||||
}
|
||||
|
||||
bool RigidBody::isEntityMotionFlag20Off() const {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return false;
|
||||
return !getEntityMotionAccessor()->hasFlag(RigidBodyMotionEntity::Flag::_20);
|
||||
}
|
||||
|
||||
void RigidBody::setColImpulseScale(float scale) {
|
||||
if (!isEntity())
|
||||
return;
|
||||
scale = sead::Mathf::max(scale, 0.0);
|
||||
getEntityMotionAccessor()->setColImpulseScale(scale);
|
||||
}
|
||||
|
||||
float RigidBody::getColImpulseScale() const {
|
||||
if (!isEntity() || !mMotionAccessor)
|
||||
return 1.0;
|
||||
return getEntityMotionAccessor()->getColImpulseScale();
|
||||
}
|
||||
|
||||
void RigidBody::resetPosition() {
|
||||
// debug logging?
|
||||
[[maybe_unused]] sead::Vector3f position = getPosition();
|
||||
setPosition(sead::Vector3f::zero, true);
|
||||
}
|
||||
|
||||
const char* RigidBody::getName() {
|
||||
return mUserTag ? mUserTag->getName().cstr() : getHkBodyName().cstr();
|
||||
}
|
||||
|
||||
void RigidBody::lock() {
|
||||
mCS.lock();
|
||||
}
|
||||
|
||||
void RigidBody::unlock(bool also_unlock_world) {
|
||||
void RigidBody::lock(bool also_lock_world) {
|
||||
if (also_lock_world)
|
||||
MemSystem::instance()->lockWorld(getLayerType());
|
||||
lock();
|
||||
}
|
||||
|
||||
void RigidBody::unlock() {
|
||||
mCS.unlock();
|
||||
}
|
||||
|
||||
void RigidBody::unlock(bool also_unlock_world) {
|
||||
unlock();
|
||||
if (also_unlock_world)
|
||||
MemSystem::instance()->unlockWorld(getLayerType());
|
||||
}
|
||||
|
|
|
@ -103,18 +103,10 @@ public:
|
|||
~RigidBody() override;
|
||||
|
||||
// FIXME: types and names
|
||||
virtual void m4();
|
||||
virtual float m4();
|
||||
virtual void m5();
|
||||
virtual void m6();
|
||||
virtual void m7();
|
||||
virtual void m8(float);
|
||||
// FIXME: should be pure
|
||||
virtual void m9();
|
||||
virtual void m10();
|
||||
virtual void m11();
|
||||
virtual void m12();
|
||||
virtual void m13();
|
||||
virtual const char* getName();
|
||||
|
||||
bool initMotionAccessorForDynamicMotion(sead::Heap* heap);
|
||||
bool initMotionAccessor(const RigidBodyInstanceParam& param, sead::Heap* heap,
|
||||
|
@ -149,6 +141,9 @@ public:
|
|||
RigidBody* getLinkedRigidBody() const;
|
||||
/// Reset the linked rigid body if we have a sensor motion accessor.
|
||||
void resetLinkedRigidBody() const;
|
||||
/// Set the linked rigid body. This can only be done for sensor rigid bodies.
|
||||
bool setLinkedRigidBody(RigidBody* body);
|
||||
bool isSensorMotionFlag40000Set() const;
|
||||
|
||||
// 0x0000007100f8d840
|
||||
void x_8();
|
||||
|
@ -189,6 +184,7 @@ public:
|
|||
void sub_7100F8F9E8(ReceiverMask*, void*);
|
||||
void sub_7100F8FA44(ContactLayer, u32);
|
||||
|
||||
void setPosition(const sead::Vector3f& position, bool propagate_to_linked_motions);
|
||||
void getPosition(sead::Vector3f* position) const;
|
||||
sead::Vector3f getPosition() const;
|
||||
|
||||
|
@ -210,7 +206,6 @@ public:
|
|||
void getAngularVelocity(sead::Vector3f* velocity) const;
|
||||
sead::Vector3f getAngularVelocity() const;
|
||||
|
||||
// 0x0000007100f91264
|
||||
void getPointVelocity(sead::Vector3f* velocity, const sead::Vector3f& point) const;
|
||||
|
||||
// 0x0000007100f92b74
|
||||
|
@ -236,29 +231,58 @@ public:
|
|||
|
||||
void setMass(float mass);
|
||||
float getMass() const;
|
||||
// 0x0000007100f93498
|
||||
float getMassInv() const;
|
||||
|
||||
// 0x0000007100f93534
|
||||
void setInertiaLocal(const sead::Vector3f& inertia);
|
||||
// 0x0000007100f935dc
|
||||
void getInertiaLocal(sead::Vector3f* inertia) const;
|
||||
// 0x0000007100f9368c
|
||||
sead::Vector3f getInertiaLocal() const;
|
||||
|
||||
// 0x0000007100f93750
|
||||
void setLinearDamping(float value);
|
||||
// 0x0000007100f93804
|
||||
float getLinearDamping() const;
|
||||
// 0x0000007100f938a0
|
||||
|
||||
void setAngularDamping(float value);
|
||||
// 0x0000007100f93954
|
||||
float getAngularDamping() const;
|
||||
// 0x0000007100f939f0
|
||||
|
||||
void setGravityFactor(float value);
|
||||
// 0x0000007100f93a9c
|
||||
float getGravityFactor() const;
|
||||
|
||||
virtual bool setTimeFactor(float value);
|
||||
float getTimeFactor() const;
|
||||
|
||||
void setWaterBuoyancyScale(float scale);
|
||||
float getWaterBuoyancyScale() const;
|
||||
|
||||
void setWaterFlowEffectiveRate(float rate);
|
||||
float getWaterFlowEffectiveRate() const;
|
||||
|
||||
void setMagneMassScalingFactor(float factor);
|
||||
float getMagneMassScalingFactor() const;
|
||||
|
||||
void setFrictionScale(float scale);
|
||||
float getFrictionScale() const;
|
||||
|
||||
void setRestitutionScale(float scale);
|
||||
float getRestitutionScale() const;
|
||||
float getEffectiveRestitutionScale() const;
|
||||
|
||||
void setMaxImpulse(float max);
|
||||
float getMaxImpulse() const;
|
||||
|
||||
void setColImpulseScale(float scale);
|
||||
float getColImpulseScale() const;
|
||||
|
||||
void clearEntityMotionFlag4(bool clear);
|
||||
bool isEntityMotionFlag4Off() const;
|
||||
|
||||
void setEntityMotionFlag8(bool set);
|
||||
bool isEntityMotionFlag8On() const;
|
||||
|
||||
void clearEntityMotionFlag10(bool clear);
|
||||
bool isEntityMotionFlag10Off() const;
|
||||
|
||||
void clearEntityMotionFlag20(bool clear);
|
||||
bool isEntityMotionFlag20Off() const;
|
||||
|
||||
bool isSensor() const { return mFlags.isOn(Flag::IsSensor); }
|
||||
bool isEntity() const { return !mFlags.isOn(Flag::IsSensor); }
|
||||
ContactLayerType getLayerType() const {
|
||||
|
@ -275,9 +299,9 @@ public:
|
|||
Type getType() const { return mType; }
|
||||
bool isCharacterControllerType() const { return mType == Type::CharacterController; }
|
||||
|
||||
// 0x0000007100f969a0
|
||||
void lock();
|
||||
void lock(bool also_lock_world);
|
||||
// 0x0000007100f969e8
|
||||
void unlock();
|
||||
void unlock(bool also_unlock_world);
|
||||
|
||||
hkpMotion* getMotion() const;
|
||||
|
@ -301,6 +325,14 @@ public:
|
|||
return ScopedLock(this, also_lock_world);
|
||||
}
|
||||
|
||||
// FIXME: should be pure
|
||||
virtual void m9();
|
||||
virtual void m10();
|
||||
virtual void m11();
|
||||
virtual float m12(float x, float y);
|
||||
virtual void resetPosition();
|
||||
virtual const char* getName();
|
||||
|
||||
private:
|
||||
void createMotionAccessor(sead::Heap* heap);
|
||||
void onInvalidParameter(int code = 0);
|
||||
|
|
|
@ -688,7 +688,7 @@ void RigidBodyMotionEntity::setImpulseEpsilon(float epsilon) {
|
|||
sImpulseEpsilon = epsilon;
|
||||
}
|
||||
|
||||
void RigidBodyMotionEntity::setMaxImpulse(float max_impulse) {
|
||||
void RigidBodyMotionEntity::setDefaultMaxImpulse(float max_impulse) {
|
||||
sMaxImpulse = max_impulse;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,13 @@ public:
|
|||
enum class Flag {
|
||||
_1 = 1 << 0,
|
||||
_2 = 1 << 1,
|
||||
_4 = 1 << 2,
|
||||
_8 = 1 << 3,
|
||||
_10 = 1 << 4,
|
||||
_20 = 1 << 5,
|
||||
_40 = 1 << 6,
|
||||
_80 = 1 << 7,
|
||||
_100 = 1 << 8,
|
||||
_200 = 1 << 9,
|
||||
};
|
||||
|
||||
|
@ -79,6 +86,27 @@ public:
|
|||
void setGravityFactor(float value);
|
||||
float getGravityFactor() const;
|
||||
|
||||
float getWaterBuoyancyScale() const { return mWaterBuoyancyScale; }
|
||||
void setWaterBuoyancyScale(float scale) { mWaterBuoyancyScale = scale; }
|
||||
|
||||
float getWaterFlowEffectiveRate() const { return mWaterFlowEffectiveRate; }
|
||||
void setWaterFlowEffectiveRate(float rate) { mWaterFlowEffectiveRate = rate; }
|
||||
|
||||
float getMagneMassScalingFactor() const { return mMagneMassScalingFactor; }
|
||||
void setMagneMassScalingFactor(float factor) { mMagneMassScalingFactor = factor; }
|
||||
|
||||
float getFrictionScale() const { return mFrictionScale; }
|
||||
void setFrictionScale(float scale) { mFrictionScale = scale; }
|
||||
|
||||
float getRestitutionScale() const { return mRestitutionScale; }
|
||||
void setRestitutionScale(float scale) { mRestitutionScale = scale; }
|
||||
|
||||
float getMaxImpulse() const { return mMaxImpulse; }
|
||||
void setMaxImpulse(float max) { mMaxImpulse = max; }
|
||||
|
||||
float getColImpulseScale() const { return mColImpulseScale; }
|
||||
void setColImpulseScale(float scale) { mColImpulseScale = scale; }
|
||||
|
||||
void processUpdateFlags();
|
||||
void updateRigidBodyMotionExceptState();
|
||||
void updateRigidBodyMotionExceptStateAndVel();
|
||||
|
@ -89,8 +117,13 @@ public:
|
|||
void copyTransformToAllLinkedBodies();
|
||||
void copyMotionToAllLinkedBodies();
|
||||
|
||||
bool hasFlag(Flag flag) const { return mFlags.isOn(flag); }
|
||||
void setFlag(Flag flag) { mFlags.set(flag); }
|
||||
void resetFlag(Flag flag) { mFlags.reset(flag); }
|
||||
void changeFlag(Flag flag, bool on) { mFlags.change(flag, on); }
|
||||
|
||||
static void setImpulseEpsilon(float epsilon);
|
||||
static void setMaxImpulse(float max_impulse);
|
||||
static void setDefaultMaxImpulse(float max_impulse);
|
||||
|
||||
private:
|
||||
hkpMotion*
|
||||
|
|
Loading…
Reference in New Issue