MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / getKeyPoint

Method getKeyPoint

Source/Node/Model.cpp:419–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419Vec2 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
437Animation::Animation(Node* node, Action* action)
438 : _node(node)

Callers 3

initMethod · 0.45
updateMethod · 0.45
playable_get_keyFunction · 0.45

Calls 5

convertToWorldSpaceMethod · 0.80
toVec2Method · 0.80
findMethod · 0.65
mulClass · 0.50
endMethod · 0.45

Tested by

no test coverage detected