本文整理汇总了C++中Matrix34::GetColumn1方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix34::GetColumn1方法的具体用法?C++ Matrix34::GetColumn1怎么用?C++ Matrix34::GetColumn1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix34
的用法示例。
在下文中一共展示了Matrix34::GetColumn1方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFiringLocatorTM
bool CBurst::CBurstFiringLocator::GetFiringDir(EntityId weaponId, const IFireMode* pFireMode, Vec3& dir, const Vec3& probableHit, const Vec3& firingPos)
{
if (!HasValidFiringLocator())
return false;
Matrix34 fireHelperLocation = GetFiringLocatorTM();
dir = fireHelperLocation.GetColumn1();
return true;
}
示例2: Update
void CVehiclePartWaterRipplesGenerator::Update(const float frameTime)
{
//IVehicleMovement* pMovement = m_pVehicle->GetMovement();
const SVehicleStatus& status = m_pVehicle->GetStatus();
const bool movingFastEnough = (status.speed > m_minMovementSpeed);
if (movingFastEnough)
{
const Matrix34 vehicleWorldTM = m_pVehicle->GetEntity()->GetWorldTM();
// Check if moving backwards...
if (m_onlyMovingForward)
{
const float dotProduct = vehicleWorldTM.GetColumn1().Dot((status.vel / status.speed));
if (dotProduct < 0.0f)
return;
}
gEnv->pRenderer->EF_AddWaterSimHit( vehicleWorldTM.TransformPoint( m_localOffset ), m_waterRipplesScale, m_waterRipplesStrength );
}
}
示例3: GetLaserPositionAndDirection
//--------------------------------------------
void CLaser::GetLaserPositionAndDirection(CWeapon* pParentWeapon, Vec3& pos, Vec3& dir)
{
const char* entityLocationHelper = m_laserHelperFP.c_str();
const char* laserTermHelper = "laser_term";
const bool relative = false;
const bool absolute = true;
const int slot = pParentWeapon->IsOwnerFP() ? eIGS_FirstPerson : eIGS_ThirdPerson;
Matrix34 entityLocation =
Matrix34::CreateTranslationMat(pParentWeapon->GetSlotHelperPos(slot, entityLocationHelper, absolute)) *
pParentWeapon->GetSlotHelperRotation(slot, entityLocationHelper, absolute);
Matrix34 helperLocation =
Matrix34::CreateTranslationMat(GetSlotHelperPos(slot, laserTermHelper, relative)) *
GetSlotHelperRotation(slot, laserTermHelper, relative);
Matrix34 finalLocation = entityLocation * helperLocation;
pos = finalLocation.GetTranslation();
dir = finalLocation.GetColumn1();
}
示例4: Init
//------------------------------------------------------------------------
bool CVehicleViewFirstPerson::Init(IVehicleSeat* pISeat, const CVehicleParams& table)
{
CVehicleSeat* pSeat = static_cast<CVehicleSeat*>(pISeat);
if (!CVehicleViewBase::Init(pSeat, table))
return false;
if (CVehicleParams paramsTable = table.findChild(m_name))
{
paramsTable.getAttr("offset", m_offset);
paramsTable.getAttr("hidePlayer", m_hidePlayer);
paramsTable.getAttr("hideVehicle", m_hideVehicle);
paramsTable.getAttr("relativeToHorizon", m_relToHorizon);
paramsTable.getAttr("followSpeed", m_speedRot);
float viewFov;
if(paramsTable.getAttr("fov", viewFov))
{
m_fov = DEG2RAD(viewFov);
}
m_sCharacterBoneName = paramsTable.getAttr("characterBone");
string helperName = paramsTable.getAttr("helper");
if (!helperName.empty())
{
if (helperName != "auto")
{
m_pHelper = m_pVehicle->GetHelper(helperName);
}
else
{
// create a helper with default viewpos above sithelper
const string& seatName = pSeat->GetName();
helperName = seatName + string("_ghostview_pos");
if (IVehicleHelper* pSitHelper = pSeat->GetSitHelper())
{
Matrix34 tm;
pSitHelper->GetVehicleTM(tm);
Vec3 pos = tm.GetTranslation() + Vec3(0,0,0.625); // player eye height
m_pVehicle->AddHelper(helperName.c_str(), pos, tm.GetColumn1(), pSitHelper->GetParentPart());
m_pHelper = m_pVehicle->GetHelper(helperName.c_str());
}
}
if (!m_pHelper)
GameWarning("[%s, seat %s]: view helper %s not found, using character head", m_pVehicle->GetEntity()->GetName(), m_pSeat->GetName().c_str(), helperName.c_str());
}
string frame = paramsTable.getAttr("frameObject");
if (!frame.empty())
{
// todo: aspect ratio?
if (strstr(frame, ".cgf"))
m_frameSlot = m_pVehicle->GetEntity()->LoadGeometry(-1, frame);
else
m_frameSlot = m_pVehicle->GetEntity()->LoadCharacter(-1, frame);
if (m_frameSlot != -1)
{
m_pVehicle->GetEntity()->SetSlotFlags(m_frameSlot, m_pVehicle->GetEntity()->GetSlotFlags(m_frameSlot) &~ (ENTITY_SLOT_RENDER|ENTITY_SLOT_RENDER_NEAREST));
if (m_pHelper)
{
Matrix34 tm;
m_pHelper->GetVehicleTM(tm);
m_invFrame = tm.GetInverted();
m_pVehicle->GetEntity()->SetSlotLocalTM(m_frameSlot, tm);
}
}
}
paramsTable.getAttr("frameObjectOffset", m_frameObjectOffset);
}
if (m_hideVehicle)
m_hidePlayer = true;
if (m_speedRot==0.f)
{
m_speedRot = 4.0f;
if (IVehicleMovement* pMovement = m_pVehicle->GetMovement())
{
if (pMovement->GetMovementType() == IVehicleMovement::eVMT_Air)
{
m_speedRot *= 2.0f;
}
}
}
Reset();
return true;
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:98,代码来源:VehicleViewFirstPerson.cpp
示例5: Update
//.........这里部分代码省略.........
}
else
{
m_Angles.z = testTM.z;
}
Limit(m_Angles.z, -gf_PI * 0.33f, gf_PI * 0.33f);
mat2.SetRotationXYZ(m_Angles);
}
else
{
if (!m_FireBlocked)
{
m_Angles.x = m_Angles.x - ctx.fFrameTime * factor2 * m_Angles.x;
m_Angles.z = m_Angles.z - ctx.fFrameTime * factor2 * m_Angles.z;
}
mat2.SetRotationXYZ(m_Angles);
}
mat = mat * mat2;
GetEntity()->SetWorldTM(mat);
if (pl)
{
Matrix34 worldGunMat = vehicleWorldTm * localT;
if (!pl->IsDead())
{
Vec3 trans = worldGunMat.GetTranslation() - worldGunMat.GetColumn2() * 0.7f;
worldGunMat.SetTranslation(trans);
pl->GetEntity()->SetWorldTM(worldGunMat);
float dot = mat.GetColumn1().dot(worldGunMat.GetColumn0());
Update3PAnim(pl, 0.5f - dot * 0.5f, ctx.fFrameTime, mat);
}
else
{
ICharacterInstance* pCharacter = pl->GetEntity()->GetCharacter(0);
int boneId = pCharacter ? pCharacter->GetIDefaultSkeleton().GetJointIDByName("Spine03") : 7;
pl->LinkToMountedWeapon(0);
if (IVehicleSeat* seat = pVehicle->GetSeatForPassenger(pl->GetEntityId()))
{
seat->Exit(false, true);
}
Matrix33 rot(worldGunMat);
Vec3 offset(0.0f, 0.0f, 0.70f);
Vec3 transformedOff = rot.TransformVector(offset);
Vec3 trans = worldGunMat.GetTranslation();
trans -= transformedOff;
worldGunMat.SetTranslation(trans);
pl->GetEntity()->SetWorldTM(worldGunMat);
pl->GetEntity()->SetPos(worldGunMat.GetTranslation()); //worldGunMat.GetTranslation());
pl->RagDollize(true);
if (boneId > -1)
{
IPhysicalEntity *physEnt = pl->GetEntity()->GetPhysics();
if (physEnt)
{
pe_simulation_params simulationParams;
physEnt->GetParams(&simulationParams);
pe_params_pos pos;
pos.pos = GetEntity()->GetPos();
physEnt->SetParams(&pos);
pe_action_impulse impulse;
impulse.ipart = boneId;
impulse.angImpulse = Vec3(0.0f, 0.0f, 1.0f);
impulse.impulse = worldGunMat.GetColumn1() * -1.5f * simulationParams.mass;
physEnt->Action(&impulse);
}
}
StopUse(GetOwnerId());
SetOwnerId(0);
StopFire();
m_FireBlocked = true;
} // IsDead
} // pl
} // pose
} // characterInst
} // pParentPart
} // pPart
} // pVehicle
Base::Update(ctx, update);
RequireUpdate(eIUS_General);
}