當前位置: 首頁>>代碼示例>>C++>>正文


C++ D3DXMatrixRotationAxis函數代碼示例

本文整理匯總了C++中D3DXMatrixRotationAxis函數的典型用法代碼示例。如果您正苦於以下問題:C++ D3DXMatrixRotationAxis函數的具體用法?C++ D3DXMatrixRotationAxis怎麽用?C++ D3DXMatrixRotationAxis使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了D3DXMatrixRotationAxis函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: D3DXVec3Normalize

void ElCamera::setDirection(const D3DXVECTOR3& vec)
{
	// Do nothing if given a zero vector
	if (vec == D3DXVECTOR3(0.0f, 0.0f, 0.0f))
		return;

	D3DXVECTOR3 adjustVec = vec;
	if (mYawFixed)
		adjustVec.y = 0.0f;
	D3DXVec3Normalize(&adjustVec, &adjustVec);
	
	D3DXMATRIX m;
	if (D3DXVec3LengthSq(&(D3DXVECTOR3(0.0f, 0.0f, 1.0f) + adjustVec)) < 0.00005f)
	{
		// Oops, a 180 degree turn (infinite possible rotation axes)
		// Default to yaw i.e. use current DOWN
		D3DXMatrixRotationAxis(&m, &D3DXVECTOR3(0.0f, -1.0f, 0.0f), D3DX_PI);
	}
	else
	{
		D3DXVECTOR3 axe;
		D3DXVec3Cross(&axe, &D3DXVECTOR3(0.0f, 0.0f, 1.0f), &adjustVec);

		float dot = D3DXVec3Dot(&D3DXVECTOR3(0.0f, 0.0f, 1.0f), &adjustVec);
		D3DXMatrixRotationAxis(&m, &axe, acos(dot));
	}

	mLook = vec;
	D3DXVec3TransformCoord(&mUp, &D3DXVECTOR3(0.0f, 1.0f, 0.0f), &m);
	D3DXVec3TransformCoord(&mRight, &D3DXVECTOR3(1.0f, 0.0f, 0.0f), &m);

	calcViewOrientation();
	invalidateView();
}
開發者ID:chenbk85,項目名稱:3dlearn,代碼行數:34,代碼來源:ElCamera.cpp

示例2: RotateCameraHorizontally

void RotateCameraHorizontally(float radian)
{
    /*
        常規變換
    */
    //將eyePoint繞lookAt點旋轉
    D3DXMATRIX rotation;
    //D3DXMatrixRotationAxis:
    // D3DXMATRIX * D3DXMatrixRotationAxis(
    //__inout  D3DXMATRIX *pOut,
    //    __in     const D3DXVECTOR3 *pV,
    //    __in     FLOAT Angle
    //    );
    //其功能是生成繞原點處的方向向量為pV的軸旋轉角度Angle的旋轉變換矩陣
    //所以在繞非原點旋轉時需要先將目標點的旋轉變換為繞原點旋轉
    D3DXMatrixRotationAxis(&rotation, &up, radian);
    D3DXVECTOR4 tmp;
    D3DXVec3Transform(&tmp, &(eyePoint-lookAt), &rotation);
    eyePoint = lookAt + D3DXVECTOR3(tmp.x, tmp.y, tmp.z);

    /*
        fixed 變換
    */
    {
        //將eyePoint繞lookAt點旋轉
        D3DXMATRIX rotation;
        D3DXMatrixRotationAxis(&rotation, &fixedUp, radian);
        D3DXVECTOR4 tmp;
        D3DXVec3Transform(&tmp, &(fixedEyePoint-fixedLookAt), &rotation);
        fixedEyePoint = fixedLookAt + D3DXVECTOR3(tmp.x, tmp.y, tmp.z);
    }
}
開發者ID:zwcloud,項目名稱:FBXViewer,代碼行數:32,代碼來源:Camera.cpp

示例3: HandleMouseInputLightRotate

//-------------------------------------------------------------------------------
// handle mouse input for the light rotation
//
// Axes: global x/y axis
//-------------------------------------------------------------------------------
void HandleMouseInputLightRotate( void )
	{
	POINT mousePos;
	GetCursorPos( &mousePos );
	ScreenToClient( GetDlgItem(g_hDlg,IDC_RT), &mousePos );

	g_mousePos.x = mousePos.x;
	g_mousePos.y = mousePos.y;

	if (g_bMousePressedR)
		{
		int nXDiff = -(g_mousePos.x - g_LastmousePos.x);
		int nYDiff = -(g_mousePos.y - g_LastmousePos.y);

		aiVector3D v = aiVector3D(1.0f,0.0f,0.0f);
		aiMatrix4x4 mTemp;
		D3DXMatrixRotationAxis( (D3DXMATRIX*) &mTemp, (D3DXVECTOR3*)&v, D3DXToRadian((float)nYDiff / 2.0f));
		D3DXVec3TransformCoord((D3DXVECTOR3*)&g_avLightDirs[0],
			(const D3DXVECTOR3*)&g_avLightDirs[0],(const D3DXMATRIX*)&mTemp);

		v = aiVector3D(0.0f,1.0f,0.0f);
		D3DXMatrixRotationAxis( (D3DXMATRIX*) &mTemp, (D3DXVECTOR3*)&v, D3DXToRadian((float)nXDiff / 2.0f));
		D3DXVec3TransformCoord((D3DXVECTOR3*)&g_avLightDirs[0],
			(const D3DXVECTOR3*)&g_avLightDirs[0],(const D3DXMATRIX*)&mTemp);
		}
	return;
	}
開發者ID:u-engine,項目名稱:chihuahua,代碼行數:32,代碼來源:Input.cpp

示例4: D3DXToRadian

/*
*
* @author Michael McQuarrie
* @param _pParticle The particle that needs to be reset
* @return void
*/
void
CFlagParticleEmitter::Resetparticle(TParticle *_pParticle)
{
    //Initalise origin

    _pParticle->vec3Position = m_vec3Origin += m_pFlag->GetUp() * 4.18f;

    float32 fAngleHor = D3DXToRadian(rand() % 360);
    float32 fAngleVer = -D3DXToRadian((rand() % 61) + 60);

    D3DXMATRIX yawMat;
    D3DXMATRIX pitchMat;

    D3DXMatrixRotationAxis(&yawMat, &m_pFlag->GetUp(), fAngleHor);
    D3DXMatrixRotationAxis(&pitchMat, &m_pFlag->GetRight(), fAngleVer);

    _pParticle->vec3Velocity = m_pFlag->GetDirection();

    D3DXVec3TransformCoord(&_pParticle->vec3Velocity, &_pParticle->vec3Velocity, &pitchMat);
    D3DXVec3TransformCoord(&_pParticle->vec3Velocity, &_pParticle->vec3Velocity, &yawMat);
    //Setting it

    D3DXVec3Normalize(&_pParticle->vec3Velocity, &_pParticle->vec3Velocity);

    _pParticle->vec3Velocity += m_pFlag->GetUp();

    //Setting the life timer
    _pParticle->fAge = 1.0f;
    _pParticle->fLifeTime = 0.0f;
    _pParticle->colour = (m_pFlag->GetTeam() == TEAM_GREEN)?(KCOLTEAM_GREEN):(KCOLTEAM_PURPLE);
    _pParticle->bAlive = true;

}
開發者ID:DrBiologicals,項目名稱:Total-Cube-Domination,代碼行數:39,代碼來源:flagparticleemitter.cpp

示例5: HandleMouseInputFPS

//-------------------------------------------------------------------------------
// Handle mouse input for the FPS input behaviour
//
// Movement in x and y axis is possible
//-------------------------------------------------------------------------------
void HandleMouseInputFPS( void )
	{
	POINT mousePos;
	GetCursorPos( &mousePos );
	ScreenToClient( GetDlgItem(g_hDlg,IDC_RT), &mousePos );

	g_mousePos.x = mousePos.x;
	g_mousePos.y = mousePos.y;

	D3DXMATRIX matRotation;

	if (g_bMousePressed)
		{
		int nXDiff = (g_mousePos.x - g_LastmousePos.x);
		int nYDiff = (g_mousePos.y - g_LastmousePos.y);

		if( 0 != nYDiff)
			{
			D3DXMatrixRotationAxis( &matRotation, (D3DXVECTOR3*)& g_sCamera.vRight, D3DXToRadian((float)nYDiff / 6.0f));
			D3DXVec3TransformCoord( (D3DXVECTOR3*)&g_sCamera.vLookAt, (D3DXVECTOR3*)& g_sCamera.vLookAt, &matRotation );
			D3DXVec3TransformCoord( (D3DXVECTOR3*)&g_sCamera.vUp, (D3DXVECTOR3*)&g_sCamera.vUp, &matRotation );
			}

		if( 0 != nXDiff )
			{
			D3DXVECTOR3 v(0,1,0);
			D3DXMatrixRotationAxis( &matRotation, (D3DXVECTOR3*)&g_sCamera.vUp, D3DXToRadian((float)nXDiff / 6.0f) );
			D3DXVec3TransformCoord( (D3DXVECTOR3*)&g_sCamera.vLookAt, (D3DXVECTOR3*)&g_sCamera.vLookAt, &matRotation );
			D3DXVec3TransformCoord( (D3DXVECTOR3*)&g_sCamera.vRight,(D3DXVECTOR3*) &g_sCamera.vRight, &matRotation );
			}
		}

	g_LastmousePos.x = g_mousePos.x;
	g_LastmousePos.y = g_mousePos.y;
	}
開發者ID:u-engine,項目名稱:chihuahua,代碼行數:40,代碼來源:Input.cpp

示例6: D3DXMatrixRotationAxis

void FreeCameraController::recompute_rotation()
{
	D3DXVECTOR3 view_temp;
	D3DXVECTOR3 view_temp2;
	D3DXVECTOR3 right_temp;
	D3DXVECTOR3 up_temp;

	D3DXVECTOR3 right_vector_v3 = right_vector_;
	D3DXVECTOR3 up_vector_v3 = up_vector_;
	D3DXVECTOR3 view_vector_v3 = view_vector_;

	D3DXVECTOR3 default_right_v3 = default_right_;
	D3DXVECTOR3 default_forward_v3 = default_forward_;
	D3DXVECTOR3 default_up_v3 = default_up_;

	D3DXMATRIX m_1;
	D3DXMATRIX m_2;

	D3DXMatrixRotationAxis(&m_2, &default_up_v3, yaw_);
	D3DXVec3TransformCoord(&view_temp2, &default_forward_v3, &m_2);
	D3DXVec3TransformCoord(&right_temp, &default_right_v3, &m_2);

	D3DXMatrixRotationAxis(&m_1, &right_temp, -pitch_);
	D3DXVec3TransformCoord(&view_temp, &view_temp2, &m_1);
	D3DXVec3TransformCoord(&up_temp, &default_up_v3, &m_1);

	D3DXVec3Normalize(&up_vector_v3, &up_temp);
	D3DXVec3Normalize(&view_vector_v3, &view_temp);
	D3DXVec3Normalize(&right_vector_v3, &right_temp);

	right_vector_ = D3DXVECTOR4(right_vector_v3.x, right_vector_v3.y, right_vector_v3.z, 1);
	up_vector_ = D3DXVECTOR4(up_vector_v3.x, up_vector_v3.y, up_vector_v3.z, 1);
	view_vector_ = D3DXVECTOR4(view_vector_v3.x, view_vector_v3.y, view_vector_v3.z, 1);
}
開發者ID:Muret,項目名稱:Zephyr,代碼行數:34,代碼來源:FreeCameraController.cpp

示例7: D3DXMatrixRotationAxis

void Camera::Update()
{
	static D3DXVECTOR2 lastMousePosition = theInput->GetMousePosition();
	// Rotate the camera
	if (theInput->GetKey(VK_LBUTTON))
	{
		D3DXVECTOR2 curMousePosition = theInput->GetMousePosition();
		float xDiff = curMousePosition.x - lastMousePosition.x;
		float yDiff = curMousePosition.y - lastMousePosition.y;
		lastMousePosition = curMousePosition;

		D3DXMATRIX matRotation;
		if (yDiff != 0)
		{
			D3DXMatrixRotationAxis(&matRotation, &m_right, D3DXToRadian(yDiff / 3.0f));
			D3DXVec3TransformCoord(&m_look, &m_look, &matRotation);
			D3DXVec3TransformCoord(&m_up, &m_up, &matRotation);
		}

		if (xDiff != 0)
		{
			D3DXMatrixRotationAxis(&matRotation, &D3DXVECTOR3(0, 1, 0), D3DXToRadian(xDiff / 3.0f));
			D3DXVec3TransformCoord(&m_look, &m_look, &matRotation);
			D3DXVec3TransformCoord(&m_up, &m_up, &matRotation);
			D3DXVec3TransformCoord(&m_right, &m_right, &matRotation);
		}
	}
	else
	{
		lastMousePosition = theInput->GetMousePosition();
	}
	
	// Move the Camera
	float moveX = 0.0f, moveY = 0.0f, moveZ = 0.0f;
	if (theInput->GetKey(VK_UP) || theInput->GetKey('W'))
		moveZ += 1.0f;
	if (theInput->GetKey(VK_DOWN) || theInput->GetKey('S'))
		moveZ -= 1.0f;
	if (theInput->GetKey(VK_LEFT) || theInput->GetKey('A'))
		moveX -= 1.0f;
	if (theInput->GetKey(VK_RIGHT) || theInput->GetKey('D'))
		moveX += 1.0f;
	if (theInput->GetKey(VK_HOME) || theInput->GetKey('Q'))
		moveY += 1.0f;
	if (theInput->GetKey(VK_END) || theInput->GetKey('E'))
		moveY -= 1.0f;
	D3DXVECTOR3 move = moveX * m_right + moveY * m_up + moveZ * m_look;
	D3DXVec3Normalize(&move, &move);
	m_position += move * m_moveSpeed * theTime->GetDeltaTime();



	UpdateViewMatrix();
}
開發者ID:tcye,項目名稱:DXEngine,代碼行數:54,代碼來源:Camera.cpp

示例8: shape

void Camera::CalculateViewMatrix(D3DXMATRIX *viewMatrix)
{
	/* Start with our camera axis pointing down z
	 An alternative method is to just keep adjusting our axis but if we do that the
	 axis can start to lose its orthogonal shape (due to floating point innacuracies).
	 This could be solved by rebuilding the orthogonal shape each time with the following:
	 1. normalising the look vector
	 2. creating the up vector from the cross product of the look and the right
	 3. normalising up
	 4. creating the right vector from the cross product of the look and the up
	 5. normalising right
	*/

	m_up=D3DXVECTOR3(0.0f,1.0f,0.0f);
	m_look=D3DXVECTOR3(0.0f,0.0f,1.0f);
	m_right=D3DXVECTOR3(1.0f,0.0f,0.0f);

	// Yaw is rotation around the y axis (m_up)
	// Create a matrix that can carry out this rotation
	D3DXMATRIX yawMatrix;
	D3DXMatrixRotationAxis(&yawMatrix, &m_up, m_yaw);
	// To apply yaw we rotate the m_look & m_right vectors about the m_up vector (using our yaw matrix)
	D3DXVec3TransformCoord(&m_look, &m_look, &yawMatrix);
	D3DXVec3TransformCoord(&m_right, &m_right, &yawMatrix);

	// Pitch is rotation around the x axis (m_right)
	// Create a matrix that can carry out this rotation
	D3DXMATRIX pitchMatrix;
	D3DXMatrixRotationAxis(&pitchMatrix, &m_right, m_pitch);
	// To apply pitch we rotate the m_look and m_up vectors about the m_right vector (using our pitch matrix)
	D3DXVec3TransformCoord(&m_look, &m_look, &pitchMatrix);
	D3DXVec3TransformCoord(&m_up, &m_up, &pitchMatrix);

	// Roll is rotation around the z axis (m_look)
	// Create a matrix that can carry out this rotation
	D3DXMATRIX rollMatrix;
	D3DXMatrixRotationAxis(&rollMatrix, &m_look, m_roll);
	// To apply roll we rotate up and right about the look vector (using our roll matrix)
	// Note: roll only really applies for things like aircraft unless you are implementing lean
	D3DXVec3TransformCoord(&m_right, &m_right, &rollMatrix);
	D3DXVec3TransformCoord(&m_up, &m_up, &rollMatrix);

	// Build the view matrix from the transformed camera axis
	D3DXMatrixIdentity(viewMatrix);

	viewMatrix->_11 = m_right.x; viewMatrix->_12 = m_up.x; viewMatrix->_13 = m_look.x;
	viewMatrix->_21 = m_right.y; viewMatrix->_22 = m_up.y; viewMatrix->_23 = m_look.y;
	viewMatrix->_31 = m_right.z; viewMatrix->_32 = m_up.z; viewMatrix->_33 = m_look.z;

	viewMatrix->_41 = - D3DXVec3Dot( &m_position,&m_right);
	viewMatrix->_42 = - D3DXVec3Dot( &m_position,&m_up);
	viewMatrix->_43 = - D3DXVec3Dot( &m_position,&m_look);
}
開發者ID:AlexAngelosky,項目名稱:Diplomna,代碼行數:53,代碼來源:Camera.cpp

示例9: D3DXMatrixRotationAxis

void camera::angleUp(float a)
{
	
	//THIS IS FOR TURNING
	D3DXMATRIX rot;
	D3DXMatrixRotationAxis(&rot,&right,a);

	D3DXMatrixRotationAxis(&rot,&up,a);

	D3DXVec3TransformCoord(&right,&right,&rot);
	D3DXVec3TransformCoord(&look,&look,&rot);

}
開發者ID:steven00,項目名稱:interface,代碼行數:13,代碼來源:camera.cpp

示例10: RotateCameraVertically

void RotateCameraVertically(float radian)
{
    /*
        常規變換
    */
    {
        D3DXVECTOR3 vForward = lookAt - eyePoint;
        D3DXVec3Normalize(&vForward, &vForward);

        D3DXVECTOR3 vLeft;
        D3DXVec3Cross(&vLeft, &up, &vForward);
        D3DXVec3Normalize(&vLeft, &vLeft);

        D3DXMATRIX rotation;
        D3DXMatrixRotationAxis(&rotation, &vLeft, radian);
        D3DXVECTOR4 tmp;
        D3DXVec3Transform(&tmp, &(eyePoint-lookAt), &rotation);
        eyePoint = lookAt + D3DXVECTOR3(tmp.x, tmp.y, tmp.z);

        //豎直方向旋轉時,up方向隨之變化,需要更新
        vForward = lookAt - eyePoint;
        D3DXVec3Normalize(&vForward, &vForward);
        D3DXVec3Cross(&up, &vForward, &vLeft);
        D3DXVec3Normalize(&up, &up);
    }
    
    /*
        fixed 變換
    */
    {
        D3DXVECTOR3 vForward = fixedLookAt - fixedEyePoint;
        D3DXVec3Normalize(&vForward, &vForward);

        D3DXVECTOR3 vLeft;
        D3DXVec3Cross(&vLeft, &fixedUp, &vForward);
        D3DXVec3Normalize(&vLeft, &vLeft);

        D3DXMATRIX rotation;
        D3DXMatrixRotationAxis(&rotation, &vLeft, radian);
        D3DXVECTOR4 tmp;
        D3DXVec3Transform(&tmp, &(fixedEyePoint-fixedLookAt), &rotation);
        fixedEyePoint = fixedLookAt + D3DXVECTOR3(tmp.x, tmp.y, tmp.z);

        //豎直方向旋轉時,up方向隨之變化,需要更新
        vForward = fixedLookAt - fixedEyePoint;
        D3DXVec3Normalize(&vForward, &vForward);
        D3DXVec3Cross(&fixedUp, &vForward, &vLeft);
        D3DXVec3Normalize(&fixedUp, &fixedUp);
    }
}
開發者ID:zwcloud,項目名稱:FBXViewer,代碼行數:50,代碼來源:Camera.cpp

示例11: D3DXMatrixRotationAxis

void MANIPULATEACTIVE::Rotation(float x,float y,float z)
{
	D3DXMATRIX tmp;
	D3DXMatrixRotationAxis(&tmp,&right,x/180.0f*D3DX_PI);
	D3DXVec3TransformCoord(&up,&up,&tmp);
	D3DXVec3TransformCoord(&look,&look,&tmp);

	D3DXMatrixRotationAxis(&tmp,&up,y/180.0f*D3DX_PI);
	D3DXVec3TransformCoord(&right,&right,&tmp);
	D3DXVec3TransformCoord(&look,&look,&tmp);

	D3DXMatrixRotationAxis(&tmp,&look,z/180.0f*D3DX_PI);
	D3DXVec3TransformCoord(&right,&right,&tmp);
	D3DXVec3TransformCoord(&up,&up,&tmp);
}
開發者ID:maxiprogram,項目名稱:DemoEngine3D,代碼行數:15,代碼來源:MANIPULATE.cpp

示例12: D3DXMatrixRotationAxis

void Camera::Yaw(float angle)
{
	D3DXMATRIX mYaw;
	if (m_Type==LANDOBJECT)
	{
		D3DXMatrixRotationAxis(&mYaw, &D3DXVECTOR3(0.0f,1.0f,0.0f), angle);
	}
	else
	{
		D3DXMatrixRotationAxis(&mYaw, &m_Up, angle);

	}
	D3DXVec3TransformCoord(&m_Look, &m_Look, &mYaw);
	D3DXVec3TransformCoord(&m_Right, &m_Right, &mYaw);
}
開發者ID:heromapwrd,項目名稱:DirectX9,代碼行數:15,代碼來源:Camera.cpp

示例13: D3DXMatrixRotationAxis

void Camera::Pitch( float angle )
{
	D3DXMATRIX R;
	D3DXMatrixRotationAxis(&R, &mRight, angle);
	D3DXVec3TransformNormal(&mUp, &mUp, &R);
	D3DXVec3TransformNormal(&mLook, &mLook, &R);
}
開發者ID:jaffafa,項目名稱:pacman-reloaded,代碼行數:7,代碼來源:Camera.cpp

示例14: D3DXMatrixRotationAxis

void cCamera::roll (float angle) {

	D3DXMATRIX T;
	D3DXMatrixRotationAxis (&T, &look, angle);
	D3DXVec3TransformCoord (&right, &right, &T);
	D3DXVec3TransformCoord (&up, &up, &T);
}
開發者ID:hellobody,項目名稱:dxframe,代碼行數:7,代碼來源:cCamera.cpp

示例15: D3DXMatrixRotationAxis

/*
* rotates the turret towards the inputed angle
*
* author				Cameron MacIntosh
* param _fRadian		the desired angle to rotate to
* param _fDeltaTick		the amount of time available to turn
*/
void
CTower::RotateTurret(float32 _fRadian, float32 _fDeltaTick)
{
	//if the turret angle is not equal to the desired angle
	if(_fRadian!=m_turretAngle.GetAngle())
	{
		//turn the turret towards the desired angle, given possible turn amount
		CAngle targetAngle;
		targetAngle.SetAngle(_fRadian);
		m_turretAngle.TurnTowardsAngle(targetAngle, m_fTurnSpeed * _fDeltaTick);

		D3DXMATRIX mat;
		D3DXMatrixRotationAxis(&mat, &m_vec3Up, m_turretAngle.GetAngle());
		D3DXVec3TransformCoord(&m_vec3ShootDir, &g_atUpRightDirectionVecs[m_eFace].vec3Direction, &mat);
		D3DXVec3TransformCoord(&m_vec3ShootRight, &g_atUpRightDirectionVecs[m_eFace].vec3Right, &mat);

		//set the world matrix of the turret model
		// Set the up, right and direction vectors into the world matirx.
		m_matTurretWorld._11 = m_vec3ShootRight.x; m_matTurretWorld._21 = m_vec3Up.x; m_matTurretWorld._31 = m_vec3ShootDir.x;
		m_matTurretWorld._12 = m_vec3ShootRight.y; m_matTurretWorld._22 = m_vec3Up.y; m_matTurretWorld._32 = m_vec3ShootDir.y;
		m_matTurretWorld._13 = m_vec3ShootRight.z; m_matTurretWorld._23 = m_vec3Up.z; m_matTurretWorld._33 = m_vec3ShootDir.z;
		m_matTurretWorld._41 = m_vec3Position.x;
		m_matTurretWorld._42 = m_vec3Position.y;
		m_matTurretWorld._43 = m_vec3Position.z;
	}
}
開發者ID:DrBiologicals,項目名稱:Total-Cube-Domination,代碼行數:33,代碼來源:tower.cpp


注:本文中的D3DXMatrixRotationAxis函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。