• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetOrigin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: StartSound

//--------------------------------
// hhProxDoor::Event_Touch
//--------------------------------
void hhProxDoor::Event_Touch( idEntity *other, trace_t *trace ) {
	if ( sndTrigger && trace->c.id == sndTrigger->GetId() ) {
		if (other && other->IsType(hhPlayer::Type) && IsLocked() && gameLocal.time > nextSndTriggerTime) {
			StartSound("snd_locked", SND_CHANNEL_ANY, 0, false, NULL );
			nextSndTriggerTime = gameLocal.time + 10000;
		}
		return;
	}
	if( proxState == PROXSTATE_Active ) {
		return;
	}

	if ( !other ) {
		gameLocal.Warning("hhProxDoor:  Event_Touch given NULL for other\n");
		return;
	}

	float dist = ( other->GetOrigin() - GetOrigin() ).Length();
	if (dist > movementDistance) {
		return;
	}

	if( !IsLocked() ) {
		SetDoorState( PROXSTATE_Active );
	}
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:29,代码来源:game_proxdoor.cpp


示例2: GetOrigin

/* Calculate the bounding box of this, when rotated
 */
const EDA_RECT EDA_RECT::GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle )
{
    wxPoint corners[4];

    // Build the corners list
    corners[0]   = GetOrigin();
    corners[2]   = GetEnd();
    corners[1].x = corners[0].x;
    corners[1].y = corners[2].y;
    corners[3].x = corners[2].x;
    corners[3].y = corners[0].y;

    // Rotate all corners, to find the bounding box
    for( int ii = 0; ii < 4; ii ++ )
        RotatePoint( &corners[ii], aRotCenter, aAngle );

    // Find the corners bounding box
    wxPoint start = corners[0];
    wxPoint end = corners[0];

    for( int ii = 1; ii < 4; ii ++ )
    {
        start.x = std::min( start.x, corners[ii].x);
        start.y = std::min( start.y, corners[ii].y);
        end.x = std::max( end.x, corners[ii].x);
        end.y = std::max( end.y, corners[ii].y);
    }

    EDA_RECT bbox;
    bbox.SetOrigin( start );
    bbox.SetEnd( end );

    return bbox;
}
开发者ID:OpenEE,项目名称:micad,代码行数:36,代码来源:base_struct.cpp


示例3: clipBounds

/*
=================
hhProjectileCrawlerGrenade::Event_ApplyExpandWound
=================
*/
void hhProjectileCrawlerGrenade::Event_ApplyExpandWound() {
	trace_t trace;

	if( !modelProxy.IsValid() || !modelProxy->GetCombatModel() ) {
		return;
	}

	idBounds clipBounds( modelProxy->GetRenderEntity()->bounds );
	idVec3 traceEnd = GetOrigin();
	idVec3 traceStart = traceEnd + hhUtils::RandomPointInShell( clipBounds.Expand(1.0f).GetRadius(), clipBounds.Expand(2.0f).GetRadius() );
	idVec3 jointOrigin, localOrigin, localNormal;
	idMat3 jointAxis, axisTranspose;
	jointHandle_t jointHandle = INVALID_JOINT;

	CancelEvents( &EV_ApplyExpandWound );
	PostEventSec( &EV_ApplyExpandWound, spawnArgs.GetFloat("expandWoundDelay") );

	if( !gameLocal.clip.TracePoint(trace, traceStart, traceEnd, modelProxy->GetCombatModel()->GetContents(), NULL) ) {
		return;
	}
	
	if( trace.c.entityNum != entityNumber ) {//Make sure we hit ourselves
		return;
	}
			
	modelProxy->AddDamageEffect( trace, vec3_zero, spawnArgs.GetString("def_expandDamage"), (!fl.networkSync || netSyncPhysics) );
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:32,代码来源:prey_projectilecrawlergrenade.cpp


示例4: StopSound

/*
=================
hhProjectileCrawlerGrenade::Event_Collision_Bounce
=================
*/
void hhProjectileCrawlerGrenade::Event_Collision_Bounce( const trace_t* collision, const idVec3 &velocity ) {
	static const float minCollisionVelocity = 20.0f;
	static const float maxCollisionVelocity = 90.0f;

	StopSound( SND_CHANNEL_BODY, true );

	// Velocity in normal direction
	float len = velocity * -collision->c.normal;

	if( collision->fraction < VECTOR_EPSILON || len < minCollisionVelocity ) {
		idThread::ReturnInt( 0 );
		return;
	}

	StartSound( "snd_bounce", SND_CHANNEL_BODY, 0, true, NULL );
	float volume = hhUtils::CalculateSoundVolume( len, minCollisionVelocity, maxCollisionVelocity );
	HH_SetSoundVolume( volume, SND_CHANNEL_BODY );

	BounceSplat( GetOrigin(), -collision->c.normal );

	SIMDProcessor->Memcpy( &collisionInfo, collision, sizeof(trace_t) );
	collisionInfo.fraction = 0.0f;//Sometimes fraction == 1.0f

	physicsObj.SetAngularVelocity( 0.5f*physicsObj.GetAngularVelocity() );

	idThread::ReturnInt( 0 );
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:32,代码来源:prey_projectilecrawlergrenade.cpp


示例5: GetOrigin

void csCameraBase::MoveWorld (const csVector3 &v, bool cd)
{
  csVector3 new_position = GetOrigin () + v;

  if (sector)
  {
    csVector3 remember_position = new_position;

    // Test if the motion crosses a portal
    iSector *new_sector = sector->FollowSegment (
        *this,
        new_position,
        mirror,
        only_portals);

    if (new_sector != sector)
    {
      sector = new_sector;
      cameranr = cur_cameranr++;
      FireCameraSectorListeners (sector);
    }
  }

  FireCameraMovedListeners ();

  SetOrigin (new_position);
  cameranr = cur_cameranr++;
}
开发者ID:GameLemur,项目名称:Crystal-Space,代码行数:28,代码来源:camera.cpp


示例6: GetOrigin

void hhProxDoorRotator::Event_PostSpawn( void ) {
	idVec3	sectionOffset;
	idVec3	rotVector;
	float	rotAngle;

	if( !spawnArgs.GetVector("section_offset", "0 0 0", sectionOffset) ) {
		common->Warning( "No section offset found for '%s'", this->GetEntityDefName() );
	}
	if( !spawnArgs.GetVector("rot_vector", "0 0 0", rotVector) ) {
		common->Warning( "No rotation vector found for '%s'", this->GetEntityDefName() );
	}
	if( !spawnArgs.GetFloat("rot_angle", "0 0 0", rotAngle) ) {
		common->Warning( "No rotation angle found for '%s'", this->GetEntityDefName() );
	}

	idDict args;
	args.SetVector( "origin", GetOrigin() + (sectionOffset * GetAxis()) );
	args.SetMatrix( "rotation", GetAxis() );
	args.SetVector( "rot_vector", rotVector );
	args.SetFloat( "rot_angle", rotAngle );
	bindParent = static_cast<hhProxDoorSection*>( gameLocal.SpawnEntityType(hhProxDoorRotMaster::Type, &args) );
	if( !bindParent.IsValid() ) {
		common->Warning( "Failed to spawn bindParent for '%s'", GetEntityDefName() );
	}
	else {
		bindParent->proxyParent = this;
	}
	Bind( bindParent.GetEntity(), true );
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:29,代码来源:game_proxdoor.cpp


示例7: Precache

void CCeilingTurret::Spawn()
{ 
	Precache( );

	SetModel( "models/combine_turrets/ceiling_turret.mdl" );
	
	BaseClass::Spawn( );

	m_iHealth			= sk_turret_health.GetFloat();
	m_HackedGunPos		= Vector( 0, 0, 12.75 );

	AngleVectors( GetAngles(), NULL, NULL, &m_vecViewOffset );
	m_vecViewOffset		= m_vecViewOffset * Vector( 0, 0, -64 );

	m_flFieldOfView		= VIEW_FIELD_FULL;

	m_iRetractHeight = 16;
	m_iDeployHeight = 32;
	m_iMinPitch	= -45;
	UTIL_SetSize(this, Vector(-32, -32, -m_iRetractHeight), Vector(32, 32, m_iRetractHeight));
	
	SetThink(Initialize);	

	m_pEyeGlow = CSprite::SpriteCreate( TURRET_GLOW_SPRITE, GetOrigin(), FALSE );
	m_pEyeGlow->SetTransparency( kRenderGlow, 255, 0, 0, 0, kRenderFxNoDissipation );
	m_pEyeGlow->SetAttachment( this, 2 );
	m_eyeBrightness = 0;

	SetNextThink( gpGlobals->curtime + 0.3 );
}
开发者ID:Muini,项目名称:Nag-asw,代码行数:30,代码来源:npc_turret.cpp


示例8: Vector2D

void LaserBeam::OnCollision(ICollidable *other)
{
    Entity *entity = (Entity*)other;

    Damage_t damage;
    damage.damage = entity->GetHealth();

    if (entity->IsPlayer())
    {
        damage.damage = 1;
    }

    damage.direction = Vector2D(-1, 0);
    damage.inflictor = GetOwner();

    if (GetOwner() != nullptr)
    {
        damage.statsInflictorName = GetOwner()->GetEntityClassName();
        damage.statsInflictorClass = GetOwner()->GetEntityResourceClass();
    }

    damage.statsWeaponName = GetEntityClassName();
    damage.statsWeaponClass = GetEntityResourceClass();

    entity->TakeDamage(damage);

    Vector2D laserCenter = GetOrigin();
    laserCenter.x = entity->GetOrigin().x;

    GetGameContext()->GetParticleRoot()->CreateParticles("laser_cannon_hit", laserCenter, Vector2D(-1, 0));
}
开发者ID:Biohazard90,项目名称:Project-Neo-Gemini,代码行数:31,代码来源:laserbeam.cpp


示例9: MOZ_ASSERT

void
CDMProxy::Init(PromiseId aPromiseId)
{
  MOZ_ASSERT(NS_IsMainThread());

  nsresult rv = mKeys->GetOrigin(mOrigin);
  if (NS_FAILED(rv)) {
    RejectPromise(aPromiseId, NS_ERROR_DOM_INVALID_STATE_ERR);
    return;
  }
  EME_LOG("Creating CDMProxy for origin='%s'",
          NS_ConvertUTF16toUTF8(GetOrigin()).get());

  if (!mGMPThread) {
    nsCOMPtr<mozIGeckoMediaPluginService> mps =
      do_GetService("@mozilla.org/gecko-media-plugin-service;1");
    if (!mps) {
      RejectPromise(aPromiseId, NS_ERROR_DOM_INVALID_STATE_ERR);
      return;
    }
    mps->GetThread(getter_AddRefs(mGMPThread));
    if (!mGMPThread) {
      RejectPromise(aPromiseId, NS_ERROR_DOM_INVALID_STATE_ERR);
      return;
    }
  }

  nsRefPtr<nsIRunnable> task(NS_NewRunnableMethodWithArg<uint32_t>(this, &CDMProxy::gmp_Init, aPromiseId));
  mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
}
开发者ID:chenhequn,项目名称:gecko,代码行数:30,代码来源:CDMProxy.cpp


示例10: GetAxis

END_CLASS

void hhShuttleTransport::Spawn() {
	dockingBeam = NULL;
	dockedShuttle = NULL;
	shuttleCount = 0;
	bLocked = false;

	amountHealth = spawnArgs.GetInt("amounthealth");
	amountPower = spawnArgs.GetInt("amountpower");

	bCanExitLocked = spawnArgs.GetBool("canExitLocked");
	bLockOnEntry = spawnArgs.GetBool("lockOnEntry");
	bAllowFiring = spawnArgs.GetBool("allowFiring");
	offsetNozzle = spawnArgs.GetVector("offset_nozzle1");
//	offsetNozzle2 = spawnArgs.GetVector("offset_nozzle2");
	offsetShuttlePoint = spawnArgs.GetVector("offset_shuttlepoint");

//	dockingBeam = SpawnDockingBeam(offsetNozzle);

	dockingForce.SetRestoreFactor(spawnArgs.GetFloat("dockingforce"));
	dockingForce.SetTarget(GetOrigin() + offsetShuttlePoint * GetAxis());

	// Fade in
	SetShaderParm(SHADERPARM_TIMEOFFSET, -MS2SEC(gameLocal.time));	// Growth start time
	SetShaderParm(5, 1.0f);											// Growth direction (in)
	SetShaderParm(6, 1.0f);											// Make Beam opaque
	StartSound("snd_fadein", SND_CHANNEL_ANY);
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:29,代码来源:game_shuttletransport.cpp


示例11: GetAxis

	Matrix4 Matrix4::InversedFast() const {
		Matrix4 out = Matrix4::Identity();
		Vector3 axis1 = GetAxis(0);
		Vector3 axis2 = GetAxis(1);
		Vector3 axis3 = GetAxis(2);
		Vector3 norm1 = axis1 / axis1.GetPoweredLength();
		Vector3 norm2 = axis2 / axis2.GetPoweredLength();
		Vector3 norm3 = axis3 / axis3.GetPoweredLength();
		out.m[0] = norm1.x;
		out.m[1] = norm2.x;
		out.m[2] = norm3.x;
		out.m[4] = norm1.y;
		out.m[5] = norm2.y;
		out.m[6] = norm3.y;
		out.m[8] = norm1.z;
		out.m[9] = norm2.z;
		out.m[10] = norm3.z;
		
		Vector3 s = (out * GetOrigin()).GetXYZ();
		out.m[12] = -s.x;
		out.m[13] = -s.y;
		out.m[14] = -s.z;
		
		return out;
	}
开发者ID:harrisonpartch,项目名称:openspades,代码行数:25,代码来源:Math.cpp


示例12: ASSERT

/////////////////////////////////////////////////////////////////////////////
// CMyListCtrl message handlers
void CMyListCtrl::OnBeginDrag(LPNMHDR pnmhdr, LRESULT *pResult)
{
    CPoint			ptItem, ptAction, ptImage;
    NM_LISTVIEW		*pnmListView = (NM_LISTVIEW *)pnmhdr;

    ((CListCtrlPage *)GetParent())->ShowNotification(pnmhdr, pResult);
    ASSERT(!m_bDragging);
    m_bDragging = TRUE;
    m_iItemDrag = pnmListView->iItem;
    ptAction = pnmListView->ptAction;
    GetItemPosition(m_iItemDrag, &ptItem);  // ptItem is relative to (0,0) and not the view origin
    GetOrigin(&m_ptOrigin);

    ASSERT(m_pimageListDrag == NULL);
    m_pimageListDrag = CreateDragImage(m_iItemDrag, &ptImage);
    m_sizeDelta = ptAction - ptImage;   // difference between cursor pos and image pos
    m_ptHotSpot = ptAction - ptItem + m_ptOrigin;  // calculate hotspot for the cursor
    m_pimageListDrag->DragShowNolock(TRUE);  // lock updates and show drag image
    m_pimageListDrag->SetDragCursorImage(0, m_ptHotSpot);  // define the hot spot for the new cursor image
    m_pimageListDrag->BeginDrag(0, CPoint(0, 0));
    ptAction -= m_sizeDelta;
    m_pimageListDrag->DragEnter(this, ptAction);
    m_pimageListDrag->DragMove(ptAction);  // move image to overlap original icon
    SetCapture();
}
开发者ID:ehershey,项目名称:development,代码行数:27,代码来源:mlistctl.cpp


示例13: GetExtendedStyle

void CMyListCtrl::OnBeginDrag(LPNMHDR pnmhdr,LRESULT*)
{
  CPoint ptItem,ptAction,ptImage;
  NM_LISTVIEW *pnmListView = (NM_LISTVIEW *)pnmhdr;
  m_oldDNDStyle = GetExtendedStyle();

  if(m_oldDNDStyle != 0)SetExtendedStyle(0);
  ASSERT(!m_bDragging);
  m_bDragging = TRUE;
  m_iItemDrag = pnmListView->iItem;
  ptAction = pnmListView->ptAction;
  GetItemPosition(m_iItemDrag,&ptItem);
  GetOrigin(&m_ptOrigin);
  ASSERT(m_pImageListDrag == NULL);
  m_pImageListDrag = CreateDragImage(m_iItemDrag,&ptImage);
  m_sizeDelta = ptAction - ptImage;
  m_ptHotSpot = ptAction - ptItem + m_ptOrigin;
  m_pImageListDrag->DragShowNolock(TRUE);
  m_pImageListDrag->SetDragCursorImage(0,CPoint(0,0));
  m_pImageListDrag->BeginDrag(0,CPoint(0,0));

  ptAction -=m_sizeDelta;
  m_pImageListDrag->DragEnter(this,ptAction);
  m_pImageListDrag->DragMove(ptAction);
  m_iItemDrop = -1;
  SetCapture();
}
开发者ID:bblr001,项目名称:MVS,代码行数:27,代码来源:MyListCtrl.cpp


示例14: GetOrigin

void hhCenturion::AimedAttackMissile( const char *jointname, const idDict *projDef) {
	idProjectile *proj;
	idVec3 target, origin = GetOrigin();
	bool inShuttle = false;

	if ( shootTarget.IsValid() ) {
		target = shootTarget->GetOrigin();
	} else if ( enemy.IsValid() ) {
		target = enemy->GetOrigin();
		if ( enemy->IsType( idActor::Type ) ) {
			target.z += enemy->EyeHeight() / 4.0f;
		}
	} else {
		// No target?  Do the default attack
		Event_AttackMissile( jointname, projDef, 1 );
		return;
	}

	// If target is too close do a non-aimed attack
	if ( fabsf( origin.x - target.x ) < 256 &&
		   fabsf( origin.y - target.y ) < 256 ) {
		Event_AttackMissile( jointname, projDef, 1 );
		return;
	}

	idVec3 dist = origin - target;

	if ( shootTarget.IsValid() ) {
		proj = LaunchProjectile( jointname, shootTarget.GetEntity(), true, projDef );
	} else {
		proj = LaunchProjectile( jointname, enemy.GetEntity(), true, projDef );
	}
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:33,代码来源:ai_centurion.cpp


示例15: GetOrigin

void TextShape::BoundingBox(Point& bottemLeft, Point& topRight) const
{
    Coord bottem , left , width , height;
    GetOrigin(bottem, left);
    GetExtent(width, height);
    bottemLeft = Point(bottem , left);
    topRight = Point(bottem+height, left+width);
}
开发者ID:fiskercui,项目名称:testcommon,代码行数:8,代码来源:Adapter.cpp


示例16: switch

float Axis::DisplacementWillOverscrollAmount(int32_t aDisplacement) {
  switch (DisplacementWillOverscroll(aDisplacement)) {
  case OVERSCROLL_MINUS: return (GetOrigin() + aDisplacement) - GetPageStart();
  case OVERSCROLL_PLUS: return (GetCompositionEnd() + aDisplacement) - GetPageEnd();
  // Don't handle overscrolled in both directions; a displacement can't cause
  // this, it must have already been zoomed out too far.
  default: return 0;
  }
}
开发者ID:nhirata,项目名称:releases-mozilla-central,代码行数:9,代码来源:Axis.cpp


示例17: assert

void hhShuttleTransport::Think() {
	hhDock::Think();
	if (thinkFlags & TH_THINK) {
		// Apply docking force to shuttle if docked, even if not in zone
		assert(dockingForce.GetEntity() == dockedShuttle);
		dockingForce.SetTarget(GetOrigin() + offsetShuttlePoint * GetAxis());
		dockingForce.Evaluate(gameLocal.time);
	}
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:9,代码来源:game_shuttletransport.cpp


示例18: SetVisual

void CWall::SetVisual()
{
	m_visual.SetWidth(m_width);
	m_visual.SetHeight(m_height);
	m_visual.SetRotation(GetRotation());
	m_visual.SetOrigin(GetOrigin());
	m_visual.SetReferenceSystemOrigin(GetReferenceSystemOrigin());
	m_visual.SetPosition(GetPosition());
}
开发者ID:7kia,项目名称:CG,代码行数:9,代码来源:Wall.cpp


示例19: CheckParametres

void C2DRectangleCollision::AddToWorld(b2World * world)
{
	CheckParametres();
	CStatic2DShape::AddToWorld(world);

	AddRectangleToBody(m_body
		, SSize(m_width, m_height)
		, GetOrigin());
}
开发者ID:7kia,项目名称:CG,代码行数:9,代码来源:2DRectangleCollision.cpp


示例20: GetName

/*
=================
hhProjectileCrawlerGrenade::CopyToModelProxy
=================
*/
void hhProjectileCrawlerGrenade::CopyToModelProxy()
{
	//rww - do this the right way with an inheriting entityDef
	//idDict args = spawnArgs;
	//args.Delete( "spawnclass" );
	//args.Delete( "name" );

	idDict args;
	idDict *setArgs;
	idStr str;

	if (gameLocal.isClient)
	{
		setArgs = &modelProxy->spawnArgs;
	}
	else
	{
		args.Clear();
		setArgs = &args;
	}

	setArgs->Set( "owner", GetName() );
	setArgs->SetVector( "origin", GetOrigin() );
	setArgs->SetMatrix( "rotation", GetAxis() );

	//copy the model over
	if (spawnArgs.GetString("model", "", str))
	{
		setArgs->Set("model", str.c_str());
		if (gameLocal.isClient && modelProxy.IsValid())
		{
			modelProxy->SetModel(str.c_str());
		}
	}

	//these are now taken care of in the ent def.
	/*
	setArgs->SetBool( "useCombatModel", true );
	setArgs->SetBool( "transferDamage", false );
	setArgs->SetBool( "solid", false );
	*/

	if (!gameLocal.isClient)
	{
		modelProxy = gameLocal.SpawnObject("projectile_crawler_proxy", &args);
	}

	if( modelProxy.IsValid() ) {
		modelProxy->Bind( this, true );
		modelProxy->CycleAnim( "idle", ANIMCHANNEL_ALL );
	}

	//for debugging
	//spawnArgs.CompareArgs(modelProxy->spawnArgs);

	modelProxyCopyDone = true;
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:62,代码来源:prey_projectilecrawlergrenade.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetOriginalCaster函数代码示例发布时间:2022-05-30
下一篇:
C++ GetOrientation函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap