本文整理汇总了C++中vec3_t::CopyToArray方法的典型用法代码示例。如果您正苦于以下问题:C++ vec3_t::CopyToArray方法的具体用法?C++ vec3_t::CopyToArray怎么用?C++ vec3_t::CopyToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec3_t
的用法示例。
在下文中一共展示了vec3_t::CopyToArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: V_GetDeathCam
void V_GetDeathCam(cl_entity_t * ent1, cl_entity_t * ent2, float * angle, float * origin)
{
float newAngle[3];
float newOrigin[3];
static vec3_t nonDestructedOrigin;
float distance = 168.0f;
v_lastDistance += v_frametime * 96.0f; // move unit per seconds back
if ( v_resetCamera )
v_lastDistance = 64.0f;
if ( distance > v_lastDistance )
distance = v_lastDistance;
if (ent1->origin.x == 0 && ent1->origin.y == 0 && ent1->origin.z == 0)
nonDestructedOrigin.CopyToArray(newOrigin);
else
{
nonDestructedOrigin = ent1->origin;
VectorCopy(ent1->origin, newOrigin);
}
if ( ent1->player )
newOrigin[2]+= 17; // head level of living player
// get new angle towards second target
if ( ent2 )
{
VectorSubtract(ent2->origin, nonDestructedOrigin, newAngle);
VectorAngles( newAngle, newAngle );
newAngle[0] = -newAngle[0];
}
else
{
// if no second target is given, look down to dead player
newAngle[0] = 90.0f;
newAngle[1] = 0.0f;
newAngle[2] = 0;
}
// and smooth view
V_SmoothInterpolateAngles( v_lastAngles, newAngle, angle, 120.0f );
V_GetChaseOrigin( angle, newOrigin, distance, origin );
VectorCopy(angle, v_lastAngles);
}