| 1 | #include "Util/CollisionShapeFunction.h" |
|---|---|
| 2 | |
| 3 | #include "Library/Base/StringUtil.h" |
| 4 | |
| 5 | #include "Player/CollisionShapeInfo.h" |
| 6 | |
| 7 | bool CollisionShapeFunction::isShapeName(const CollisionShapeInfoBase* shape, const char* name) { |
| 8 | return al::isEqualString(str1: name, str2: shape->getName()); |
| 9 | } |
| 10 | |
| 11 | bool CollisionShapeFunction::isShapeArrow(const CollisionShapeInfoBase* shape) { |
| 12 | return shape->getId() == CollisionShapeId::Arrow; |
| 13 | } |
| 14 | |
| 15 | bool CollisionShapeFunction::isShapeSphere(const CollisionShapeInfoBase* shape) { |
| 16 | return shape->getId() == CollisionShapeId::Sphere; |
| 17 | } |
| 18 | |
| 19 | bool CollisionShapeFunction::isShapeDisk(const CollisionShapeInfoBase* shape) { |
| 20 | return shape->getId() == CollisionShapeId::Disk; |
| 21 | } |
| 22 | |
| 23 | CollisionShapeInfoArrow* CollisionShapeFunction::getShapeInfoArrow(CollisionShapeInfoBase* shape) { |
| 24 | return reinterpret_cast<CollisionShapeInfoArrow*>(shape); |
| 25 | } |
| 26 | |
| 27 | CollisionShapeInfoSphere* |
| 28 | CollisionShapeFunction::getShapeInfoSphere(CollisionShapeInfoBase* shape) { |
| 29 | return reinterpret_cast<CollisionShapeInfoSphere*>(shape); |
| 30 | } |
| 31 | |
| 32 | CollisionShapeInfoDisk* CollisionShapeFunction::getShapeInfoDisk(CollisionShapeInfoBase* shape) { |
| 33 | return reinterpret_cast<CollisionShapeInfoDisk*>(shape); |
| 34 | } |
| 35 | |
| 36 | const CollisionShapeInfoArrow* |
| 37 | CollisionShapeFunction::getShapeInfoArrow(const CollisionShapeInfoBase* shape) { |
| 38 | return reinterpret_cast<const CollisionShapeInfoArrow*>(shape); |
| 39 | } |
| 40 | |
| 41 | const CollisionShapeInfoSphere* |
| 42 | CollisionShapeFunction::getShapeInfoSphere(const CollisionShapeInfoBase* shape) { |
| 43 | return reinterpret_cast<const CollisionShapeInfoSphere*>(shape); |
| 44 | } |
| 45 | |
| 46 | const CollisionShapeInfoDisk* |
| 47 | CollisionShapeFunction::getShapeInfoDisk(const CollisionShapeInfoBase* shape) { |
| 48 | return reinterpret_cast<const CollisionShapeInfoDisk*>(shape); |
| 49 | } |
| 50 | |
| 51 | void CollisionShapeFunction::updateShapeOffset(CollisionShapeInfoBase* shape, |
| 52 | const sead::Vector3f& offset) { |
| 53 | shape->updateShapeOffset(offset); |
| 54 | } |
| 55 |