コード例 #1
0
void lib_finder::OnCompilerSetBuildOptions(CodeBlocksEvent& event)
{
    event.Skip();
    cbProject* Proj = event.GetProject();
    ProjectConfiguration* Conf = GetProject(Proj);
    if ( Conf->m_DisableAuto ) return;
    wxString Target = event.GetBuildTargetName();
    if ( Target.IsEmpty() )
    {
        // Setting up options for project
        SetupTarget(Proj,Conf->m_GlobalUsedLibs);
    }
    else
    {
        // Setting up compile target
        SetupTarget(Proj->GetBuildTarget(Target),Conf->m_TargetsUsedLibs[Target]);
    }
}
コード例 #2
0
ファイル: BulletNode.cpp プロジェクト: dovalec/3D
void BulletNode::ShootState()
{
	SetupTarget();

	mBulletStartingPos = mBulletPos = mShooterNode->GetWorldTranslation();
	
	if (mTargetNode)
		mTargetPos = mTargetNode->GetWorldTranslation();	


	PVRTVec3 dir =  mBulletPos - mTargetPos;
	mBulletPos -= dir * 0.1f;

	float rotAngle = atan2f(dir.z, dir.x) + PVRT_PI*0.5f;


	static int randIndex = 0;
	const static float randTable[RAND_TABLE_SIZE] = {1,-4,3,-2,5,-3,6,-5,2,-3,4,-2,4,-5,5,-3,4,-5,6,-3};
	if (mNoisy)
    {
        rotAngle = rotAngle + 0.25f * randTable[randIndex++ % RAND_TABLE_SIZE] * (0.017453292f);
	}

	PVRTQUATERNION shooterQuat;
	PVRTMatrixQuaternionRotationAxis(shooterQuat, PVRTVec3(0,1,0),rotAngle);

	PVRTMATRIX shooterRotaionMtx;
	PVRTMatrixRotationQuaternion(shooterRotaionMtx, shooterQuat);

	PVRTMat4 mat(shooterRotaionMtx.f);
	PVRTVec4 zVec(0, 0 , 1.0f, 1.0f);
	zVec = mat * zVec;


/*
	if (mAutoAim)
	{
		mDir = mBulletPos - mTargetNode->GetWorldTranslation();
		mDir.normalize();
	}
*/	
	mDir.x = zVec.x;
	mDir.y = zVec.y;
	mDir.z = zVec.z;

	//mDir.z = 0;
	//mDir.x = -1;

	mModelData->GetRoot()->SetRotation(shooterQuat);

	mState = state_fly;

}