mirror of https://github.com/zeldaret/botw.git
ksys/phys: Add prerequisites for RigidBody (RigidBodyParam fixes)
Seems to have fixed _ZN4ksys4phys11InstanceSet14sub_7100FBB00CEPNS0_9RigidBodyEPNS0_14RigidBodyParamE
This commit is contained in:
parent
544c33e2eb
commit
2ed36c7dc0
|
@ -11945,7 +11945,7 @@ Address,Quality,Size,Name
|
||||||
0x00000071001c069c,O,000092,_ZNK5uking6action29ItemAmiiboCreateFromDropTable18getRuntimeTypeInfoEv
|
0x00000071001c069c,O,000092,_ZNK5uking6action29ItemAmiiboCreateFromDropTable18getRuntimeTypeInfoEv
|
||||||
0x00000071001c06f8,U,000204,phys::RigidBodyParamView1::rtti1
|
0x00000071001c06f8,U,000204,phys::RigidBodyParamView1::rtti1
|
||||||
0x00000071001c07c4,U,000092,phys::RigidBodyParamView1::rtti2
|
0x00000071001c07c4,U,000092,phys::RigidBodyParamView1::rtti2
|
||||||
0x00000071001c0820,U,000140,
|
0x00000071001c0820,O,000140,_ZNK4sead15RuntimeTypeInfo6DeriveIN4ksys4phys22RigidBodyInstanceParamEE9isDerivedEPKNS0_9InterfaceE
|
||||||
0x00000071001c08ac,U,000220,
|
0x00000071001c08ac,U,000220,
|
||||||
0x00000071001c0988,U,000176,sinitAmiiboDropTables
|
0x00000071001c0988,U,000176,sinitAmiiboDropTables
|
||||||
0x00000071001c0a38,U,000184,AI_Action_ItemAmiiboSelectDropTable::ctor
|
0x00000071001c0a38,U,000184,AI_Action_ItemAmiiboSelectDropTable::ctor
|
||||||
|
@ -21667,8 +21667,8 @@ Address,Quality,Size,Name
|
||||||
0x000000710033e548,O,000092,_ZNK5uking2ai12BoxWaterRoot18getRuntimeTypeInfoEv
|
0x000000710033e548,O,000092,_ZNK5uking2ai12BoxWaterRoot18getRuntimeTypeInfoEv
|
||||||
0x000000710033e5a4,U,000204,
|
0x000000710033e5a4,U,000204,
|
||||||
0x000000710033e670,U,000092,
|
0x000000710033e670,U,000092,
|
||||||
0x000000710033e6cc,U,000112,
|
0x000000710033e6cc,O,000112,_ZNK4ksys4phys22RigidBodyInstanceParam27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
|
||||||
0x000000710033e73c,U,000092,
|
0x000000710033e73c,O,000092,_ZNK4ksys4phys22RigidBodyInstanceParam18getRuntimeTypeInfoEv
|
||||||
0x000000710033e798,U,000052,
|
0x000000710033e798,U,000052,
|
||||||
0x000000710033e7cc,U,000100,AI_AI_BreathAttackEnemyBattle::ctor
|
0x000000710033e7cc,U,000100,AI_AI_BreathAttackEnemyBattle::ctor
|
||||||
0x000000710033e830,U,000068,_ZN5uking2ai23BreathAttackEnemyBattleD1Ev
|
0x000000710033e830,U,000068,_ZN5uking2ai23BreathAttackEnemyBattleD1Ev
|
||||||
|
@ -82961,11 +82961,11 @@ Address,Quality,Size,Name
|
||||||
0x0000007100f8c540,U,000008,
|
0x0000007100f8c540,U,000008,
|
||||||
0x0000007100f8c548,U,000140,
|
0x0000007100f8c548,U,000140,
|
||||||
0x0000007100f8c5d4,O,000492,_ZN4ksys4phys9RigidBodyC1ENS1_4TypeEjP12hkpRigidBodyRKN4sead14SafeStringBaseIcEEPNS5_4HeapEb
|
0x0000007100f8c5d4,O,000492,_ZN4ksys4phys9RigidBodyC1ENS1_4TypeEjP12hkpRigidBodyRKN4sead14SafeStringBaseIcEEPNS5_4HeapEb
|
||||||
0x0000007100f8c7c0,U,000160,RigidBody::dtor
|
0x0000007100f8c7c0,O,000160,_ZN4ksys4phys9RigidBodyD1Ev
|
||||||
0x0000007100f8c860,U,000160,
|
0x0000007100f8c860,O,000160,_ZThn32_N4ksys4phys9RigidBodyD1Ev
|
||||||
0x0000007100f8c900,U,000168,RigidBody::dtorDelete
|
0x0000007100f8c900,O,000168,_ZN4ksys4phys9RigidBodyD0Ev
|
||||||
0x0000007100f8c9a8,U,000168,
|
0x0000007100f8c9a8,O,000168,_ZThn32_N4ksys4phys9RigidBodyD0Ev
|
||||||
0x0000007100f8ca50,U,000584,phys::RigidBody::initMotionAccessor
|
0x0000007100f8ca50,O,000584,_ZN4ksys4phys9RigidBody34initMotionAccessorForDynamicMotionEPN4sead4HeapE
|
||||||
0x0000007100f8cc98,U,000172,phys::RigidBody::initRigidMotion
|
0x0000007100f8cc98,U,000172,phys::RigidBody::initRigidMotion
|
||||||
0x0000007100f8cd44,U,000552,phys::RigidBody::initMotion
|
0x0000007100f8cd44,U,000552,phys::RigidBody::initMotion
|
||||||
0x0000007100f8cf6c,O,000052,_ZNK4ksys4phys9RigidBody13getHkBodyNameEv
|
0x0000007100f8cf6c,O,000052,_ZNK4ksys4phys9RigidBody13getHkBodyNameEv
|
||||||
|
@ -83143,8 +83143,8 @@ Address,Quality,Size,Name
|
||||||
0x0000007100f96d58,U,000204,phys::RigidBody::x_128
|
0x0000007100f96d58,U,000204,phys::RigidBody::x_128
|
||||||
0x0000007100f96e24,U,000096,
|
0x0000007100f96e24,U,000096,
|
||||||
0x0000007100f96e84,U,000384,
|
0x0000007100f96e84,U,000384,
|
||||||
0x0000007100f97004,U,000112,RigidBody::rtti1
|
0x0000007100f97004,O,000112,_ZNK4ksys4phys9RigidBody27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
|
||||||
0x0000007100f97074,U,000092,RigidBody::rtti2
|
0x0000007100f97074,O,000092,_ZNK4ksys4phys9RigidBody18getRuntimeTypeInfoEv
|
||||||
0x0000007100f970d0,O,000140,_ZNK4sead15RuntimeTypeInfo6DeriveIN4ksys4phys14MotionAccessorEE9isDerivedEPKNS0_9InterfaceE
|
0x0000007100f970d0,O,000140,_ZNK4sead15RuntimeTypeInfo6DeriveIN4ksys4phys14MotionAccessorEE9isDerivedEPKNS0_9InterfaceE
|
||||||
0x0000007100f9715c,U,000004,j__ZN4ksys4phys16RigidBodyFactory9createBoxEPNS0_18RigidBodyParamViewEPN4sead4HeapE
|
0x0000007100f9715c,U,000004,j__ZN4ksys4phys16RigidBodyFactory9createBoxEPNS0_18RigidBodyParamViewEPN4sead4HeapE
|
||||||
0x0000007100f97160,U,000084,
|
0x0000007100f97160,U,000084,
|
||||||
|
@ -83333,7 +83333,7 @@ Address,Quality,Size,Name
|
||||||
0x0000007100f9f34c,O,003092,_ZN4ksys4phys14RigidBodyParam4InfoC1Ev
|
0x0000007100f9f34c,O,003092,_ZN4ksys4phys14RigidBodyParam4InfoC1Ev
|
||||||
0x0000007100f9ff60,O,000344,_ZN4ksys4phys14RigidBodyParam5parseERKN3agl3utl16ResParameterListEPN4sead4HeapE
|
0x0000007100f9ff60,O,000344,_ZN4ksys4phys14RigidBodyParam5parseERKN3agl3utl16ResParameterListEPN4sead4HeapE
|
||||||
0x0000007100fa00b8,U,003684,ksys::phys::RigidBodyParam::createRigidBody
|
0x0000007100fa00b8,U,003684,ksys::phys::RigidBodyParam::createRigidBody
|
||||||
0x0000007100fa0f1c,U,000308,ksys::phys::RigidBodyParam::getParams
|
0x0000007100fa0f1c,O,000308,_ZNK4ksys4phys14RigidBodyParam17makeInstanceParamEPNS0_22RigidBodyInstanceParamE
|
||||||
0x0000007100fa1050,U,000296,ksys::phys::RigidBodyParam::createEntityShape
|
0x0000007100fa1050,U,000296,ksys::phys::RigidBodyParam::createEntityShape
|
||||||
0x0000007100fa1178,O,000028,_ZNK4ksys4phys14RigidBodyParam15getContactLayerEv
|
0x0000007100fa1178,O,000028,_ZNK4ksys4phys14RigidBodyParam15getContactLayerEv
|
||||||
0x0000007100fa1194,O,000028,_ZNK4ksys4phys14RigidBodyParam12getGroundHitEv
|
0x0000007100fa1194,O,000028,_ZNK4ksys4phys14RigidBodyParam12getGroundHitEv
|
||||||
|
@ -83897,7 +83897,7 @@ Address,Quality,Size,Name
|
||||||
0x0000007100fbaddc,U,000256,
|
0x0000007100fbaddc,U,000256,
|
||||||
0x0000007100fbaedc,O,000060,_ZNK4ksys4phys11InstanceSet14sub_7100FBAEDCEii
|
0x0000007100fbaedc,O,000060,_ZNK4ksys4phys11InstanceSet14sub_7100FBAEDCEii
|
||||||
0x0000007100fbaf18,U,000244,
|
0x0000007100fbaf18,U,000244,
|
||||||
0x0000007100fbb00c,M,000384,_ZN4ksys4phys11InstanceSet14sub_7100FBB00CEPNS0_9RigidBodyEPNS0_14RigidBodyParamE
|
0x0000007100fbb00c,O,000384,_ZN4ksys4phys11InstanceSet14sub_7100FBB00CEPNS0_9RigidBodyEPNS0_14RigidBodyParamE
|
||||||
0x0000007100fbb18c,U,000272,
|
0x0000007100fbb18c,U,000272,
|
||||||
0x0000007100fbb29c,U,000216,
|
0x0000007100fbb29c,U,000216,
|
||||||
0x0000007100fbb374,U,000172,
|
0x0000007100fbb374,U,000172,
|
||||||
|
|
Can't render this file because it is too large.
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
|
||||||
|
|
||||||
namespace ksys::phys {
|
namespace ksys::phys {
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <prim/seadTypedBitFlag.h>
|
#include <prim/seadTypedBitFlag.h>
|
||||||
#include <thread/seadAtomic.h>
|
#include <thread/seadAtomic.h>
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
|
||||||
#include "KingSystem/Physics/System/physDefines.h"
|
#include "KingSystem/Physics/System/physDefines.h"
|
||||||
#include "KingSystem/Physics/System/physMaterialMask.h"
|
#include "KingSystem/Physics/System/physMaterialMask.h"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
|
||||||
|
|
||||||
namespace ksys::phys {
|
namespace ksys::phys {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
|
||||||
|
|
||||||
namespace ksys::phys {
|
namespace ksys::phys {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
|
||||||
|
|
||||||
namespace ksys::phys {
|
namespace ksys::phys {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
|
||||||
#include <Havok/Physics2012/Dynamics/Collide/hkpResponseModifier.h>
|
#include <Havok/Physics2012/Dynamics/Collide/hkpResponseModifier.h>
|
||||||
#include <Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h>
|
#include <Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h>
|
||||||
|
#include "KingSystem/Physics/RigidBody/physMotionAccessor.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyMotion.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyMotionProxy.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
|
||||||
#include "KingSystem/Physics/System/physMemSystem.h"
|
#include "KingSystem/Physics/System/physMemSystem.h"
|
||||||
|
#include "KingSystem/Physics/physConversions.h"
|
||||||
|
|
||||||
namespace ksys::phys {
|
namespace ksys::phys {
|
||||||
|
|
||||||
|
@ -26,6 +31,52 @@ RigidBody::RigidBody(Type type, u32 mass_scaling, hkpRigidBody* hk_body,
|
||||||
mFlags.set(Flag::_100);
|
mFlags.set(Flag::_100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RigidBody::~RigidBody() {
|
||||||
|
if (mType != Type::_0 && mType != Type::TerrainHeightField &&
|
||||||
|
mType != Type::CharacterController) {
|
||||||
|
mHkBody->setName(nullptr);
|
||||||
|
mHkBody->deallocateInternalArrays();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mMotionAccessor) {
|
||||||
|
delete mMotionAccessor;
|
||||||
|
mMotionAccessor = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
struct RigidBodyDynamicInstanceParam : RigidBodyInstanceParam {};
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
bool RigidBody::initMotionAccessorForDynamicMotion(sead::Heap* heap) {
|
||||||
|
if (isMassScaling())
|
||||||
|
mMotionAccessor = new (heap) RigidBodyMotionProxy(this);
|
||||||
|
else
|
||||||
|
mMotionAccessor = new (heap) RigidBodyMotion(this);
|
||||||
|
|
||||||
|
RigidBodyDynamicInstanceParam param;
|
||||||
|
auto* body = getHkBody();
|
||||||
|
param.motion_type = MotionType::Dynamic;
|
||||||
|
param.mass = body->getMass();
|
||||||
|
|
||||||
|
hkMatrix3 inertia;
|
||||||
|
body->getInertiaLocal(inertia);
|
||||||
|
constexpr float MinInertia = 0.001;
|
||||||
|
param.inertia = {sead::Mathf::max(inertia(0, 0), MinInertia),
|
||||||
|
sead::Mathf::max(inertia(1, 1), MinInertia),
|
||||||
|
sead::Mathf::max(inertia(2, 2), MinInertia)};
|
||||||
|
param.center_of_mass = toVec3(body->getCenterOfMassLocal());
|
||||||
|
param.linear_damping = body->getLinearDamping();
|
||||||
|
param.angular_damping = body->getAngularDamping();
|
||||||
|
param.gravity_factor = body->getGravityFactor();
|
||||||
|
param.time_factor = body->getTimeFactor();
|
||||||
|
param.max_linear_velocity = body->getMaxLinearVelocity();
|
||||||
|
param.max_angular_velocity_rad = body->getMaxAngularVelocity();
|
||||||
|
|
||||||
|
mMotionAccessor->init(param, heap);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
sead::SafeString RigidBody::getHkBodyName() const {
|
sead::SafeString RigidBody::getHkBodyName() const {
|
||||||
const char* name = mHkBody->getName();
|
const char* name = mHkBody->getName();
|
||||||
if (!name)
|
if (!name)
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include <thread/seadAtomic.h>
|
#include <thread/seadAtomic.h>
|
||||||
#include <thread/seadCriticalSection.h>
|
#include <thread/seadCriticalSection.h>
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBodyAccessor.h"
|
#include "KingSystem/Physics/RigidBody/physRigidBodyAccessor.h"
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
|
|
||||||
#include "KingSystem/Physics/System/physDefines.h"
|
#include "KingSystem/Physics/System/physDefines.h"
|
||||||
#include "KingSystem/Utils/Types.h"
|
#include "KingSystem/Utils/Types.h"
|
||||||
|
|
||||||
|
@ -20,13 +19,14 @@ class hkpMotion;
|
||||||
namespace ksys::phys {
|
namespace ksys::phys {
|
||||||
|
|
||||||
class MotionAccessor;
|
class MotionAccessor;
|
||||||
|
struct RigidBodyInstanceParam;
|
||||||
class RigidBodyMotion;
|
class RigidBodyMotion;
|
||||||
class RigidContactPoints;
|
class RigidContactPoints;
|
||||||
class UserTag;
|
class UserTag;
|
||||||
|
|
||||||
class RigidBase {
|
class RigidBase {
|
||||||
public:
|
public:
|
||||||
virtual ~RigidBase() = 0;
|
virtual ~RigidBase() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RigidBody : public sead::IDisposer, public RigidBase {
|
class RigidBody : public sead::IDisposer, public RigidBase {
|
||||||
|
@ -107,9 +107,9 @@ public:
|
||||||
virtual const char* getName();
|
virtual const char* getName();
|
||||||
|
|
||||||
// 0x0000007100f8ca50
|
// 0x0000007100f8ca50
|
||||||
bool initMotionAccessor(sead::Heap* heap);
|
bool initMotionAccessorForDynamicMotion(sead::Heap* heap);
|
||||||
// 0x0000007100f8cc98
|
// 0x0000007100f8cc98
|
||||||
void initMotionAndAccessor();
|
void initMotionAccessor();
|
||||||
// 0x0000007100f8cd44
|
// 0x0000007100f8cd44
|
||||||
void initMotion(hkpMotion* motion, MotionType motion_type,
|
void initMotion(hkpMotion* motion, MotionType motion_type,
|
||||||
const RigidBodyInstanceParam& params);
|
const RigidBodyInstanceParam& params);
|
||||||
|
@ -182,7 +182,7 @@ public:
|
||||||
void setCollideWater(bool);
|
void setCollideWater(bool);
|
||||||
void sub_7100F8F51C();
|
void sub_7100F8F51C();
|
||||||
void sub_7100F8F8CC(ContactLayer, GroundHit, void*);
|
void sub_7100F8F8CC(ContactLayer, GroundHit, void*);
|
||||||
void sub_7100F8F9E8(u32*, void*);
|
void sub_7100F8F9E8(ReceiverMask*, void*);
|
||||||
void sub_7100F8FA44(ContactLayer, u32);
|
void sub_7100F8FA44(ContactLayer, u32);
|
||||||
hkpMotion* getMotion() const;
|
hkpMotion* getMotion() const;
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <prim/seadSafeString.h>
|
#include <prim/seadSafeString.h>
|
||||||
#include <prim/seadScopedLock.h>
|
#include <prim/seadScopedLock.h>
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBodyMotionProxy.h"
|
#include "KingSystem/Physics/RigidBody/physRigidBodyMotionProxy.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
|
||||||
#include "KingSystem/Physics/physConversions.h"
|
#include "KingSystem/Physics/physConversions.h"
|
||||||
#include "KingSystem/Utils/Debug.h"
|
#include "KingSystem/Utils/Debug.h"
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include <Havok/Common/Base/hkBase.h>
|
#include <Havok/Common/Base/hkBase.h>
|
||||||
#include <Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h>
|
#include <Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h>
|
||||||
#include "KingSystem/Physics/RigidBody/physRigidBodyMotion.h"
|
#include "KingSystem/Physics/RigidBody/physRigidBodyMotion.h"
|
||||||
|
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
|
||||||
#include "KingSystem/Physics/physConversions.h"
|
#include "KingSystem/Physics/physConversions.h"
|
||||||
|
|
||||||
namespace ksys::phys {
|
namespace ksys::phys {
|
||||||
|
|
|
@ -66,6 +66,36 @@ bool RigidBodyParam::parse(const agl::utl::ResParameterList& res_list, sead::Hea
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RigidBodyParam::makeInstanceParam(RigidBodyInstanceParam* param) const {
|
||||||
|
param->mass = *info.mass;
|
||||||
|
param->name = info.rigid_body_name->cstr();
|
||||||
|
param->inertia = *info.inertia;
|
||||||
|
param->center_of_mass = *info.center_of_mass;
|
||||||
|
param->max_linear_velocity = *info.max_linear_velocity;
|
||||||
|
param->max_angular_velocity_rad = *info.max_angular_velocity_rad;
|
||||||
|
param->toi = *info.toi;
|
||||||
|
param->motion_type = getMotionType();
|
||||||
|
param->linear_damping = *info.linear_damping;
|
||||||
|
param->angular_damping = *info.angular_damping;
|
||||||
|
param->max_impulse = *info.max_impulse;
|
||||||
|
param->col_impulse_scale = *info.col_impulse_scale;
|
||||||
|
param->ignore_normal_for_impulse = *info.ignore_normal_for_impulse;
|
||||||
|
param->always_character_mass_scaling = *info.always_character_mass_scaling;
|
||||||
|
param->friction_scale = *info.friction_scale;
|
||||||
|
param->restitution_scale = *info.restitution_scale;
|
||||||
|
param->water_buoyancy_scale = *info.water_buoyancy_scale;
|
||||||
|
param->water_flow_effective_rate = *info.water_flow_effective_rate;
|
||||||
|
param->magne_mass_scaling_factor = *info.magne_mass_scaling_factor;
|
||||||
|
param->contact_layer = getContactLayer();
|
||||||
|
param->groundhit = getGroundHit();
|
||||||
|
param->groundhit_mask = info.ground_hit_mask;
|
||||||
|
param->contact_mask = *info.contact_mask;
|
||||||
|
param->no_hit_ground = *info.no_hit_ground;
|
||||||
|
param->no_hit_water = *info.no_hit_water;
|
||||||
|
param->no_char_standing_on = *info.no_char_standing_on;
|
||||||
|
receiverMaskGetSensorLayerMaskForType(¶m->receiver_mask, *info.receiver_type);
|
||||||
|
}
|
||||||
|
|
||||||
ContactLayer RigidBodyParam::getContactLayer() const {
|
ContactLayer RigidBodyParam::getContactLayer() const {
|
||||||
return contactLayerFromText(*info.layer);
|
return contactLayerFromText(*info.layer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
sead::Vector3f center_of_mass = sead::Vector3f::zero;
|
sead::Vector3f center_of_mass = sead::Vector3f::zero;
|
||||||
float linear_damping = 0.0f;
|
float linear_damping = 0.0f;
|
||||||
float angular_damping = 0.05f;
|
float angular_damping = 0.05f;
|
||||||
f32 _3c = 1.0f;
|
f32 gravity_factor = 1.0f;
|
||||||
f32 time_factor = 1.0f;
|
f32 time_factor = 1.0f;
|
||||||
float max_linear_velocity = 200.0f;
|
float max_linear_velocity = 200.0f;
|
||||||
float max_angular_velocity_rad = 200.0f;
|
float max_angular_velocity_rad = 200.0f;
|
||||||
|
@ -74,20 +74,21 @@ public:
|
||||||
void* p = nullptr;
|
void* p = nullptr;
|
||||||
ContactLayer contact_layer = ContactLayer::EntityObject;
|
ContactLayer contact_layer = ContactLayer::EntityObject;
|
||||||
GroundHit groundhit = GroundHit::HitAll;
|
GroundHit groundhit = GroundHit::HitAll;
|
||||||
u32 info_5e0 = 0;
|
u32 groundhit_mask = 0;
|
||||||
u32 contact_mask = 0;
|
u32 contact_mask = 0;
|
||||||
u32 flags = 0x80000000;
|
ReceiverMask receiver_mask;
|
||||||
bool ignore_normal_for_impulse = false;
|
bool ignore_normal_for_impulse = false;
|
||||||
bool no_hit_ground = false;
|
bool no_hit_ground = false;
|
||||||
bool no_hit_water = false;
|
bool no_hit_water = false;
|
||||||
bool no_char_standing_on = false;
|
bool no_char_standing_on = false;
|
||||||
|
bool _90 = false;
|
||||||
|
|
||||||
bool isDynamicSensor() const {
|
bool isDynamicSensor() const {
|
||||||
return getContactLayerType(contact_layer) == ContactLayerType::Sensor &&
|
return getContactLayerType(contact_layer) == ContactLayerType::Sensor &&
|
||||||
motion_type == MotionType::Dynamic;
|
motion_type == MotionType::Dynamic;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
KSYS_CHECK_SIZE_NX150(RigidBodyInstanceParam, 0x90);
|
KSYS_CHECK_SIZE_NX150(RigidBodyInstanceParam, 0x98);
|
||||||
|
|
||||||
struct RigidBodyParam : agl::utl::ParameterList {
|
struct RigidBodyParam : agl::utl::ParameterList {
|
||||||
struct Info : agl::utl::ParameterObj {
|
struct Info : agl::utl::ParameterObj {
|
||||||
|
@ -152,7 +153,7 @@ struct RigidBodyParam : agl::utl::ParameterList {
|
||||||
|
|
||||||
// TODO: types and names
|
// TODO: types and names
|
||||||
void* createRigidBody(void* x, sead::Heap* heap, bool y);
|
void* createRigidBody(void* x, sead::Heap* heap, bool y);
|
||||||
bool getParams(RigidBodyInstanceParam* params) const;
|
void makeInstanceParam(RigidBodyInstanceParam* param) const;
|
||||||
void* createEntityShape(void* x, void* y, sead::Heap* heap);
|
void* createEntityShape(void* x, void* y, sead::Heap* heap);
|
||||||
|
|
||||||
ContactLayer getContactLayer() const;
|
ContactLayer getContactLayer() const;
|
||||||
|
|
|
@ -122,17 +122,16 @@ void* InstanceSet::sub_7100FBAEDC(s32 idx1, s32 idx2) const {
|
||||||
return mRigidBodySets[idx1]->getRigidBody(idx2);
|
return mRigidBodySets[idx1]->getRigidBody(idx2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// NON_MATCHING
|
|
||||||
void InstanceSet::sub_7100FBB00C(phys::RigidBody* body, phys::RigidBodyParam* param) {
|
void InstanceSet::sub_7100FBB00C(phys::RigidBody* body, phys::RigidBodyParam* param) {
|
||||||
if (body == nullptr)
|
if (body == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
phys::RigidBodyInstanceParam instance_params;
|
phys::RigidBodyInstanceParam instance_params;
|
||||||
param->getParams(&instance_params);
|
param->makeInstanceParam(&instance_params);
|
||||||
if (instance_params.contact_layer == phys::ContactLayer::SensorCustomReceiver) {
|
if (instance_params.contact_layer == phys::ContactLayer::SensorCustomReceiver) {
|
||||||
body->sub_7100F8F9E8(&instance_params.flags, _188[body->isMassScaling()]);
|
body->sub_7100F8F9E8(&instance_params.receiver_mask, _188[body->isMassScaling()]);
|
||||||
} else if (instance_params.info_5e0) {
|
} else if (instance_params.groundhit_mask) {
|
||||||
body->sub_7100F8FA44(instance_params.contact_layer, instance_params.info_5e0);
|
body->sub_7100F8FA44(instance_params.contact_layer, instance_params.groundhit_mask);
|
||||||
} else {
|
} else {
|
||||||
body->sub_7100F8F8CC(instance_params.contact_layer, instance_params.groundhit,
|
body->sub_7100F8F8CC(instance_params.contact_layer, instance_params.groundhit,
|
||||||
_188[body->isMassScaling()]);
|
_188[body->isMassScaling()]);
|
||||||
|
|
Loading…
Reference in New Issue