| 217 | } |
| 218 | |
| 219 | void LAppView::drawDebugRects(LAppLive2DManager* manager) const |
| 220 | { |
| 221 | const Color4F hitAreaColor = Color4F(1.0f, 0, 0, 0.2f); |
| 222 | const Color4F userDataAreaColor = Color4F(0, 0, 1.0f, 0.2f); |
| 223 | |
| 224 | CubismMatrix44 projection; |
| 225 | const Size window = Director::getInstance()->getWinSize(); |
| 226 | const CubismVector2 windowSize = CubismVector2(window.width, window.height); |
| 227 | projection.Scale(1, window.width / window.height); |
| 228 | |
| 229 | if (viewMatrix != NULL) |
| 230 | { |
| 231 | projection.MultiplyByMatrix(viewMatrix); |
| 232 | } |
| 233 | |
| 234 | for (csmUint32 i = 0; i < manager->GetModelCount(); ++i) |
| 235 | { |
| 236 | _debugRects->clear(); |
| 237 | LAppModel* model = manager->GetModel(i); |
| 238 | const Csm::csmVector<Csm::csmRectF>& userDataAreas = model->GetUserDataAreas(projection, windowSize); |
| 239 | for (csmUint32 j = 0; j < userDataAreas.GetSize(); ++j) |
| 240 | { |
| 241 | _debugRects->drawSolidRect(Vec2(userDataAreas[j].X, userDataAreas[j].Y) |
| 242 | , Vec2(userDataAreas[j].GetRight(), userDataAreas[j].GetBottom()) |
| 243 | , userDataAreaColor); |
| 244 | } |
| 245 | |
| 246 | const Csm::csmVector<Csm::csmRectF>& hitAreas = model->GetHitAreas(projection, windowSize); |
| 247 | for (csmUint32 j = 0; j < hitAreas.GetSize(); ++j) |
| 248 | { |
| 249 | _debugRects->drawSolidRect(Vec2(hitAreas[j].X, hitAreas[j].Y) |
| 250 | , Vec2(hitAreas[j].GetRight(), hitAreas[j].GetBottom()) |
| 251 | , hitAreaColor); |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | LAppView* LAppView::createDrawNode() |
| 257 | { |
nothing calls this directly
no test coverage detected