Exemple #1
0
	virtual void Evaluate(dEffectorPose& output, dFloat timestep)
	{
		m_poseGenerator->Evaluate(output, timestep);

		dQuaternion rotation (dPitchMatrix(m_euler.m_x) * dYawMatrix(m_euler.m_y) * dRollMatrix(m_euler.m_z));
		for (dEffectorPose::dListNode* node = output.GetFirst(); node; node = node->GetNext()) {
			dEffectorTransform& transform = node->GetInfo();
			transform.m_rotation = transform.m_rotation * rotation;
			transform.m_posit = m_position + rotation.RotateVector(transform.m_posit);
		}
	}
		virtual void Evaluate(dEffectorPose& output, dFloat timestep)
		{
			m_poseGenerator->Evaluate(output, timestep);

			dEffectorTransform& transform = output.GetFirst()->GetInfo();
			dQuaternion yawRotation (m_azimuthAxis, m_euler.m_y);

			transform.m_posit += m_azimuthAxis.Scale (m_position.m_y);
			transform.m_posit += m_planeAxis.Scale (m_position.m_z);

			transform.m_rotation = transform.m_rotation * yawRotation;
			transform.m_posit = yawRotation.RotateVector(transform.m_posit);
			transform.m_posit.m_w = 1.0f;
		}
Exemple #3
0
	virtual void Evaluate(dEffectorPose& output, dFloat timestep)
	{
		dEffectorTreeFixPose::Evaluate(output, timestep);

		dFloat param = m_acc / m_period;
		dBigVector left (m_cycle.CurvePoint(param));
		dBigVector right (m_cycle.CurvePoint(dMod (param + 0.5f, 1.0f)));

		dFloat high[2];
		dFloat stride[2];
		high[0] = dFloat (left.m_y);
		high[1] = dFloat (right.m_y);
		stride[0] = dFloat(left.m_x);
		stride[1] = dFloat(right.m_x);

		int index = 0;
		for (dEffectorPose::dListNode* node = output.GetFirst(); node; node = node->GetNext()) {
			dEffectorTransform& transform = node->GetInfo();
			transform.m_posit.m_y += high[m_sequence[index]];
			transform.m_posit.m_x += stride[m_sequence[index]];
			index ++;
		}
		m_acc = dMod(m_acc + timestep, m_period);
	}