示例#1
0
	CCRipple3D* CCRipple3D::actionWithPosition(const CCPoint& pos, float r, int wav, float amp, const ccGridSize& gridSize, ccTime duration)
	{
		CCRipple3D *pAction = new CCRipple3D();

		if (pAction)
		{
			if (pAction->initWithPosition(pos, r, wav, amp, gridSize, duration))
			{
				pAction->autorelease();
			}
			else
			{
				CC_SAFE_RELEASE_NULL(pAction);
			}
		}

		return pAction;
	}
示例#2
0
	CCObject* CCRipple3D::copyWithZone(CCZone *pZone)
	{
		CCZone* pNewZone = NULL;
		CCRipple3D* pCopy = NULL;
		if(pZone && pZone->m_pCopyObject)
		{
			//in case of being called at sub class
			pCopy = (CCRipple3D*)(pZone->m_pCopyObject);
		}
		else
		{
			pCopy = new CCRipple3D();
			pZone = pNewZone = new CCZone(pCopy);
		}

		CCGrid3DAction::copyWithZone(pZone);

		pCopy->initWithPosition(m_position, m_fRadius, m_nWaves, m_fAmplitude, m_sGridSize, m_fDuration);
		
		CC_SAFE_DELETE(pNewZone);
		return pCopy;
	}