本文整理汇总了C++中IshipIGC::GetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ IshipIGC::GetPosition方法的具体用法?C++ IshipIGC::GetPosition怎么用?C++ IshipIGC::GetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IshipIGC
的用法示例。
在下文中一共展示了IshipIGC::GetPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: turnToFace
//------------------------------------------------------------------------------
void TurnToAction::Execute (void)
{
IshipIGC* pShip = static_cast<IshipIGC*> (static_cast<ImodelIGC*> (*m_pObject));
ImodelIGC* pTarget = static_cast<ImodelIGC*> (*m_pTarget);
if (pShip && pTarget)
{
Vector delta = pTarget->GetPosition () - pShip->GetPosition ();
turnToFace (delta, GetWindow ()->GetDeltaTime (), pShip, &g_setInputControls);
g_setInputControls.jsValues[c_axisYaw] *= 0.5f;
g_setInputControls.jsValues[c_axisPitch] *= 0.5f;
g_setInputControls.jsValues[c_axisRoll] *= 0.5f;
}
else
{
g_setInputControls.jsValues[c_axisYaw] = NA;
g_setInputControls.jsValues[c_axisPitch] = NA;
g_setInputControls.jsValues[c_axisRoll] = NA;
}
}
示例2: Goal
//------------------------------------------------------------------------------
Goal* Mission4::CreateGoal03 (void)
{
GoalList* pGoalList = new GoalList;
ImissionIGC* pMission = trekClient.GetCore ();
BuoyID buoyID = pMission->GenerateNewBuoyID ();
IshipIGC* pShip = trekClient.GetShip ();
// tm_4_07
// The last means of communication is to receive an order from
// your commander. I'm giving you a command to go to a
// waypoint.
pGoalList->AddGoal (CreatePlaySoundGoal (tm_4_07Sound));
// wait half second
pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
// tm_4_08
// This red text denotes an objective from the commander.
{
Goal* pGoal = CreatePlaySoundGoal (tm_4_08Sound);
IwarpIGC* pAleph = pMission->GetWarp (1030);
Vector delta = pAleph->GetPosition () - pShip->GetPosition ();
Vector position = pShip->GetPosition () + (delta * 0.25f) + (pAleph->GetOrientation ().GetUp () * (delta.Length () * 0.1f));
pGoal->AddStartAction (new CreateWaypointAction (buoyID, position, 1030));
pGoal->AddStartAction (new SetCommandAction (pShip, c_cmdQueued, OT_buoy, buoyID, c_cidGoto));
//pGoal->AddStartAction (new SetHUDOverlayAction (CommandTrainingOverlay));
pGoalList->AddGoal (pGoal);
}
// wait half second
pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
// tm_4_08r
// Press the INSERT key to accept this objective.
{
Goal* pGoal = new Goal (new GetCommandCondition (trekClient.GetShip (), c_cidGoto));
pGoal->AddStartAction (new MessageAction ("Press the INSERT key to accept the command."));
pGoal->AddStartAction (new PlaySoundAction (tm_4_08rSound));
pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_4_08rSound));
pGoalList->AddGoal (pGoal);
}
// wait a few seconds
pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (1.5f)));
// tm_4_09
// Good. Notice that autopilot is activated when you accept an
// objective to fly you to your goal.
{
Goal* pGoal = CreatePlaySoundGoal (tm_4_09Sound);
//pGoal->AddStartAction (new SetHUDOverlayAction (NoTrainingOverlay));
pGoalList->AddGoal (pGoal);
}
// (Wait for ship to get near waypoint)
{
Goal* pGoal = new Goal (new ObjectWithinRadiusCondition (static_cast<ImodelIGC*> (pShip), OT_buoy, buoyID, 100.0f));
pGoal->AddConstraintCondition (new ConditionalAction (new TrueCondition, new SetAutopilotAction (trekClient.GetShip (), true)));
pGoalList->AddGoal (pGoal);
}
return new Goal (pGoalList);
}