summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/RigidBody/Shape/BoxWater/physBoxWaterRigidBody.h
blob: 1d281c66d1c0ee55f0dd371fae025c98ca00ba2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include "KingSystem/Physics/RigidBody/physRigidBodyFromShape.h"

namespace ksys::phys {

class BoxWaterShape;

class BoxWaterRigidBody : public RigidBodyFromShape {
    SEAD_RTTI_OVERRIDE(BoxWaterRigidBody, RigidBodyFromShape)
public:
    static BoxWaterRigidBody* make(RigidBodyInstanceParam* param, sead::Heap* heap);

    BoxWaterRigidBody(hkpRigidBody* hk_body, BoxWaterShape* shape, ContactLayerType layer_type,
                      const sead::SafeString& name, bool unused, sead::Heap* heap);
    ~BoxWaterRigidBody() override;

    /// Set the box extents and trigger a shape update.
    void setExtents(const sead::Vector3f& extents);
    /// Set the box translation and trigger a shape update.
    void setTranslate(const sead::Vector3f& translate);

    const sead::Vector3f& getExtents() const;
    const sead::Vector3f& getTranslate() const;

    void setMaterialMask(const MaterialMask& mask);
    const MaterialMask& getMaterialMask() const;

    float getVolume() override;

protected:
    Shape* getShape_() override;
    const Shape* getShape_() const override;
    u32 getCollisionMasks(RigidBody::CollisionMasks* masks, const u32* unk,
                          const sead::Vector3f& contact_point) override;

    BoxWaterShape* mShape;
    u32 _d8{};
};

}  // namespace ksys::phys