MCPcopy Create free account
hub / github.com/Voine/ChatWaifu_Mobile / HitTest

Method HitTest

Live2D/src/main/cpp/LAppModel.cpp:637–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635}
636
637csmBool LAppModel::HitTest(const csmChar* hitAreaName, csmFloat32 x, csmFloat32 y)
638{
639 // 透明時は当たり判定なし。
640 if (_opacity < 1)
641 {
642 return false;
643 }
644 const csmInt32 count = _modelSetting->GetHitAreasCount();
645 for (csmInt32 i = 0; i < count; i++)
646 {
647 if (strcmp(_modelSetting->GetHitAreaName(i), hitAreaName) == 0)
648 {
649 const CubismIdHandle drawID = _modelSetting->GetHitAreaId(i);
650 return IsHit(drawID, x, y);
651 }
652 }
653 return false; // 存在しない場合はfalse
654}
655
656void LAppModel::SetExpression(const csmChar* expressionID)
657{

Callers 1

OnTapMethod · 0.80

Calls 3

GetHitAreasCountMethod · 0.45
GetHitAreaNameMethod · 0.45
GetHitAreaIdMethod · 0.45

Tested by

no test coverage detected