| 417 | } |
| 418 | |
| 419 | Vec2 Model::getKeyPoint(String name) { |
| 420 | auto& keyPoints = _modelDef->getKeyPoints(); |
| 421 | auto it = keyPoints.find(name); |
| 422 | if (it != keyPoints.end()) { |
| 423 | auto keyPoint = it->second; |
| 424 | if (isFliped()) { |
| 425 | keyPoint.x = -keyPoint.x; |
| 426 | } |
| 427 | return keyPoint * Vec2{getScaleX(), getScaleY()}; |
| 428 | } |
| 429 | if (auto node = getNodeByName(name)) { |
| 430 | auto target = node->convertToWorldSpace(Vec2::zero); |
| 431 | Vec3 origin = Vec3::from(bx::mul(bx::Vec3{0.0f, 0.0f, 0.0f}, getWorld().m)); |
| 432 | return target - origin.toVec2(); |
| 433 | } |
| 434 | return Vec2::zero; |
| 435 | } |
| 436 | |
| 437 | Animation::Animation(Node* node, Action* action) |
| 438 | : _node(node) |
no test coverage detected