| 568 | } |
| 569 | |
| 570 | void EffectSpriteLamp::onTouchesBegan(const std::vector<Touch*>& touches, Event* unused_event) |
| 571 | { |
| 572 | for (auto&&item : touches) |
| 573 | { |
| 574 | auto touch = item; |
| 575 | auto s = Director::getInstance()->getWinSize(); |
| 576 | Point loc_winSpace = touch->getLocationInView(); |
| 577 | _lightSprite->setPosition(Vec2(loc_winSpace.x, s.height - loc_winSpace.y)); |
| 578 | Vec3 pos(loc_winSpace.x, loc_winSpace.y, 50); |
| 579 | Mat4 mat = _sprite->getNodeToWorldTransform(); |
| 580 | Point lightPosInLocalSpace = |
| 581 | PointApplyAffineTransform(Vec2(pos.x, pos.y), _sprite->getWorldToNodeAffineTransform()); |
| 582 | ((EffectNormalMapped*)_effect)->setLightPos(Vec3(lightPosInLocalSpace.x, lightPosInLocalSpace.y, 50.0f)); |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | void EffectSpriteLamp::onTouchesMoved(const std::vector<Touch*>& touches, Event* unused_event) |
| 587 | { |
nothing calls this directly
no test coverage detected