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