fauced_cool_water_on:=true;//включаем воду
|
undeclared identifier(
ещё т.к. краны крутятся плавно, то после включения воды, поворот крана все равно не задан (остаётся на нуле), и вода не льётся(
teapot_rotate_x:=45;//наклоняем чайник
|
слишком резко наклоняется, всё разлилось(
и газ ты забыл выключить, ёпт
попытка более корректного решения

#include "teapot.h"
#include "cup.h"
#include "faucet.h"
#include "stove.h"
void createAndUseTea()
{
teapot.position = faucet.position - float3(0,teapot.GetSize().y+0.01,0); //учитывая, что центр коорд у чайника внизу (чтобы удобно было ставить на конфорку), ставим чайник под кран, вычитая из позиции крана высоту чайника (+ епсилон).
faucet.SetCool(0.7); //регулируем напор воды
while((teapot.GetWaterLevel()/teapot.GetMaxWaterLevel())<0.5)
{
delay(10);
}
faucet.SetCool(0);
if (teapot.GetType() == TEAPOT_ELECTRIC) // электрические чайники не надо жарить!
{
teapot.position = teapot.base.position; // ставим его на место
((teapotElectric*)&teapot)->TurnOn(); включаем
}
else if (teapot.GetType() == TEAPOT_OLD)
{
teapot.position = stove.burner[1].position;
stove.burner[1].SetFire(true);
}
else
{
Talk("I don't know how to use such teapot.");
return;
}
while (teapot.GetWaterTemp() < 100)
{
delay(10);
}
if (teapot.GetType() == TEAPOT_OLD) stove.burner[1].SetFire(false);
teapot.position = cup.position + float3(10,0,0);
quaternion defaultRot = teapot.rotation;
while( (teapot.rotation != optimalTeapotRotation) && (cup.GetWaterLevel()<cup.GetMaxWaterLevel()-0.1) )
{
teapot.rotation = slerp(teapot.rotation,optimalTeapotRotation,0.1); // аккуратно наливаем, пока чашка недостаточно полна
}
teapot.rotation = defaultRot;
if (teapot.GetType() == TEAPOT_ELECTRIC)
{
teapot.position = teapot.base.position;
}
else if (teapot.GetType() == TEAPOT_OLD)
{
teapot.position = stove.burner[1].position;
}
delay (300000+random (60000));
Drink(&cup);
Talk("cool");
}