Exemplo n.º 1
0
void KX_KetsjiEngine::DoSound(KX_Scene* scene)
{
	m_logger->StartLog(tc_sound, m_kxsystem->GetTimeInSeconds(), true);

	KX_Camera* cam = scene->GetActiveCamera();
	if (!cam)
		return;
	MT_Point3 listenerposition = cam->NodeGetWorldPosition();
	MT_Vector3 listenervelocity = cam->GetLinearVelocity();
	MT_Matrix3x3 listenerorientation = cam->NodeGetWorldOrientation();

	{
		AUD_3DData data;
		float f;

		listenerorientation.getValue3x3(data.orientation);
		listenerposition.getValue(data.position);
		listenervelocity.getValue(data.velocity);

		f = data.position[1];
		data.position[1] = data.position[2];
		data.position[2] = -f;

		f = data.velocity[1];
		data.velocity[1] = data.velocity[2];
		data.velocity[2] = -f;

		f = data.orientation[1];
		data.orientation[1] = data.orientation[2];
		data.orientation[2] = -f;

		f = data.orientation[3];
		data.orientation[3] = -data.orientation[6];
		data.orientation[6] = f;

		f = data.orientation[4];
		data.orientation[4] = -data.orientation[8];
		data.orientation[8] = -f;

		f = data.orientation[5];
		data.orientation[5] = data.orientation[7];
		data.orientation[7] = f;

		AUD_updateListener(&data);
	}
}
void	KX_BulletPhysicsController::RelativeRotate(const MT_Matrix3x3& drot,bool local)
{
	float	rotval[9];
	drot.getValue3x3(rotval);
	CcdPhysicsController::RelativeRotate(rotval,local);
}