예제 #1
0
void CAmebaZone::PhTune(dReal step)
{
	OBJECT_INFO_VEC_IT it;
	for(it = m_ObjectInfoMap.begin(); m_ObjectInfoMap.end() != it; ++it) 
	{
		CEntityAlive	*EA=smart_cast<CEntityAlive*>((*it).object);
		if(EA)
		{
			CPHMovementControl* mc=EA->character_physics_support()->movement();
			if(mc)
			{
				//Fvector vel;
				//mc->GetCharacterVelocity(vel);
				//vel.invert();
				//vel.mul(mc->GetMass());
				if(distance_to_center(EA)<effective_radius())
								mc->SetVelocityLimit(m_fVelocityLimit);
			}
		}
		
	}
}
예제 #2
0
float CCustomZone::RelativePower(float dist, float nearest_shape_radius)
{
	float radius = effective_radius(nearest_shape_radius);
	float power = (radius<dist) ? 0 : (1.f - m_fAttenuation*(dist/radius)*(dist/radius));
	return (power<0.0f) ? 0.0f : power;
}