您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetOwner函数代码示例

51自学网 2021-06-01 21:12:06
  C++
这篇教程C++ GetOwner函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetOwner函数的典型用法代码示例。如果您正苦于以下问题:C++ GetOwner函数的具体用法?C++ GetOwner怎么用?C++ GetOwner使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetOwner函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetOwner

/// <summary> Sets the world value the Actor is in </summary>/// <returns> True if the world was found, false if it was not loaded yet </returns>bool UMovementTracker::GetActorWorld(){	World = GetOwner()->GetWorld();	return World != NULL;}
开发者ID:ponchoa,项目名称:PathTracer,代码行数:7,


示例2: addItemByClass

bool UInventoryComponent::addItemByClass(TSubclassOf<UItemBase> item, int32 ammount, bool forceNew ){	UItemBase* x = NewObject<UItemBase>(this, item);	x->initialize(GetOwner()->GetWorld());	return addItem(x);}
开发者ID:Reyfin,项目名称:UE4,代码行数:6,


示例3: GetOwner

FVector USmartNavLinkComponent::GetEndPoint() const{	return GetOwner()->GetTransform().TransformPosition(LinkRelativeEnd);}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:4,


示例4: Initialize

func Initialize(){	SetAction("Travel");	SetRDir(10);	SetObjectLayer(nil);	//AddEffect("MoveTo", this, 1, 1, this);		ox=GetX();	oy=GetY();		rangedummy = CreateObject(Dummy, 0, 0, GetOwner());	rangedummy.Visibility = VIS_Owner;	rangedummy->SetAction("HangOnto", this);		var props =		{			R = 255,			G = 0,			B = 0,			Alpha = 40,			Size = 70,			BlitMode = GFX_BLIT_Additive,			Rotation = PV_Step(10, 0, 1),			Attach = ATTACH_Back | ATTACH_MoveRelative					};	rangedummy->CreateParticle("Shockwave2", 0, 0, 0, 0, 0, props, 1);		moveparticle =	{		Alpha = 100,		Size = AttackSize * 2,		R = pR,		G = pG,		B = pB,		Rotation = PV_Random(0,360),		BlitMode = GFX_BLIT_Additive,	};		moveparticle2 =	{		Size = PV_Linear(2,0),		BlitMode = GFX_BLIT_Additive,		R = pR,		G = pG,		B = pB,		Attach=ATTACH_Back,	};		movetrailparticles =	{		Size = PV_Linear(5,0),		BlitMode = GFX_BLIT_Additive,		R = pR,		G = pG,		B = pB,		Attach=ATTACH_Back,	};		followtrailparticles =	{		Size = PV_Linear(5,0),		BlitMode = GFX_BLIT_Additive,		R = 50,		G = 50,		B = 50,		Attach=ATTACH_Back,	};		hometrailparticles =	{		Size = PV_Linear(5,0),		BlitMode = GFX_BLIT_Additive,		R = 0,		G = 255,		B = 255,		Attach=ATTACH_Back,	};		hometrailparticles2 =	{		Size = PV_Linear(2,0),		BlitMode = GFX_BLIT_Additive,		R = 0,		G = 255,		B = 255,		Attach=ATTACH_Back,	};		}
开发者ID:MDT-Maikel,项目名称:Knueppeln-Mod,代码行数:90,


示例5: GetOwner

void Item::SetFakeEntry(uint32 entry) // custom{    GetOwner()->UpdateUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (GetSlot() * 2), entry);    sObjectMgr->_itemFakeEntryStore[GetGUIDLow()] = entry;    CharacterDatabase.PExecute("REPLACE INTO custom_transmogrification (GUID, FakeEntry) VALUES (%u, %u)", GetGUIDLow(), entry);}
开发者ID:jacobmain1,项目名称:ApocalypseCore,代码行数:6,


示例6: GetOwner

void Guardian::SetBonusDamage(int32 damage){    m_bonusSpellDamage = damage;    if (GetOwner()->GetTypeId() == TYPEID_PLAYER)        GetOwner()->SetUInt32Value(PLAYER_PET_SPELL_POWER, damage);}
开发者ID:Lbniese,项目名称:WoWCircle434,代码行数:6,


示例7: switch

void GameObject::Update(uint32 /*p_time*/){    if (IS_MO_TRANSPORT(GetGUID()))    {        //((Transport*)this)->Update(p_time);        return;    }    switch (m_lootState)    {        case GO_NOT_READY:        {            switch(GetGoType())            {                case GAMEOBJECT_TYPE_TRAP:                {                    // Arming Time for GAMEOBJECT_TYPE_TRAP (6)                    Unit* owner = GetOwner();                    if (owner && ((Player*)owner)->isInCombat())                        m_cooldownTime = time(NULL) + GetGOInfo()->trap.startDelay;                    m_lootState = GO_READY;                    break;                }                case GAMEOBJECT_TYPE_FISHINGNODE:                {                    // fishing code (bobber ready)                    if( time(NULL) > m_respawnTime - FISHING_BOBBER_READY_TIME )                    {                        // splash bobber (bobber ready now)                        Unit* caster = GetOwner();                        if(caster && caster->GetTypeId()==TYPEID_PLAYER)                        {                            SetGoState(GO_STATE_ACTIVE);                            SetUInt32Value(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);                            UpdateData udata;                            WorldPacket packet;                            BuildValuesUpdateBlockForPlayer(&udata,((Player*)caster));                            udata.BuildPacket(&packet);                            ((Player*)caster)->GetSession()->SendPacket(&packet);                            WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4);                            data << GetGUID();                            data << (uint32)(0);                            ((Player*)caster)->SendMessageToSet(&data,true);                        }                        m_lootState = GO_READY;                 // can be successfully open with some chance                    }                    return;                }                default:                    m_lootState = GO_READY;                         // for other GOis same switched without delay to GO_READY                    break;            }            // NO BREAK for switch (m_lootState)        }        case GO_READY:        {            if (m_respawnTime > 0)                          // timer on            {                if (m_respawnTime <= time(NULL))            // timer expired                {                    m_respawnTime = 0;                    m_SkillupList.clear();                    m_usetimes = 0;                    switch (GetGoType())                    {                        case GAMEOBJECT_TYPE_FISHINGNODE:   //  can't fish now                        {                            Unit* caster = GetOwner();                            if(caster && caster->GetTypeId()==TYPEID_PLAYER)                            {                                caster->FinishSpell(CURRENT_CHANNELED_SPELL);                                WorldPacket data(SMSG_FISH_NOT_HOOKED,0);                                ((Player*)caster)->GetSession()->SendPacket(&data);                            }                            // can be delete                            m_lootState = GO_JUST_DEACTIVATED;                            return;                        }                        case GAMEOBJECT_TYPE_DOOR:                        case GAMEOBJECT_TYPE_BUTTON:                            //we need to open doors if they are closed (add there another condition if this code breaks some usage, but it need to be here for battlegrounds)                            if (GetGoState() != GO_STATE_READY)                                ResetDoorOrButton();                            //flags in AB are type_button and we need to add them here so no break!                        default:                            if (!m_spawnedByDefault)        // despawn timer                            {                                                            // can be despawned or destroyed                                SetLootState(GO_JUST_DEACTIVATED);                                return;                            }                                                            // respawn timer                            uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);                            if (poolid)                                sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);//.........这里部分代码省略.........
开发者ID:wk23,项目名称:tst,代码行数:101,


示例8: Reload

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CWeaponCrossbow::FireBolt( void ){	if ( m_iClip1 <= 0 )	{		if ( !m_bFireOnEmpty )		{			Reload();		}		else		{			WeaponSound( EMPTY );			m_flNextPrimaryAttack = 0.15;		}		return;	}	CBasePlayer *pOwner = ToBasePlayer( GetOwner() );		if ( pOwner == NULL )		return;#ifndef CLIENT_DLL	Vector vecAiming	= pOwner->GetAutoaimVector( 0 );		Vector vecSrc		= pOwner->Weapon_ShootPosition();	QAngle angAiming;	VectorAngles( vecAiming, angAiming );	CCrossbowBolt *pBolt = CCrossbowBolt::BoltCreate( vecSrc, angAiming, GetHL2MPWpnData().m_iPlayerDamage, pOwner );	if ( pOwner->GetWaterLevel() == 3 )	{		pBolt->SetAbsVelocity( vecAiming * BOLT_WATER_VELOCITY );	}	else	{		pBolt->SetAbsVelocity( vecAiming * BOLT_AIR_VELOCITY );	}#endif	m_iClip1--;	pOwner->ViewPunch( QAngle( -2, 0, 0 ) );	WeaponSound( SINGLE );	WeaponSound( SPECIAL2 );	SendWeaponAnim( ACT_VM_PRIMARYATTACK );	if ( !m_iClip1 && pOwner->GetAmmoCount( m_iPrimaryAmmoType ) <= 0 )	{		// HEV suit - indicate out of ammo condition		pOwner->SetSuitUpdate("!HEV_AMO0", FALSE, 0);	}	m_flNextPrimaryAttack = m_flNextSecondaryAttack	= gpGlobals->curtime + 0.75;	DoLoadEffect();	SetChargerState( CHARGER_STATE_DISCHARGE );}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:65,


示例9: GetStat

void Guardian::UpdateAttackPowerAndDamage(bool ranged){    if (ranged)        return;    float val = 0.0f;    float bonusAP = 0.0f;    UnitMods unitMod = UNIT_MOD_ATTACK_POWER;    if (GetEntry() == ENTRY_IMP)                                   // imp's attack power        val = GetStat(STAT_STRENGTH) - 10.0f;    else        val = 2 * GetStat(STAT_STRENGTH) - 20.0f;    Unit* owner = GetOwner();    if (owner && owner->GetTypeId() == TYPEID_PLAYER)    {        if (IsHunterPet())                      //hunter pets benefit from owner's attack power        {            float mod = 1.0f;                                                 //Hunter contribution modifier            bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod;            SetBonusDamage(int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod));        }        else if (IsPetGhoul()) //ghouls benefit from deathknight's attack power (may be summon pet or not)        {            bonusAP = owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.22f;            SetBonusDamage(int32(owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.1287f));        }        else if (IsSpiritWolf()) //wolf benefit from shaman's attack power        {            float dmg_multiplier = 0.31f;            if (m_owner->GetAuraEffect(63271, 0)) // Glyph of Feral Spirit                dmg_multiplier = 0.61f;            bonusAP = owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier;            SetBonusDamage(int32(owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier));        }        //demons benefit from warlocks shadow or fire damage        else if (IsPet())        {            int32 fire  = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);            int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);            int32 maximum  = (fire > shadow) ? fire : shadow;            if (maximum < 0)                maximum = 0;            SetBonusDamage(int32(maximum * 0.15f));            bonusAP = maximum * 0.57f;        }        //water elementals benefit from mage's frost damage        else if (GetEntry() == ENTRY_WATER_ELEMENTAL)        {            int32 frost = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST);            if (frost < 0)                frost = 0;            SetBonusDamage(int32(frost * 0.4f));        }    }    SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, val + bonusAP);    //in BASE_VALUE of UNIT_MOD_ATTACK_POWER for creatures we store data of meleeattackpower field in DB    float base_attPower  = GetModifierValue(unitMod, BASE_VALUE) * GetModifierValue(unitMod, BASE_PCT);    float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;    //UNIT_FIELD_(RANGED)_ATTACK_POWER field    SetInt32Value(UNIT_FIELD_ATTACK_POWER, (int32)base_attPower);    //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field    SetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER, attPowerMultiplier);    //automatically update weapon damage after attack power modification    UpdateDamagePhysical(BASE_ATTACK);}
开发者ID:AnthoDevMoP,项目名称:Pandaren5.3.0,代码行数:71,


示例10: degrees

void wxSVGFileDCImpl::DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea){    /*    Draws an arc of an ellipse. The current pen is used for drawing the arc    and the current brush is used for drawing the pie.    x and y specify the x and y coordinates of the upper-left corner of the    rectangle that contains the ellipse.    width and height specify the width and height of the rectangle that    contains the ellipse.    start and end specify the start and end of the arc relative to the    three-o'clock position from the center of the rectangle. Angles are    specified in degrees (360 is a complete circle). Positive values mean    counter-clockwise motion. If start is equal to end, a complete ellipse    will be drawn. */    //radius    double rx = w / 2.0;    double ry = h / 2.0;    // center    double xc = x + rx;    double yc = y + ry;    // start and end coords    double xs, ys, xe, ye;    xs = xc + rx * cos (wxDegToRad(sa));    xe = xc + rx * cos (wxDegToRad(ea));    ys = yc - ry * sin (wxDegToRad(sa));    ye = yc - ry * sin (wxDegToRad(ea));    // svg arcs have 0 degrees at 12-o'clock instead of 3-o'clock    double start = (sa - 90);    if (start < 0)        start += 360;    while (abs(start) > 360)        start -= (start / abs(start)) * 360;    double end = (ea - 90);    if (end < 0)        end += 360;    while (abs(end) > 360)        end -= (end / abs(end)) * 360;    // svg arcs are in clockwise direction, reverse angle    double angle = end - start;    if (angle <= 0)        angle += 360;    int fArc = angle > 180 ? 1 : 0; // flag for large or small arc    int fSweep = 0;                 // flag for sweep always 0    wxString arcPath;    if (angle == 360)    {        // Drawing full circle fails with default arc. Draw two half arcs instead.        fArc = 1;        arcPath = wxString::Format(wxS("  <path d=/"M%s %s a%s %s 0 %d %d %s %s a%s %s 0 %d %d %s %s"),            NumStr(x), NumStr(y + ry),            NumStr(rx), NumStr(ry), fArc, fSweep, NumStr( rx * 2), NumStr(0),            NumStr(rx), NumStr(ry), fArc, fSweep, NumStr(-rx * 2), NumStr(0));    }    else    {        arcPath = wxString::Format(wxS("  <path d=/"M%s %s A%s %s 0 %d %d %s %s"),            NumStr(xs), NumStr(ys),            NumStr(rx), NumStr(ry), fArc, fSweep, NumStr(xe), NumStr(ye));    }    // Workaround so SVG does not draw an extra line from the centre of the drawn arc    // to the start point of the arc.    // First draw the arc with the current brush, without a border,    // then draw the border without filling the arc.    if (GetBrush().GetStyle() != wxBRUSHSTYLE_TRANSPARENT)    {        wxDCPenChanger setTransp(*GetOwner(), *wxTRANSPARENT_PEN);        NewGraphicsIfNeeded();        wxString arcFill = arcPath;        arcFill += wxString::Format(wxS(" L%s %s z"), NumStr(xc), NumStr(yc));        arcFill += wxS("/"/>/n");        write(arcFill);    }    wxDCBrushChanger setTransp(*GetOwner(), *wxTRANSPARENT_BRUSH);    NewGraphicsIfNeeded();    wxString arcLine = arcPath + wxS("/"/>/n");    write(arcLine);}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:91,


示例11: ToBasePlayer

//-----------------------------------------------------------------------------// Purpose: // Output : float//-----------------------------------------------------------------------------float CBaseHLCombatWeapon::CalcViewmodelBob( void ){	static	float bobtime;	static	float lastbobtime;	float	cycle;		CBasePlayer *player = ToBasePlayer( GetOwner() );	//Assert( player );	//NOTENOTE: For now, let this cycle continue when in the air, because it snaps badly without it	if ( ( !gpGlobals->frametime ) || ( player == NULL ) )	{		//NOTENOTE: We don't use this return value in our case (need to restructure the calculation function setup!)		return 0.0f;// just use old value	}	//Find the speed of the player	float speed = player->GetLocalVelocity().Length2D();	//FIXME: This maximum speed value must come from the server.	//		 MaxSpeed() is not sufficient for dealing with sprinting - jdw	speed = clamp( speed, -320, 320 );	float bob_offset = RemapVal( speed, 0, 320, 0.0f, 1.0f );		bobtime += ( gpGlobals->curtime - lastbobtime ) * bob_offset;	lastbobtime = gpGlobals->curtime;	//Calculate the vertical bob	cycle = bobtime - (int)(bobtime/HL2_BOB_CYCLE_MAX)*HL2_BOB_CYCLE_MAX;	cycle /= HL2_BOB_CYCLE_MAX;	if ( cycle < HL2_BOB_UP )	{		cycle = M_PI * cycle / HL2_BOB_UP;	}	else	{		cycle = M_PI + M_PI*(cycle-HL2_BOB_UP)/(1.0 - HL2_BOB_UP);	}		g_verticalBob = speed*0.005f;	g_verticalBob = g_verticalBob*0.3 + g_verticalBob*0.7*sin(cycle);	g_verticalBob = clamp( g_verticalBob, -7.0f, 4.0f );	//Calculate the lateral bob	cycle = bobtime - (int)(bobtime/HL2_BOB_CYCLE_MAX*2)*HL2_BOB_CYCLE_MAX*2;	cycle /= HL2_BOB_CYCLE_MAX*2;	if ( cycle < HL2_BOB_UP )	{		cycle = M_PI * cycle / HL2_BOB_UP;	}	else	{		cycle = M_PI + M_PI*(cycle-HL2_BOB_UP)/(1.0 - HL2_BOB_UP);	}	g_lateralBob = speed*0.005f;	g_lateralBob = g_lateralBob*0.3 + g_lateralBob*0.7*sin(cycle);	g_lateralBob = clamp( g_lateralBob, -7.0f, 4.0f );		//NOTENOTE: We don't use this return value in our case (need to restructure the calculation function setup!)	return 0.0f;}
开发者ID:BerntA,项目名称:tfo-code,代码行数:72,


示例12: NewGraphicsIfNeeded

void wxSVGFileDCImpl::DoDrawRotatedText(const wxString& sText, wxCoord x, wxCoord y, double angle){    //known bug; if the font is drawn in a scaled DC, it will not behave exactly as wxMSW    NewGraphicsIfNeeded();    wxString s;    // Get extent of whole text.    wxCoord w, h, heightLine;    GetOwner()->GetMultiLineTextExtent(sText, &w, &h, &heightLine);    // Compute the shift for the origin of the next line.    const double rad = wxDegToRad(angle);    const double dx = heightLine * sin(rad);    const double dy = heightLine * cos(rad);    // wxS("upper left") and wxS("upper right")    CalcBoundingBox(x, y);    CalcBoundingBox((wxCoord)(x + w*cos(rad)), (wxCoord)(y - h*sin(rad)));    // wxS("bottom left") and wxS("bottom right")    CalcBoundingBox((wxCoord)(x + h*sin(rad)), (wxCoord)(y + h*cos(rad)));    CalcBoundingBox((wxCoord)(x + h*sin(rad) + w*cos(rad)), (wxCoord)(y + h*cos(rad) - w*sin(rad)));    if (m_backgroundMode == wxBRUSHSTYLE_SOLID)    {        // draw background first        // just like DoDrawRectangle except we pass the text color to it and set the border to a 1 pixel wide text background        s += wxString::Format(wxS("  <rect x=/"%d/" y=/"%d/" width=/"%d/" height=/"%d/" "), x, y, w, h);        s += wxS("style=/"") + wxBrushString(m_textBackgroundColour);        s += wxS("stroke-width:1; ") + wxPenString(m_textBackgroundColour);        s += wxString::Format(wxS("/" transform=/"rotate(%s %d %d)/"/>"), NumStr(-angle), x, y);        s += wxS("/n");        write(s);    }    // Draw all text line by line    const wxArrayString lines = wxSplit(sText, '/n', '/0');    for (size_t lineNum = 0; lineNum < lines.size(); lineNum++)    {        // convert x,y to SVG text x,y (the coordinates of the text baseline)        wxCoord ww, hh, desc;        DoGetTextExtent(lines[lineNum], &ww, &hh, &desc);        int xx = x + wxRound(lineNum * dx) + (hh - desc) * sin(rad);        int yy = y + wxRound(lineNum * dy) + (hh - desc) * cos(rad);        //now do the text itself        s += wxString::Format(wxS("  <text x=/"%d/" y=/"%d/" textLength=/"%d/" "), xx, yy, ww);        wxString fontName(m_font.GetFaceName());        if (fontName.Len() > 0)            s += wxS("style=/"font-family:") + fontName + wxS("; ");        else            s += wxS("style=/" ");        wxString fontweight;        switch (m_font.GetWeight())        {            case wxFONTWEIGHT_MAX:                wxFAIL_MSG(wxS("invalid font weight value"));                wxFALLTHROUGH;            case wxFONTWEIGHT_NORMAL:                fontweight = wxS("normal");                break;            case wxFONTWEIGHT_LIGHT:                fontweight = wxS("lighter");                break;            case wxFONTWEIGHT_BOLD:                fontweight = wxS("bold");                break;        }        wxASSERT_MSG(!fontweight.empty(), wxS("unknown font weight value"));        s += wxS("font-weight:") + fontweight + wxS("; ");        wxString fontstyle;        switch (m_font.GetStyle())        {            case wxFONTSTYLE_MAX:                wxFAIL_MSG(wxS("invalid font style value"));                wxFALLTHROUGH;            case wxFONTSTYLE_NORMAL:                fontstyle = wxS("normal");                break;            case wxFONTSTYLE_ITALIC:                fontstyle = wxS("italic");                break;            case wxFONTSTYLE_SLANT:                fontstyle = wxS("oblique");                break;        }        wxASSERT_MSG(!fontstyle.empty(), wxS("unknown font style value"));//.........这里部分代码省略.........
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:101,


示例13: MOZ_ASSERT

nsresultUDPSocket::Init(const nsString& aLocalAddress,                const Nullable<uint16_t>& aLocalPort,                const bool& aAddressReuse,                const bool& aLoopback){    MOZ_ASSERT(!mSocket && !mSocketChild);    mLocalAddress = aLocalAddress;    mLocalPort = aLocalPort;    mAddressReuse = aAddressReuse;    mLoopback = aLoopback;    ErrorResult rv;    nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());    mOpened = Promise::Create(global, rv);    if (NS_WARN_IF(rv.Failed())) {        return rv.ErrorCode();    }    mClosed = Promise::Create(global, rv);    if (NS_WARN_IF(rv.Failed())) {        return rv.ErrorCode();    }    class OpenSocketRunnable final : public nsRunnable    {    public:        explicit OpenSocketRunnable(UDPSocket* aSocket) : mSocket(aSocket)        { }        NS_IMETHOD Run() override        {            MOZ_ASSERT(mSocket);            if (mSocket->mReadyState != SocketReadyState::Opening) {                return NS_OK;            }            uint16_t localPort = 0;            if (!mSocket->mLocalPort.IsNull()) {                localPort = mSocket->mLocalPort.Value();            }            nsresult rv;            if (XRE_GetProcessType() != GoannaProcessType_Default) {                rv = mSocket->InitRemote(mSocket->mLocalAddress, localPort);            } else {                rv = mSocket->InitLocal(mSocket->mLocalAddress, localPort);            }            if (NS_WARN_IF(NS_FAILED(rv))) {                mSocket->CloseWithReason(NS_ERROR_DOM_NETWORK_ERR);            }            return NS_OK;        }    private:        nsRefPtr<UDPSocket> mSocket;    };    nsCOMPtr<nsIRunnable> runnable = new OpenSocketRunnable(this);    return NS_DispatchToMainThread(runnable);}
开发者ID:Antonius32,项目名称:Pale-Moon,代码行数:67,


示例14: DrawNthPath

/// <summary> Draws one of the paths using one list from each list of lists </summary>/// <param name="n"> The position, in each list of lists, of the list with the values for this path </param>void UMovementTracker::DrawNthPath(size_t n){	//Checks if there is no mistake in the different lists	if (VectorList[n].Num() == TimeList[n].Num() && TimeList[n].Num() == NameList[n].Num())	{		//previous tells us if the previous point was drawn. It allows us to know if a line needs to be drawn between the points		//but also tells us when the path's beginning was. It allows us to start at that point next update to save on resources.		bool previous = false;		for (size_t i = PathStartArray[n]; i < VectorList[n].Num(); i++)		{			if ((TimeLength <= 0 || TimeList[n][i] >= ElapsedTime - TimeLength) && TimeList[n][i] <= ElapsedTime && NameList[n][i] == GetOwner()->GetName())			{				DrawDebugPoint(World, VectorList[n][i], 20.0f, FColor(255, 0, 0));				if (previous) //Draw the line between the previous point and this one					DrawDebugLine(World, VectorList[n][i - 1], VectorList[n][i], FColor(0, 0, 255), false, -1.0f, (uint8)'/000', 5.0f);				else //Sets the start of next update's sweep					PathStartArray[n] = i;				previous = true;			}			else			{				previous = false;				if (previous) //We are at the end of the path that we want to draw, no need to continue checking the rest of the path					break;			}		}	}}
开发者ID:ponchoa,项目名称:PathTracer,代码行数:30,


示例15: AbortMove

void UCrowdFollowingComponent::UpdatePathSegment(){	if (!bEnableCrowdSimulation)	{		Super::UpdatePathSegment();		return;	}	if (!Path.IsValid() || MovementComp == NULL)	{		AbortMove(TEXT("no path"), FAIRequestID::CurrentRequest, true, false, EPathFollowingMessage::NoPath);		return;	}	if (!Path->IsValid())	{		if (!Path->IsWaitingForRepath())		{			AbortMove(TEXT("no path"), FAIRequestID::CurrentRequest, true, false, EPathFollowingMessage::NoPath);		}		return;	}	// if agent has control over its movement, check finish conditions	const bool bCanReachTarget = MovementComp->CanStopPathFollowing();	if (bCanReachTarget && Status == EPathFollowingStatus::Moving)	{		const FVector CurrentLocation = MovementComp->GetActorFeetLocation();		const FVector GoalLocation = GetCurrentTargetLocation();		if (bFinalPathPart)		{			const FVector ToTarget = (GoalLocation - MovementComp->GetActorFeetLocation());			const bool bDirectPath = Path->CastPath<FAbstractNavigationPath>() != NULL;			const float SegmentDot = FVector::DotProduct(ToTarget, bDirectPath ? MovementComp->Velocity : CrowdAgentMoveDirection);			const bool bMovedTooFar = bCheckMovementAngle && (SegmentDot < 0.0);			// can't use HasReachedDestination here, because it will use last path point			// which is not set correctly for partial paths without string pulling			if (bMovedTooFar || HasReachedInternal(GoalLocation, 0.0f, 0.0f, CurrentLocation, AcceptanceRadius, bStopOnOverlap))			{				UE_VLOG(GetOwner(), LogCrowdFollowing, Log, TEXT("Last path segment finished due to /'%s/'"), bMovedTooFar ? TEXT("Missing Last Point") : TEXT("Reaching Destination"));				OnPathFinished(EPathFollowingResult::Success);			}		}		else		{			// override radius multiplier and switch to next path part when closer than 4x agent radius			const float SavedAgentRadiusPct = MinAgentRadiusPct;			MinAgentRadiusPct = 4.0f;						const bool bHasReached = HasReachedInternal(GoalLocation, 0.0f, 0.0f, CurrentLocation, 0.0f, false);						MinAgentRadiusPct = SavedAgentRadiusPct;			if (bHasReached)			{				SwitchToNextPathPart();			}		}	}	// gather location samples to detect if moving agent is blocked	if (bCanReachTarget && Status == EPathFollowingStatus::Moving)	{		const bool bHasNewSample = UpdateBlockDetection();		if (bHasNewSample && IsBlocked())		{			OnPathFinished(EPathFollowingResult::Blocked);		}	}}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:72,


示例16: GetTotalStatValue

bool Guardian::UpdateStats(Stats stat){    if (stat >= MAX_STATS)        return false;    // value = ((base_value * base_pct) + total_value) * total_pct    float value  = GetTotalStatValue(stat);    ApplyStatBuffMod(stat, m_statFromOwner[stat], false);    float ownersBonus = 0.0f;    Unit* owner = GetOwner();    // Handle Death Knight Glyphs and Talents    float mod = 0.75f;    if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH))    {        switch (stat)        {            case STAT_STAMINA:  mod = 0.3f; break;                // Default Owner's Stamina scale            case STAT_STRENGTH: mod = 0.7f; break;                // Default Owner's Strength scale            default: break;        }        // Check just if owner has Ravenous Dead since it's effect is not an aura        AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);        if (aurEff)        {            SpellInfo const* spellInfo = aurEff->GetSpellInfo();                                                 // Then get the SpellProto and add the dummy effect value            AddPct(mod, spellInfo->Effects[EFFECT_1].CalcValue(owner));                                              // Ravenous Dead edits the original scale        }        // Glyph of the Ghoul        aurEff = owner->GetAuraEffect(58686, 0);        if (aurEff)            mod += CalculatePct(1.0f, aurEff->GetAmount());                                                    // Glyph of the Ghoul adds a flat value to the scale mod        ownersBonus = float(owner->GetStat(stat)) * mod;        value += ownersBonus;    }    else if (stat == STAT_STAMINA)    {        ownersBonus = CalculatePct(owner->GetStat(STAT_STAMINA), 30);        value += ownersBonus;    }                                                            //warlock's and mage's pets gain 30% of owner's intellect    else if (stat == STAT_INTELLECT)    {        if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)        {            ownersBonus = CalculatePct(owner->GetStat(stat), 30);            value += ownersBonus;        }    }/*    else if (stat == STAT_STRENGTH)    {        if (IsPetGhoul())            value += float(owner->GetStat(stat)) * 0.3f;    }*/    SetStat(stat, int32(value));    m_statFromOwner[stat] = ownersBonus;    ApplyStatBuffMod(stat, m_statFromOwner[stat], true);    switch (stat)    {        case STAT_STRENGTH:         UpdateAttackPowerAndDamage();        break;        case STAT_AGILITY:          UpdateArmor();                       break;        case STAT_STAMINA:          UpdateMaxHealth();                   break;        case STAT_INTELLECT:        UpdateMaxPower(POWER_MANA);          break;        case STAT_SPIRIT:        default:            break;    }    return true;}
开发者ID:AnthoDevMoP,项目名称:Pandaren5.3.0,代码行数:75,


示例17: wxDoFloodFill

bool wxGTKCairoDCImpl::DoFloodFill(int x, int y, const wxColour& col, wxFloodFillStyle style){    return wxDoFloodFill(GetOwner(), x, y, col, style);}
开发者ID:iokto,项目名称:newton-dynamics,代码行数:4,


示例18: GetOwner

boolIDBFileHandle::CheckWindow(){  return GetOwner();}
开发者ID:LordJZ,项目名称:gecko-dev,代码行数:5,


示例19: GetTotalStatValue

bool Guardian::UpdateStats(Stats stat){    if (stat >= MAX_STATS)        return false;    // value = ((base_value * base_pct) + total_value) * total_pct    float value  = GetTotalStatValue(stat);    ApplyStatBuffMod(stat, m_statFromOwner[stat], false);    float ownersBonus = 0.0f;    Unit* owner = GetOwner();        float mod = 0.75f;    switch (stat)    {        case STAT_STRENGTH:        {            if (IsPetGhoul())            {                mod = 0.7f;                                // Glyph of the Ghoul                if (AuraEffect const* aurEff = owner->GetAuraEffect(58686, 0))                    mod += CalculatePct(1.0f, aurEff->GetAmount());                ownersBonus = owner->GetStat(stat) * mod;                value += ownersBonus;            }            break;        }        case STAT_STAMINA:        {            mod = 0.0f;            if (IsPetGhoul() || IsPetGargoyle())            {                // Glyph of the Ghoul                if (AuraEffect const* aurEff = owner->GetAuraEffect(58686, 0))                    mod += CalculatePct(1.0f, aurEff->GetAmount());             }            ownersBonus = owner->GetStat(stat) * mod;            ownersBonus *= GetModifierValue(UNIT_MOD_STAT_STAMINA, TOTAL_PCT);            value += ownersBonus;            break;        }        case STAT_INTELLECT:        {            if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)            {                mod = 0.3f;                ownersBonus = owner->GetStat(stat) * mod;            }            else if (owner->getClass() == CLASS_DEATH_KNIGHT && GetEntry() == 31216)            {                mod = 0.3f;                if (owner->getSimulacrumTarget())                    ownersBonus = owner->getSimulacrumTarget()->GetStat(stat) * mod;                else                    ownersBonus = owner->GetStat(stat) * mod;            }            value += ownersBonus;            break;        }    }    SetStat(stat, int32(value));    m_statFromOwner[stat] = ownersBonus;    ApplyStatBuffMod(stat, m_statFromOwner[stat], true);    switch (stat)    {        case STAT_STRENGTH:         UpdateAttackPowerAndDamage();        break;        case STAT_AGILITY:          UpdateArmor();                       break;        case STAT_STAMINA:          UpdateMaxHealth();                   break;        case STAT_INTELLECT:            UpdateMaxPower(POWER_MANA);            if (isPet() && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE))                UpdateAttackPowerAndDamage();             break;        case STAT_SPIRIT:        default:            break;    }    return true;}
开发者ID:Lbniese,项目名称:WoWCircle434,代码行数:87,


示例20: GetTemplate

ItemTemplate const* Item::GetTemplate() const{    if (GetOwner() && GetOwner()->InArena())        return sObjectMgr->GetItemTemplate(GetPermittedItemInArena());    return sObjectMgr->GetItemTemplate(GetEntry());}
开发者ID:Allowed,项目名称:Strawberry335,代码行数:6,


示例21: GetOwner

//------------------------------------------------------------------------void CItem::FixResourceName(const ItemString& inName, TempResourceName& name, int flags, const char *hand, const char *suffix, const char *pose, const char *pov, const char *env){	// the whole thing of fixing is not nice, but at least we don't allocate too often	// StringHelper<TempResourceName::SIZE> name (inName.c_str(), inName.length());	name.assign(inName.c_str(), inName.length());	if (!hand)	{		if (m_stats.hand == eIH_Left)			hand = "left";		else			hand = "right";	}	name.replace("%hand%", hand);	if (m_stats.hand == eIH_Left)		name.replace("%offhand%", "right");	else		name.replace("%offhand%", "left");	if (!suffix)		suffix = m_actionSuffix.c_str();	name.replace("%suffix%", suffix);	if (!pose)	{		if (!m_sharedparams->params.pose.empty())			pose = m_sharedparams->params.pose.c_str();		else			pose = "";	}	name.replace("%pose%", "");	if (!pov)	{		if ((m_stats.fp || flags&eIPAF_ForceFirstPerson) && !(flags&eIPAF_ForceThirdPerson))			pov = ITEM_FIRST_PERSON_TOKEN;		else			pov = ITEM_THIRD_PERSON_TOKEN;	}	name.replace("%pov%", pov);	if (!env)	{		// Instead if the weapons sound proxy, the owners is used to retrieve the tail name		IEntity* pOwner = GetOwner();		if (GetIWeapon() && pOwner) // restricting to weapon sounds only		{			if (pOwner)			{				IEntitySoundProxy *pSoundProxy = (IEntitySoundProxy *)pOwner->GetProxy(ENTITY_PROXY_SOUND);				if (!pSoundProxy)					pSoundProxy = (IEntitySoundProxy *)pOwner->CreateProxy(ENTITY_PROXY_SOUND);				if (pSoundProxy)				{					// check for a roof 10m above the Owner					// recalculate visibility when owner move more than 2 meters					pSoundProxy->CheckVisibilityForTailName(10.0f, 2.0f);					env = pSoundProxy->GetTailName();				}			}		}		if (!env || !env[0] || !stricmp("indoor", env))			name.replace("%env%", "");		else		{			static const size_t MAX_LEN = 256;			char envstr[MAX_LEN];			envstr[0] = '_';			strncpy(envstr+1, env, MAX_LEN-1); // no 0 pad, if MAX_LEN-1 are copied			envstr[MAX_LEN-1] = '/0'; // always zero-terminate			name.replace("%env%", envstr);		}	}	else		name.replace("%env%", env);}
开发者ID:kitnet,项目名称:project-o,代码行数:82,


示例22: BuildUpdate

void Item::BuildUpdate(UpdateDataMapType& data_map){    if (Player* owner = GetOwner())        BuildFieldsUpdate(owner, data_map);    ClearUpdateMask(false);}
开发者ID:jacobmain1,项目名称:ApocalypseCore,代码行数:6,


示例23: return

//------------------------------------------------------------------------tSoundID CItem::PlayAction(const ItemString& actionName, int layer, bool loop, uint32 flags, float speedOverride){	if (!m_enableAnimations)		return (tSoundID)-1;	TActionMap::iterator it = m_sharedparams->actions.find(CONST_TEMPITEM_STRING(actionName));	if (it == m_sharedparams->actions.end())	{//		GameWarning("Action '%s' not found on item '%s'!", actionName, GetEntity()->GetName());		for (int i=0;i<eIGS_Last;i++)		{			m_animationTime[i]=0;			m_animationSpeed[i]=1.0f;			m_animationEnd[i]=0;		}		return 0;	}	bool fp = m_stats.fp;		if (m_parentId)	{		CItem *pParent=static_cast<CItem *>(m_pItemSystem->GetItem(m_parentId));		if (pParent)			fp=pParent->GetStats().fp;	}		if (flags&eIPAF_ForceFirstPerson)		fp = true;	if (flags&eIPAF_ForceThirdPerson)		fp = false;	int sid=fp?eIGS_FirstPerson:eIGS_ThirdPerson;	SAction &action = it->second;		tSoundID result = INVALID_SOUNDID;	if ((flags&eIPAF_Sound) && !action.sound[sid].name.empty() && IsSoundEnabled() && g_pGameCVars->i_soundeffects)	{		int nSoundFlags = FLAG_SOUND_DEFAULT_3D;		nSoundFlags |= flags&eIPAF_SoundStartPaused?FLAG_SOUND_START_PAUSED:0;		IEntitySoundProxy *pSoundProxy = GetSoundProxy(true);		//GetSound proxy from dualwield master if neccesary		if(IsDualWieldSlave())		{			CItem* pMaster = static_cast<CItem*>(GetDualWieldMaster());			if(pMaster)			{				pSoundProxy = pMaster->GetSoundProxy(true);			}		}		EntityId pSkipEnts[3];		int nSkipEnts = 0;		// TODO for Marcio :)		// check code changes		// Skip the Item		pSkipEnts[nSkipEnts] = GetEntity()->GetId();		++nSkipEnts;		// Skip the Owner		if (GetOwner())		{			pSkipEnts[nSkipEnts] = GetOwner()->GetId();			++nSkipEnts;		}		if (pSoundProxy)		{						TempResourceName name;			FixResourceName(action.sound[sid].name, name, flags);			//nSoundFlags = nSoundFlags | (fp?FLAG_SOUND_DEFAULT_3D|FLAG_SOUND_RELATIVE:FLAG_SOUND_DEFAULT_3D);			Vec3 vOffset(0,0,0);			if (fp)				vOffset.x = 0.3f; // offset for first person weapon to the front			if (!g_pGameCVars->i_staticfiresounds)			{				result = pSoundProxy->PlaySoundEx(name, vOffset, FORWARD_DIRECTION, nSoundFlags, 1.0f, 0, 0, eSoundSemantic_Weapon, pSkipEnts, nSkipEnts);				ISound *pSound = pSoundProxy->GetSound(result);				if (pSound && action.sound[sid].sphere>0.0f)					pSound->SetSphereSpec(action.sound[sid].sphere);			}			else			{				SInstanceAudio *pInstanceAudio=0;				if (action.sound[sid].isstatic)				{					TInstanceActionMap::iterator iit = m_instanceActions.find(CONST_TEMPITEM_STRING(actionName));					if (iit == m_instanceActions.end())					{						std::pair<TInstanceActionMap::iterator, bool> insertion=m_instanceActions.insert(TInstanceActionMap::value_type(actionName, SInstanceAction()));						pInstanceAudio=&insertion.first->second.sound[sid];//.........这里部分代码省略.........
开发者ID:kitnet,项目名称:project-o,代码行数:101,


示例24: GetGUIDLow

bool Item::ItemContainerLoadLootFromDB(){    // Loads the money and item loot associated with an openable item from the DB    // Default. If there are no records for this item then it will be rolled for in Player::SendLoot()    m_lootGenerated = false;    uint32 container_id = GetGUIDLow();    // Save this for later use    loot.containerID = container_id;    // First, see if there was any money loot. This gets added directly to the container.    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_MONEY);    stmt->setUInt32(0, container_id);    PreparedQueryResult money_result = CharacterDatabase.Query(stmt);    if (money_result)    {        Field* fields = money_result->Fetch();        loot.gold = fields[0].GetUInt32();    }    // Next, load any items that were saved    stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_ITEMS);    stmt->setUInt32(0, container_id);    PreparedQueryResult item_result = CharacterDatabase.Query(stmt);    if (item_result)    {        // Get a LootTemplate for the container item. This is where        //  the saved loot was originally rolled from, we will copy conditions from it        LootTemplate const* lt = LootTemplates_Item.GetLootFor(GetEntry());        if (lt)        {            do            {                // Create an empty LootItem                LootItem loot_item = LootItem();                // Fill in the rest of the LootItem from the DB                Field* fields = item_result->Fetch();                // item_id, itm_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix                loot_item.itemid = fields[0].GetUInt32();                loot_item.count = fields[1].GetUInt32();                loot_item.follow_loot_rules = fields[2].GetBool();                loot_item.freeforall = fields[3].GetBool();                loot_item.is_blocked = fields[4].GetBool();                loot_item.is_counted = fields[5].GetBool();                loot_item.canSave = true;                loot_item.is_underthreshold = fields[6].GetBool();                loot_item.needs_quest = fields[7].GetBool();                loot_item.randomPropertyId = fields[8].GetInt32();                loot_item.randomSuffix = fields[9].GetUInt32();                // Copy the extra loot conditions from the item in the loot template                lt->CopyConditions(&loot_item);                // If container item is in a bag, add that player as an allowed looter                if (GetBagSlot())                    loot_item.allowedGUIDs.insert(GetOwner()->GetGUIDLow());                // Finally add the LootItem to the container                loot.items.push_back(loot_item);                // Increment unlooted count                loot.unlootedCount++;            }            while (item_result->NextRow());        }    }    // Mark the item if it has loot so it won't be generated again on open    m_lootGenerated = !loot.isLooted();    return m_lootGenerated;}
开发者ID:jacobmain1,项目名称:ApocalypseCore,代码行数:78,


示例25: isInRangeOfOtherInventory

bool UInventoryComponent::isInRangeOfOtherInventory(UInventoryComponent* otherInventory){	if (!otherInventory) return false;	return FVector::Dist(GetOwner()->GetActorLocation(), otherInventory->GetOwner()->GetActorLocation()) < 600;}
开发者ID:Reyfin,项目名称:UE4,代码行数:5,


示例26: UE_VLOG

void UCrowdFollowingComponent::SetMoveSegment(int32 SegmentStartIndex){	if (!bEnableCrowdSimulation)	{		Super::SetMoveSegment(SegmentStartIndex);		return;	}	PathStartIndex = SegmentStartIndex;	LastPathPolyIndex = PathStartIndex;	if (Path.IsValid() == false || Path->IsValid() == false || GetOwner() == NULL)	{		return;	}		FVector CurrentTargetPt = Path->GetPathPoints()[1].Location;	FNavMeshPath* NavMeshPath = Path->CastPath<FNavMeshPath>();	FAbstractNavigationPath* DirectPath = Path->CastPath<FAbstractNavigationPath>();	if (NavMeshPath)	{#if WITH_RECAST		if (NavMeshPath->PathCorridor.IsValidIndex(PathStartIndex) == false)		{			// this should never matter, but just in case			UE_VLOG(GetOwner(), LogCrowdFollowing, Error, TEXT("SegmentStartIndex in call to UCrowdFollowingComponent::SetMoveSegment is out of path corridor array's bounds (index: %d, array size %d)")				, PathStartIndex, NavMeshPath->PathCorridor.Num());			PathStartIndex = FMath::Clamp<int32>(PathStartIndex, 0, NavMeshPath->PathCorridor.Num() - 1);		}		// cut paths into parts to avoid problems with crowds getting into local minimum		// due to using only first 10 steps of A*		// do NOT use PathPoints here, crowd simulation disables path post processing		// which means, that PathPoints contains only start and end position 		// full path is available through PathCorridor array (poly refs)		ARecastNavMesh* RecastNavData = Cast<ARecastNavMesh>(MyNavData);		const int32 PathPartSize = 15;		const int32 LastPolyIdx = NavMeshPath->PathCorridor.Num() - 1;		int32 PathPartEndIdx = FMath::Min(PathStartIndex + PathPartSize, LastPolyIdx);		FVector PtA, PtB;		const bool bStartIsNavLink = RecastNavData->GetLinkEndPoints(NavMeshPath->PathCorridor[PathStartIndex], PtA, PtB);		const bool bEndIsNavLink = RecastNavData->GetLinkEndPoints(NavMeshPath->PathCorridor[PathPartEndIdx], PtA, PtB);		if (bStartIsNavLink)		{			PathStartIndex = FMath::Max(0, PathStartIndex - 1);		}		if (bEndIsNavLink)		{			PathPartEndIdx = FMath::Max(0, PathPartEndIdx - 1);		}		bFinalPathPart = (PathPartEndIdx == LastPolyIdx);		if (!bFinalPathPart)		{			RecastNavData->GetPolyCenter(NavMeshPath->PathCorridor[PathPartEndIdx], CurrentTargetPt);		}		else if (NavMeshPath->IsPartial())		{			RecastNavData->GetClosestPointOnPoly(NavMeshPath->PathCorridor[PathPartEndIdx], Path->GetPathPoints()[1].Location, CurrentTargetPt);		}		// not safe to read those directions yet, you have to wait until crowd manager gives you next corner of string pulled path		CrowdAgentMoveDirection = FVector::ZeroVector;		MoveSegmentDirection = FVector::ZeroVector;		CurrentDestination.Set(Path->GetBaseActor(), CurrentTargetPt);		SuspendCrowdSteering(false);		LogPathPartHelper(GetOwner(), NavMeshPath, PathStartIndex, PathPartEndIdx);		UE_VLOG_SEGMENT(GetOwner(), LogCrowdFollowing, Log, MovementComp->GetActorFeetLocation(), CurrentTargetPt, FColor::Red, TEXT("path part"));		UE_VLOG(GetOwner(), LogCrowdFollowing, Log, TEXT("SetMoveSegment, from:%d segments:%d%s"),			PathStartIndex, (PathPartEndIdx - PathStartIndex)+1, bFinalPathPart ? TEXT(" (final)") : TEXT(""));		UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(GetWorld());		if (CrowdManager)		{			CrowdManager->SetAgentMovePath(this, NavMeshPath, PathStartIndex, PathPartEndIdx);		}#endif	}	else if (DirectPath)	{		// direct paths are not using any steering or avoidance		// pathfinding is replaced with simple velocity request 		const FVector AgentLoc = MovementComp->GetActorFeetLocation();		bFinalPathPart = true;		bCheckMovementAngle = true;		bUpdateDirectMoveVelocity = DestinationActor.IsValid();		CurrentDestination.Set(Path->GetBaseActor(), CurrentTargetPt);		CrowdAgentMoveDirection = (CurrentTargetPt - AgentLoc).GetSafeNormal();		MoveSegmentDirection = CrowdAgentMoveDirection;		SuspendCrowdSteering(true);		UE_VLOG(GetOwner(), LogCrowdFollowing, Log, TEXT("SetMoveSegment, direct move"));//.........这里部分代码省略.........
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:101,


示例27: ControlThrow

func ControlThrow(){	pBeamer -> Okay(GetX(),GetY());	SetCursor(GetOwner(),pBef);	RemoveObject();} 
开发者ID:Fulgen301,项目名称:SGGP,代码行数:6,


示例28: GetOwner

CSDKPlayer* CWeaponSDKBase::GetPlayerOwner() const{	return dynamic_cast< CSDKPlayer* >( GetOwner() );}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:4,



注:本文中的GetOwner函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetOwnerActor函数代码示例
C++ GetOverlappedResult函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。