本文整理汇总了C++中CBaseAnimating::GetBoneTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseAnimating::GetBoneTransform方法的具体用法?C++ CBaseAnimating::GetBoneTransform怎么用?C++ CBaseAnimating::GetBoneTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseAnimating
的用法示例。
在下文中一共展示了CBaseAnimating::GetBoneTransform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Touch
void CStickyBomb::Touch( CBaseEntity *pOther )
{
// Don't stick if already stuck
if ( GetMoveType() == MOVETYPE_FLYGRAVITY )
{
trace_t tr = GetTouchTrace();
// stickies don't stick to each other or sky
if ( FClassnameIs(pOther, "grenade_stickybomb") || (tr.surface.flags & SURF_SKY) )
{
// bounce
Vector vecNewVelocity;
PhysicsClipVelocity( GetAbsVelocity(), tr.plane.normal, vecNewVelocity, 1.0 );
SetAbsVelocity( vecNewVelocity );
}
else
{
SetAbsVelocity( vec3_origin );
SetMoveType( MOVETYPE_NONE );
if ( pOther->entindex() != 0 )
{
// set up notification if the parent is deleted before we explode
g_pNotify->AddEntity( this, pOther );
if ( (tr.surface.flags & SURF_HITBOX) && modelinfo->GetModelType( pOther->GetModel() ) == mod_studio )
{
CBaseAnimating *pOtherAnim = dynamic_cast<CBaseAnimating *>(pOther);
if ( pOtherAnim )
{
matrix3x4_t bombWorldSpace;
MatrixCopy( EntityToWorldTransform(), bombWorldSpace );
// get the bone info so we can follow the bone
FollowEntity( pOther );
SetOwnerEntity( pOther );
m_boneIndexAttached = pOtherAnim->GetHitboxBone( tr.hitbox );
matrix3x4_t boneToWorld;
pOtherAnim->GetBoneTransform( m_boneIndexAttached, boneToWorld );
// transform my current position/orientation into the hit bone's space
// UNDONE: Eventually we need to intersect with the mesh here
// REVISIT: maybe do something like the decal code to find a spot on
// the mesh.
matrix3x4_t worldToBone, localMatrix;
MatrixInvert( boneToWorld, worldToBone );
ConcatTransforms( worldToBone, bombWorldSpace, localMatrix );
MatrixAngles( localMatrix, m_boneAngles.GetForModify(), m_bonePosition.GetForModify() );
return;
}
}
SetParent( pOther );
}
}
}
}
示例2: SetBombOrigin
void CStickyBomb::SetBombOrigin()
{
if ( IsFollowingEntity() )
{
CBaseAnimating *pOtherAnim = dynamic_cast<CBaseAnimating *>(GetFollowedEntity());
if ( pOtherAnim )
{
Vector origin;
matrix3x4_t boneToWorld;
pOtherAnim->GetBoneTransform( m_boneIndexAttached, boneToWorld );
VectorTransform( m_bonePosition, boneToWorld, origin );
StopFollowingEntity( );
SetMoveType(MOVETYPE_NONE);
SetAbsOrigin( origin );
}
}
}