| 600 | } |
| 601 | |
| 602 | void EffectSpriteLamp::onTouchesEnded(const std::vector<Touch*>& touches, Event* unused_event) |
| 603 | { |
| 604 | for (auto&&item : touches) |
| 605 | { |
| 606 | auto touch = item; |
| 607 | auto s = Director::getInstance()->getWinSize(); |
| 608 | Point loc_winSpace = touch->getLocationInView(); |
| 609 | _lightSprite->setPosition(Vec2(loc_winSpace.x, s.height - loc_winSpace.y)); |
| 610 | Vec3 pos(loc_winSpace.x, loc_winSpace.y, 50); |
| 611 | Mat4 mat = _sprite->getNodeToWorldTransform(); |
| 612 | Point lightPosInLocalSpace = |
| 613 | PointApplyAffineTransform(Vec2(pos.x, pos.y), _sprite->getWorldToNodeAffineTransform()); |
| 614 | ((EffectNormalMapped*)_effect)->setLightPos(Vec3(lightPosInLocalSpace.x, lightPosInLocalSpace.y, 50.0f)); |
| 615 | } |
| 616 | } |
nothing calls this directly
no test coverage detected