| 584 | } |
| 585 | |
| 586 | void EffectSpriteLamp::onTouchesMoved(const std::vector<Touch*>& touches, Event* unused_event) |
| 587 | { |
| 588 | for (auto&&item : touches) |
| 589 | { |
| 590 | auto touch = item; |
| 591 | auto s = Director::getInstance()->getWinSize(); |
| 592 | Point loc_winSpace = touch->getLocationInView(); |
| 593 | _lightSprite->setPosition(Vec2(loc_winSpace.x, s.height - loc_winSpace.y)); |
| 594 | Vec3 pos(loc_winSpace.x, loc_winSpace.y, 50); |
| 595 | Mat4 mat = _sprite->getNodeToWorldTransform(); |
| 596 | Point lightPosInLocalSpace = |
| 597 | PointApplyAffineTransform(Vec2(pos.x, pos.y), _sprite->getWorldToNodeAffineTransform()); |
| 598 | ((EffectNormalMapped*)_effect)->setLightPos(Vec3(lightPosInLocalSpace.x, lightPosInLocalSpace.y, 50.0f)); |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | void EffectSpriteLamp::onTouchesEnded(const std::vector<Touch*>& touches, Event* unused_event) |
| 603 | { |
nothing calls this directly
no test coverage detected