diff --git a/docs/Roadmap.md b/docs/Roadmap.md index dfe01103..1f26ddd5 100644 --- a/docs/Roadmap.md +++ b/docs/Roadmap.md @@ -10,7 +10,8 @@ Marked: `crucial`, **Next or Big**, _Important_. fix splitscreen broken with refractions? -🌊**refract**? **crash** on: Surreal, HexForest, Bug, Glitch +🌊**refract** river roads **crash** on: Surreal, HexForest, Bug, Glitch +no water collis on: Butterfly, SlopeCity.. fix compositor / rqg: car glass not refracted, offset, glass pipes not underwater more fluids at once, blink on MilkyWay diff --git a/src/common/SceneEmitters.cpp b/src/common/SceneEmitters.cpp index 9ee7ac43..0e4d55ed 100644 --- a/src/common/SceneEmitters.cpp +++ b/src/common/SceneEmitters.cpp @@ -70,6 +70,12 @@ void SEmitter::UpdEmitter() ps->getEmitter(0)->setParameter("height", toStr(size.z)); ps->getEmitter(0)->setParameter("depth", toStr(size.y)); // h ps->getEmitter(0)->setEmissionRate(rate); + Vector3 dir = SplineRoad::GetRot(yaw, pitch); + ps->getEmitter(0)->setDirection(dir); + //ps->getEmitter(0)->setAngle(roll); + //ps->getEmitter(0)->setParticleVelocity(minVel,maxVel); // todo? + //ps->getEmitter(0)->setMinTimeToLive(minTime); + //ps->getEmitter(0)->setMaxTimeToLive(maxTime); } void CScene::DestroyEmitters(bool clear) diff --git a/src/common/data/SceneClasses.h b/src/common/data/SceneClasses.h index 3ecf957f..2ef038dc 100755 --- a/src/common/data/SceneClasses.h +++ b/src/common/data/SceneClasses.h @@ -188,7 +188,8 @@ class SEmitter // 🔥 Particles ⛅☢️ public: std::string name; // particle_system Ogre::Vector3 pos{0,0,0}, size{1,1,1}; - Ogre::Vector3 up{0,1,0}; float rot = 0.f, velScale = 1.f; // dir todo: + float yaw = 0.f, pitch = -90.f; // dir angles + // Ogre::Vector3 dir{0,1,0}; float velScale = 1.f; // todo: dir Ogre::Vector2 par{1,1}; // auto set original particle size from .emitter float rate = 0.f; // emit float parScale = 1.f; diff --git a/src/common/data/SceneXml_Load.cpp b/src/common/data/SceneXml_Load.cpp index a9ae3288..db1c5d1a 100644 --- a/src/common/data/SceneXml_Load.cpp +++ b/src/common/data/SceneXml_Load.cpp @@ -347,8 +347,8 @@ bool Scene::LoadXml(String file, bool bTer) a = u->Attribute("pos"); if (a) p.pos = s2v(a); a = u->Attribute("sc"); if (a) p.size = s2v(a); - a = u->Attribute("up"); if (a) p.up = s2v(a); - a = u->Attribute("rot"); if (a) p.rot = s2r(a); + a = u->Attribute("yaw"); if (a) p.yaw = s2r(a); // dir + a = u->Attribute("pt"); if (a) p.pitch = s2r(a); a = u->Attribute("rate"); if (a) p.rate = s2r(a); a = u->Attribute("st"); if (a) p.stat = s2i(a); diff --git a/src/common/data/SceneXml_Save.cpp b/src/common/data/SceneXml_Save.cpp index 1b6437d9..04c19cd4 100644 --- a/src/common/data/SceneXml_Save.cpp +++ b/src/common/data/SceneXml_Save.cpp @@ -393,8 +393,8 @@ bool Scene::SaveXml(String file) oe->SetAttribute("pos", toStrC(e->pos)); oe->SetAttribute("sc", toStrC(e->size)); - oe->SetAttribute("up", toStrC(e->up)); - oe->SetAttribute("rot", toStrC(e->rot)); + oe->SetAttribute("yaw", toStrC(e->yaw)); // dir + oe->SetAttribute("pt", toStrC(e->pitch)); oe->SetAttribute("rate", toStrC(e->rate)); oe->SetAttribute("st", e->stat ? 1 : 0); diff --git a/src/editor/Update_EditKeyTxt.cpp b/src/editor/Update_EditKeyTxt.cpp index 5f5e2363..19d90238 100644 --- a/src/editor/Update_EditKeyTxt.cpp +++ b/src/editor/Update_EditKeyTxt.cpp @@ -397,7 +397,7 @@ void App::KeyTxtEmitters(Real q) // pos, rot, scale emtTxt[2]->setCaption(String(emtEd==EO_Move ?"#60FF60":"")+ sPos +fToStr(e.pos.x,1,4)+" "+fToStr(e.pos.y,1,4)+" "+fToStr(e.pos.z,1,4)); - emtTxt[3]->setCaption(String(emtEd==EO_Rotate?"#FFA0A0":"")+ sRot +"y " +fToStr(e.rot/*e.up.x*/,0,3) ); + emtTxt[3]->setCaption(String(emtEd==EO_Rotate?"#FFA0A0":"")+ sRot +" " +fToStr(e.yaw,0,3) +" "+ fToStr(e.pitch,0,3) ); emtTxt[4]->setCaption(String(emtEd==EO_Scale ?"#60F0FF":"")+ sScl +fToStr(e.size.x,1,4)+" "+fToStr(e.size.y,1,4)+" "+fToStr(e.size.z,1,4)); emtTxt[5]->setCaption(TR("#{Size}: ") +fToStr(e.parScale,2,4)+" * "+fToStr(e.par.x,1,3) ); diff --git a/src/editor/Update_EditMouse.cpp b/src/editor/Update_EditMouse.cpp index b041518e..e8f1d26d 100644 --- a/src/editor/Update_EditMouse.cpp +++ b/src/editor/Update_EditMouse.cpp @@ -234,11 +234,19 @@ void App::MouseEmitters() em.pos.y += ym; em.nd->setPosition(em.pos); em.nd->_getFullTransformUpdated(); UpdEmtBox(); } - else if (mbMiddle) // rot yaw + }else if (emtEd == EO_Rotate) + { + if (mbLeft) // rot y + { + Real xm = vNew.x * fRot * moveMul; + em.yaw += xm; + em.UpdEmitter(); + } + else if (mbRight) // rot x { - Real xm = vNew.x * fRot * moveMul * s; - em.rot += xm; - //em.nd->setOrientation(Quaternion(Degree(em.rot.x), em.up)); + Real ym = vNew.x * fRot * moveMul; + em.pitch += ym; + em.UpdEmitter(); } }else if(emtEd == EO_Scale) {