ksys/phys: Finish BoxShapeParam

This commit is contained in:
Léo Lam
2022-01-31 19:50:44 +01:00
parent 26bd1402f2
commit a8915c9b05
3 changed files with 14 additions and 3 deletions
@@ -36,6 +36,16 @@ BoxShape* BoxShapeParam::createShape(sead::Heap* heap) const {
return new (heap) BoxShape(*this, box, transform_shape);
}
BoxShape* BoxShape::clone(sead::Heap* heap) const {
BoxShapeParam param;
param.extents = mExtents;
param.translate = mTranslate;
param.rotate = mRotate;
auto* cloned = param.createShape(heap);
cloned->setMaterialMask(mMaterialMask);
return cloned;
}
BoxShape::BoxShape(const BoxShapeParam& param, hkpBoxShape* shape,
hkpConvexTransformShape* transform_shape)
: mExtents(param.extents), mTranslate(param.translate), mRotate(param.rotate),
@@ -34,6 +34,7 @@ public:
hkpConvexTransformShape* transform_shape);
~BoxShape() override;
BoxShape* clone(sead::Heap* heap) const;
BoxRigidBody* createBody(bool flag, const RigidBodyInstanceParam& params, sead::Heap* heap);
bool setExtents(const sead::Vector3f& extents);
@@ -66,7 +67,7 @@ struct BoxShapeParam {
sead::Vector3f extents;
sead::Vector3f translate;
sead::Vector3f rotate;
float convex_radius;
float convex_radius = 0.05;
CommonShapeParam common;
};