| 
									
										
										
										
											2018-04-21 21:24:46 +08:00
										 |  |  |  | #include "..\e2daction.h"
 | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-27 21:07:43 +08:00
										 |  |  |  | e2d::ActionRotateBy::ActionRotateBy(double duration, double rotation) : | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  |  | 	ActionGradual(duration) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	_nVariation = rotation; | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  |  | void e2d::ActionRotateBy::_init() | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  |  | 	ActionGradual::_init(); | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	if (_pTarget) | 
					
						
							| 
									
										
										
										
											2017-10-20 00:59:26 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 		_nBeginVal = _pTarget->getRotation(); | 
					
						
							| 
									
										
										
										
											2017-10-20 00:59:26 +08:00
										 |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  |  | void e2d::ActionRotateBy::_update() | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  |  | 	ActionGradual::_update(); | 
					
						
							| 
									
										
										
										
											2017-11-03 12:51:01 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	if (_pTarget == nullptr) | 
					
						
							| 
									
										
										
										
											2017-10-20 00:59:26 +08:00
										 |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		this->stop(); | 
					
						
							|  |  |  |  | 		return; | 
					
						
							|  |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-11-03 12:51:01 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-30 16:45:38 +08:00
										 |  |  |  | 	// <20><>ת<EFBFBD>ڵ<EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	_pTarget->setRotation(_nBeginVal + _nVariation * _fRateOfProgress); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  |  | e2d::ActionRotateBy * e2d::ActionRotateBy::clone() const | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	return new ActionRotateBy(_fDuration, _nVariation); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  |  | e2d::ActionRotateBy * e2d::ActionRotateBy::reverse() const | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	return new ActionRotateBy(_fDuration, -_nVariation); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | } |