mirror of https://github.com/zeldaret/botw.git
ksys/phys: Merge RigidBodyFactory into RigidBodyFromShape
RigidBodyFactory is right between RigidBodyFromResource and RigidBodyFromShape functions, and some Factory functions are known to be in the same TU as RigidBodyFromShape functions. Some factory functions also use FromShape non-static member functions.
This commit is contained in:
parent
56826a9bd0
commit
6727376291
|
|
@ -83272,14 +83272,14 @@ Address,Quality,Size,Name
|
|||
0x0000007100f99050,O,000008,_ZN4ksys4phys21RigidBodyFromResource9getVolumeEv
|
||||
0x0000007100f99058,O,000204,_ZNK4ksys4phys21RigidBodyFromResource27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
|
||||
0x0000007100f99124,O,000092,_ZNK4ksys4phys21RigidBodyFromResource18getRuntimeTypeInfoEv
|
||||
0x0000007100f99180,O,000188,_ZN4ksys4phys16RigidBodyFactory12createSphereEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f9923c,O,000188,_ZN4ksys4phys16RigidBodyFactory13createCapsuleEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f992f8,O,000188,_ZN4ksys4phys16RigidBodyFactory14createCylinderEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f993b4,O,000188,_ZN4ksys4phys16RigidBodyFactory19createCylinderWaterEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f99470,O,000188,_ZN4ksys4phys16RigidBodyFactory9createBoxEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f9952c,O,000188,_ZN4ksys4phys16RigidBodyFactory14createBoxWaterEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f995e8,O,000188,_ZN4ksys4phys16RigidBodyFactory14createPolytopeEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f996a4,O,000188,_ZN4ksys4phys16RigidBodyFactory10createListEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f99180,O,000188,_ZN4ksys4phys18RigidBodyFromShape12createSphereEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f9923c,O,000188,_ZN4ksys4phys18RigidBodyFromShape13createCapsuleEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f992f8,O,000188,_ZN4ksys4phys18RigidBodyFromShape14createCylinderEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f993b4,O,000188,_ZN4ksys4phys18RigidBodyFromShape19createCylinderWaterEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f99470,O,000188,_ZN4ksys4phys18RigidBodyFromShape9createBoxEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f9952c,O,000188,_ZN4ksys4phys18RigidBodyFromShape14createBoxWaterEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f995e8,O,000188,_ZN4ksys4phys18RigidBodyFromShape14createPolytopeEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f996a4,O,000188,_ZN4ksys4phys18RigidBodyFromShape10createListEPNS0_22RigidBodyInstanceParamEPN4sead4HeapE
|
||||
0x0000007100f99760,U,000264,
|
||||
0x0000007100f99868,U,000036,
|
||||
0x0000007100f9988c,U,000652,
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -21,8 +21,6 @@ target_sources(uking PRIVATE
|
|||
RigidBody/physRigidBody.h
|
||||
RigidBody/physRigidBodyAccessor.cpp
|
||||
RigidBody/physRigidBodyAccessor.h
|
||||
RigidBody/physRigidBodyFactory.cpp
|
||||
RigidBody/physRigidBodyFactory.h
|
||||
RigidBody/physRigidBodyFromResource.cpp
|
||||
RigidBody/physRigidBodyFromResource.h
|
||||
RigidBody/physRigidBodyFromShape.cpp
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
#include "KingSystem/Physics/RigidBody/Shape/Box/physBoxRigidBody.h"
|
||||
#include <Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h>
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Box/physBoxShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/physRigidBodyFactory.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
BoxRigidBody* BoxRigidBody::make(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
return RigidBodyFactory::createBox(param, heap);
|
||||
return createBox(param, heap);
|
||||
}
|
||||
|
||||
BoxRigidBody::BoxRigidBody(hkpRigidBody* hk_body, BoxShape* shape, ContactLayerType layer_type,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
#include "KingSystem/Physics/RigidBody/Shape/BoxWater/physBoxWaterRigidBody.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/BoxWater/physBoxWaterShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/physRigidBodyFactory.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
BoxWaterRigidBody* BoxWaterRigidBody::make(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
return RigidBodyFactory::createBoxWater(param, heap);
|
||||
return createBoxWater(param, heap);
|
||||
}
|
||||
|
||||
BoxWaterRigidBody::BoxWaterRigidBody(hkpRigidBody* hk_body, BoxWaterShape* shape,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
#include "KingSystem/Physics/RigidBody/Shape/Capsule/physCapsuleRigidBody.h"
|
||||
#include <Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h>
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Capsule/physCapsuleShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/physRigidBodyFactory.h"
|
||||
#include "KingSystem/Utils/SafeDelete.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
CapsuleRigidBody* CapsuleRigidBody::make(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
return RigidBodyFactory::createCapsule(param, heap);
|
||||
return createCapsule(param, heap);
|
||||
}
|
||||
|
||||
CapsuleRigidBody::CapsuleRigidBody(hkpRigidBody* hk_body, CapsuleShape* shape,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
#include "KingSystem/Physics/RigidBody/Shape/Cylinder/physCylinderRigidBody.h"
|
||||
#include <Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h>
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Cylinder/physCylinderShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/physRigidBodyFactory.h"
|
||||
#include "KingSystem/Utils/SafeDelete.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
CylinderRigidBody* CylinderRigidBody::make(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
return RigidBodyFactory::createCylinder(param, heap);
|
||||
return createCylinder(param, heap);
|
||||
}
|
||||
|
||||
CylinderRigidBody::CylinderRigidBody(hkpRigidBody* hk_body, CylinderShape* shape,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
#include "KingSystem/Physics/RigidBody/Shape/CylinderWater/physCylinderWaterRigidBody.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/CylinderWater/physCylinderWaterShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/physRigidBodyFactory.h"
|
||||
#include "KingSystem/Utils/SafeDelete.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
CylinderWaterRigidBody* CylinderWaterRigidBody::make(RigidBodyInstanceParam* param,
|
||||
sead::Heap* heap) {
|
||||
return RigidBodyFactory::createCylinderWater(param, heap);
|
||||
return createCylinderWater(param, heap);
|
||||
}
|
||||
|
||||
CylinderWaterRigidBody::CylinderWaterRigidBody(hkpRigidBody* hk_body, CylinderWaterShape* shape,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
#include "KingSystem/Physics/RigidBody/Shape/List/physListShapeRigidBody.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/List/physListShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/physRigidBodyFactory.h"
|
||||
#include "KingSystem/Utils/SafeDelete.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
ListShapeRigidBody* ListShapeRigidBody::make(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
return RigidBodyFactory::createList(param, heap);
|
||||
return createList(param, heap);
|
||||
}
|
||||
|
||||
ListShapeRigidBody::ListShapeRigidBody(hkpRigidBody* hk_body, ListShape* shape,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
#include "KingSystem/Physics/RigidBody/Shape/Polytope/physPolytopeRigidBody.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Polytope/physPolytopeShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/physRigidBodyFactory.h"
|
||||
#include "KingSystem/Utils/SafeDelete.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
PolytopeRigidBody* PolytopeRigidBody::make(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
return RigidBodyFactory::createPolytope(param, heap);
|
||||
return createPolytope(param, heap);
|
||||
}
|
||||
|
||||
PolytopeRigidBody::PolytopeRigidBody(hkpRigidBody* hk_body, PolytopeShape* shape,
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
#include "KingSystem/Physics/RigidBody/physRigidBodyFactory.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Box/physBoxShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/BoxWater/physBoxWaterShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Capsule/physCapsuleRigidBody.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Capsule/physCapsuleShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Cylinder/physCylinderRigidBody.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Cylinder/physCylinderShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/CylinderWater/physCylinderWaterRigidBody.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/CylinderWater/physCylinderWaterShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/List/physListShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Polytope/physPolytopeShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Sphere/physSphereShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/physRigidBodyFromShape.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
template <typename RigidBodyType, typename ShapeType, typename ParamType>
|
||||
static RigidBodyType* createRigidBody(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
if (param->isDynamicSensor())
|
||||
param->motion_type = MotionType::Keyframed;
|
||||
|
||||
auto* v = sead::DynamicCast<ParamType>(param);
|
||||
auto* shape = ShapeType::make(*v, heap);
|
||||
return RigidBodyFromShape::make<RigidBodyType, ShapeType>(shape, true, *param, heap);
|
||||
}
|
||||
|
||||
SphereRigidBody* RigidBodyFactory::createSphere(RigidBodyInstanceParam* params, sead::Heap* heap) {
|
||||
return createRigidBody<SphereRigidBody, SphereShape, SphereParam>(params, heap);
|
||||
}
|
||||
|
||||
CapsuleRigidBody* RigidBodyFactory::createCapsule(RigidBodyInstanceParam* params,
|
||||
sead::Heap* heap) {
|
||||
return createRigidBody<CapsuleRigidBody, CapsuleShape, CapsuleParam>(params, heap);
|
||||
}
|
||||
|
||||
CylinderRigidBody* RigidBodyFactory::createCylinder(RigidBodyInstanceParam* params,
|
||||
sead::Heap* heap) {
|
||||
return createRigidBody<CylinderRigidBody, CylinderShape, CylinderParam>(params, heap);
|
||||
}
|
||||
|
||||
CylinderWaterRigidBody* RigidBodyFactory::createCylinderWater(RigidBodyInstanceParam* params,
|
||||
sead::Heap* heap) {
|
||||
return createRigidBody<CylinderWaterRigidBody, CylinderWaterShape, CylinderParam>(params, heap);
|
||||
}
|
||||
|
||||
BoxRigidBody* RigidBodyFactory::createBox(RigidBodyInstanceParam* params, sead::Heap* heap) {
|
||||
return createRigidBody<BoxRigidBody, BoxShape, BoxParam>(params, heap);
|
||||
}
|
||||
|
||||
BoxWaterRigidBody* RigidBodyFactory::createBoxWater(RigidBodyInstanceParam* params,
|
||||
sead::Heap* heap) {
|
||||
return createRigidBody<BoxWaterRigidBody, BoxWaterShape, BoxParam>(params, heap);
|
||||
}
|
||||
|
||||
PolytopeRigidBody* RigidBodyFactory::createPolytope(RigidBodyInstanceParam* params,
|
||||
sead::Heap* heap) {
|
||||
return createRigidBody<PolytopeRigidBody, PolytopeShape, PolytopeParam>(params, heap);
|
||||
}
|
||||
|
||||
ListShapeRigidBody* RigidBodyFactory::createList(RigidBodyInstanceParam* params, sead::Heap* heap) {
|
||||
return createRigidBody<ListShapeRigidBody, ListShape, ListShapeRigidBodyParam>(params, heap);
|
||||
}
|
||||
|
||||
} // namespace ksys::phys
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <basis/seadTypes.h>
|
||||
|
||||
namespace sead {
|
||||
class Heap;
|
||||
} // namespace sead
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
class BoxRigidBody;
|
||||
class BoxWaterRigidBody;
|
||||
class CapsuleRigidBody;
|
||||
class CylinderRigidBody;
|
||||
class CylinderWaterRigidBody;
|
||||
class ListShapeRigidBody;
|
||||
class PolytopeRigidBody;
|
||||
class RigidBody;
|
||||
struct RigidBodyInstanceParam;
|
||||
class SphereRigidBody;
|
||||
|
||||
class RigidBodyFactory {
|
||||
public:
|
||||
static SphereRigidBody* createSphere(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static CapsuleRigidBody* createCapsule(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static CylinderRigidBody* createCylinder(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static CylinderWaterRigidBody* createCylinderWater(RigidBodyInstanceParam* params,
|
||||
sead::Heap* heap);
|
||||
static BoxRigidBody* createBox(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static BoxWaterRigidBody* createBoxWater(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static PolytopeRigidBody* createPolytope(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
static ListShapeRigidBody* createList(RigidBodyInstanceParam* params, sead::Heap* heap);
|
||||
};
|
||||
|
||||
} // namespace ksys::phys
|
||||
|
|
@ -25,6 +25,44 @@
|
|||
|
||||
namespace ksys::phys {
|
||||
|
||||
SphereRigidBody* RigidBodyFromShape::createSphere(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
return make<SphereRigidBody, SphereShape, SphereParam>(param, heap);
|
||||
}
|
||||
|
||||
CapsuleRigidBody* RigidBodyFromShape::createCapsule(RigidBodyInstanceParam* param,
|
||||
sead::Heap* heap) {
|
||||
return make<CapsuleRigidBody, CapsuleShape, CapsuleParam>(param, heap);
|
||||
}
|
||||
|
||||
CylinderRigidBody* RigidBodyFromShape::createCylinder(RigidBodyInstanceParam* param,
|
||||
sead::Heap* heap) {
|
||||
return make<CylinderRigidBody, CylinderShape, CylinderParam>(param, heap);
|
||||
}
|
||||
|
||||
CylinderWaterRigidBody* RigidBodyFromShape::createCylinderWater(RigidBodyInstanceParam* param,
|
||||
sead::Heap* heap) {
|
||||
return make<CylinderWaterRigidBody, CylinderWaterShape, CylinderParam>(param, heap);
|
||||
}
|
||||
|
||||
BoxRigidBody* RigidBodyFromShape::createBox(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
return make<BoxRigidBody, BoxShape, BoxParam>(param, heap);
|
||||
}
|
||||
|
||||
BoxWaterRigidBody* RigidBodyFromShape::createBoxWater(RigidBodyInstanceParam* param,
|
||||
sead::Heap* heap) {
|
||||
return make<BoxWaterRigidBody, BoxWaterShape, BoxParam>(param, heap);
|
||||
}
|
||||
|
||||
PolytopeRigidBody* RigidBodyFromShape::createPolytope(RigidBodyInstanceParam* param,
|
||||
sead::Heap* heap) {
|
||||
return make<PolytopeRigidBody, PolytopeShape, PolytopeParam>(param, heap);
|
||||
}
|
||||
|
||||
ListShapeRigidBody* RigidBodyFromShape::createList(RigidBodyInstanceParam* param,
|
||||
sead::Heap* heap) {
|
||||
return make<ListShapeRigidBody, ListShape, ListShapeRigidBodyParam>(param, heap);
|
||||
}
|
||||
|
||||
RigidBodyFromShape::RigidBodyFromShape(hkpRigidBody* hkp_rigid_body, ContactLayerType layer_type,
|
||||
const sead::SafeString& name, bool set_flag_10,
|
||||
sead::Heap* heap)
|
||||
|
|
@ -92,6 +130,16 @@ float RigidBodyFromShape::updateScale_(float scale, float old_scale) {
|
|||
return scale;
|
||||
}
|
||||
|
||||
template <typename RigidBodyT, typename ShapeT, typename ParamType>
|
||||
RigidBodyT* RigidBodyFromShape::make(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
||||
if (param->isDynamicSensor())
|
||||
param->motion_type = MotionType::Keyframed;
|
||||
|
||||
auto* v = sead::DynamicCast<ParamType>(param);
|
||||
auto* shape = ShapeT::make(*v, heap);
|
||||
return make<RigidBodyT>(shape, true, *param, heap);
|
||||
}
|
||||
|
||||
template <typename RigidBodyT, typename ShapeT>
|
||||
RigidBodyT* RigidBodyFromShape::make(ShapeT* shape, bool set_flag_10,
|
||||
const RigidBodyInstanceParam& param, sead::Heap* heap) {
|
||||
|
|
@ -179,37 +227,4 @@ RigidBodyT* RigidBodyFromShape::make(ShapeT* shape, bool set_flag_10,
|
|||
return static_cast<RigidBodyT*>(body);
|
||||
}
|
||||
|
||||
template SphereRigidBody* RigidBodyFromShape::make(SphereShape* shape, bool set_flag_10,
|
||||
const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
|
||||
template CapsuleRigidBody* RigidBodyFromShape::make(CapsuleShape* shape, bool set_flag_10,
|
||||
const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
|
||||
template CylinderRigidBody* RigidBodyFromShape::make(CylinderShape* shape, bool set_flag_10,
|
||||
const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
|
||||
template CylinderWaterRigidBody* RigidBodyFromShape::make(CylinderWaterShape* shape,
|
||||
bool set_flag_10,
|
||||
const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
|
||||
template BoxRigidBody* RigidBodyFromShape::make(BoxShape* shape, bool set_flag_10,
|
||||
const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
|
||||
template BoxWaterRigidBody* RigidBodyFromShape::make(BoxWaterShape* shape, bool set_flag_10,
|
||||
const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
|
||||
template PolytopeRigidBody* RigidBodyFromShape::make(PolytopeShape* shape, bool set_flag_10,
|
||||
const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
|
||||
template ListShapeRigidBody* RigidBodyFromShape::make(ListShape* shape, bool set_flag_10,
|
||||
const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
|
||||
} // namespace ksys::phys
|
||||
|
|
|
|||
|
|
@ -6,15 +6,29 @@ namespace ksys::phys {
|
|||
|
||||
class MaterialMask;
|
||||
class Shape;
|
||||
struct RigidBodyInstanceParam;
|
||||
|
||||
class BoxRigidBody;
|
||||
class BoxWaterRigidBody;
|
||||
class CapsuleRigidBody;
|
||||
class CylinderRigidBody;
|
||||
class CylinderWaterRigidBody;
|
||||
class ListShapeRigidBody;
|
||||
class PolytopeRigidBody;
|
||||
class SphereRigidBody;
|
||||
|
||||
class RigidBodyFromShape : public RigidBody {
|
||||
SEAD_RTTI_OVERRIDE(RigidBodyFromShape, RigidBody)
|
||||
public:
|
||||
/// Create a RigidBodyFromShape with the specified shape and rigid body parameters.
|
||||
/// @param shape Must not be null.
|
||||
template <typename RigidBodyT, typename ShapeT>
|
||||
static RigidBodyT* make(ShapeT* shape, bool set_flag_10, const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
static SphereRigidBody* createSphere(RigidBodyInstanceParam* param, sead::Heap* heap);
|
||||
static CapsuleRigidBody* createCapsule(RigidBodyInstanceParam* param, sead::Heap* heap);
|
||||
static CylinderRigidBody* createCylinder(RigidBodyInstanceParam* param, sead::Heap* heap);
|
||||
static CylinderWaterRigidBody* createCylinderWater(RigidBodyInstanceParam* param,
|
||||
sead::Heap* heap);
|
||||
static BoxRigidBody* createBox(RigidBodyInstanceParam* param, sead::Heap* heap);
|
||||
static BoxWaterRigidBody* createBoxWater(RigidBodyInstanceParam* param, sead::Heap* heap);
|
||||
static PolytopeRigidBody* createPolytope(RigidBodyInstanceParam* param, sead::Heap* heap);
|
||||
static ListShapeRigidBody* createList(RigidBodyInstanceParam* param, sead::Heap* heap);
|
||||
|
||||
RigidBodyFromShape(hkpRigidBody* hkp_rigid_body, ContactLayerType layer_type,
|
||||
const sead::SafeString& name, bool set_flag_10, sead::Heap* heap);
|
||||
|
|
@ -28,6 +42,18 @@ protected:
|
|||
|
||||
virtual Shape* getShape_() = 0;
|
||||
virtual const Shape* getShape_() const = 0;
|
||||
|
||||
private:
|
||||
/// Create a RigidBodyFromShape with the specified rigid body parameters.
|
||||
/// @param param Must be an instance of ParamT.
|
||||
template <typename RigidBodyT, typename ShapeT, typename ParamT>
|
||||
static inline RigidBodyT* make(RigidBodyInstanceParam* param, sead::Heap* heap);
|
||||
|
||||
/// Create a RigidBodyFromShape with the specified shape and rigid body parameters.
|
||||
/// @param shape Must not be null.
|
||||
template <typename RigidBodyT, typename ShapeT>
|
||||
static RigidBodyT* make(ShapeT* shape, bool set_flag_10, const RigidBodyInstanceParam& param,
|
||||
sead::Heap* heap);
|
||||
};
|
||||
|
||||
} // namespace ksys::phys
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include "KingSystem/Physics/RigidBody/Shape/Sphere/physSphereRigidBody.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/Sphere/physSphereShape.h"
|
||||
#include "KingSystem/Physics/RigidBody/Shape/physShapeParamObj.h"
|
||||
#include "KingSystem/Physics/RigidBody/physRigidBodyFactory.h"
|
||||
#include "KingSystem/Physics/System/physEntityGroupFilter.h"
|
||||
#include "KingSystem/Utils/SafeDelete.h"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue