mirror of
https://github.com/zeldaret/botw
synced 2026-10-20 16:57:22 -04:00
89322a8d0c
A folder's files are linked before its subfolders, and the rigid body
files are linked as one flat sequence. ListShape is the one file that
does not fit this order.
| Old | New |
|---|---|
| RigidBody/Shape/<Kind>/phys<Kind>Shape.cpp | RigidBody/Shape/phys<Kind>Shape.cpp |
| RigidBody/Shape/<Kind>/phys<Kind>RigidBody.cpp | RigidBody/physRigidBody<Kind>.cpp |
| RigidBody/Shape/List/physListShapeRigidBody.cpp | RigidBody/physRigidBodyListShape.cpp |
| physHavokMemoryAllocator.cpp | System/physHavokMemoryAllocator.cpp |
| StaticCompound/physStaticCompound{,Mgr,RigidBodyGroup,Util}.cpp | System/ |
| StaticCompound/physStaticCompound{Info,Autogen}.cpp | System/physStaticCompoundInfo.cpp |
The original has the type infos' cleanup functions just before
StaticCompoundInfo's functions, so the merged file defines the
reflection data first, with plain static cleanup functions as in
Havok's generated reflection code. Template instantiations would be
emitted after the rest of the file.
(AI assisted using Claude Fable 5.1 and Claude Opus 5.5)
82 lines
3.0 KiB
C++
82 lines
3.0 KiB
C++
#include "KingSystem/Physics/RigidBody/physRigidBodyListShape.h"
|
|
#include "KingSystem/Physics/RigidBody/Shape/physListShape.h"
|
|
#include "KingSystem/Utils/SafeDelete.h"
|
|
|
|
namespace ksys::phys {
|
|
|
|
ListShapeRigidBody* ListShapeRigidBody::make(RigidBodyInstanceParam* param, sead::Heap* heap) {
|
|
return createList(param, heap);
|
|
}
|
|
|
|
ListShapeRigidBody::ListShapeRigidBody(hkpRigidBody* hk_body, ListShape* shape,
|
|
ContactLayerType layer_type, const sead::SafeString& name,
|
|
bool set_flag_10, sead::Heap* heap)
|
|
: RigidBodyFromShape(hk_body, layer_type, name, set_flag_10, heap), mShape(shape) {}
|
|
|
|
ListShapeRigidBody::~ListShapeRigidBody() {
|
|
if (hasFlag(RigidBody::Flag::_10) && mShape) {
|
|
util::safeDelete(mShape);
|
|
}
|
|
}
|
|
|
|
Shape* ListShapeRigidBody::replaceWithNewSphere(int index, const SphereShapeParam& param,
|
|
sead::Heap* heap) {
|
|
return mShape->replaceWithNewSphere(index, param, heap);
|
|
}
|
|
|
|
Shape* ListShapeRigidBody::replaceWithNewCapsule(int index, const CapsuleShapeParam& param,
|
|
sead::Heap* heap) {
|
|
return mShape->replaceWithNewCapsule(index, param, heap);
|
|
}
|
|
|
|
Shape* ListShapeRigidBody::replaceWithNewCylinder(int index, const CylinderShapeParam& param,
|
|
sead::Heap* heap) {
|
|
return mShape->replaceWithNewCylinder(index, param, heap);
|
|
}
|
|
|
|
Shape* ListShapeRigidBody::replaceWithNewBox(int index, const BoxShapeParam& param,
|
|
sead::Heap* heap) {
|
|
return mShape->replaceWithNewBox(index, param, heap);
|
|
}
|
|
|
|
Shape* ListShapeRigidBody::replaceWithNewPolytope(int index, const PolytopeShapeParam& param,
|
|
sead::Heap* heap) {
|
|
return mShape->replaceWithNewPolytope(index, param, heap);
|
|
}
|
|
|
|
Shape* ListShapeRigidBody::replaceWithNewCharacterPrism(int index,
|
|
const CharacterPrismShapeParam& param,
|
|
sead::Heap* heap) {
|
|
return mShape->replaceWithNewCharacterPrism(index, param, heap);
|
|
}
|
|
|
|
void ListShapeRigidBody::setMaterialMask(const MaterialMask& mask, int index) {
|
|
mShape->setMaterialMask(mask, index);
|
|
}
|
|
|
|
const MaterialMask& ListShapeRigidBody::getMaterialMask(int index) const {
|
|
return mShape->getMaterialMask(index);
|
|
}
|
|
|
|
float ListShapeRigidBody::getVolume() {
|
|
return mShape->getVolume();
|
|
}
|
|
|
|
Shape* ListShapeRigidBody::getShape_() {
|
|
return mShape;
|
|
}
|
|
|
|
const Shape* ListShapeRigidBody::getShape_() const {
|
|
return mShape;
|
|
}
|
|
|
|
u32 ListShapeRigidBody::getCollisionMasks(RigidBody::CollisionMasks* masks, const u32* unk,
|
|
const sead::Vector3f& contact_point) {
|
|
masks->ignored_layers = ~mContactMask;
|
|
masks->collision_filter_info = getCollisionFilterInfo();
|
|
masks->material_mask = getMaterialMask(unk != nullptr ? int(*unk) : 0).getRawData();
|
|
return 0;
|
|
}
|
|
|
|
} // namespace ksys::phys
|