Ejemplo n.º 1
0
void CRopeKeyframe::Init()
{
	SetLocalAngles( vec3_angle );
	RecalculateLength();

	m_nSegments = clamp( m_nSegments, 2, ROPE_MAX_SEGMENTS );

	UpdateBBox( true );

	m_bStartPointValid = (m_hStartPoint.Get() != NULL);
	m_bEndPointValid = (m_hEndPoint.Get() != NULL);

	// Sanity-check the rope texture scale before it goes over the wire
	if ( m_TextureScale < 0.1f )
	{
		Vector origin = GetAbsOrigin();
		GetEndPointPos( 0, origin );
		DevMsg( "move_rope has TextureScale less than 0.1 at (%2.2f, %2.2f, %2.2f)\n",
			origin.x, origin.y, origin.z );
		m_TextureScale = 0.1f;
	}
	else if ( m_TextureScale > 10.0f )
	{
		Vector origin = GetAbsOrigin();
		GetEndPointPos( 0, origin );
		DevMsg( "move_rope has TextureScale greater than 10 at (%2.2f, %2.2f, %2.2f)\n",
			origin.x, origin.y, origin.z );
		m_TextureScale = 10.0f;
	}
}
Ejemplo n.º 2
0
void CRopeKeyframe::Init()
{
	SetLocalAngles( vec3_angle );
	RecalculateLength();

	m_nSegments = clamp( m_nSegments, 2, ROPE_MAX_SEGMENTS );

	UpdateBBox( true );

	m_bStartPointValid = (m_hStartPoint.Get() != NULL);
	m_bEndPointValid = (m_hEndPoint.Get() != NULL);
}