How to set the object surface correctly with C++ CE 5.4 ?

#1
Hi,
I made a C4Bomb Class with ALL things like as explosion,destroy area, etc
I have a question,How to set the object surface correctly with C++ CE 5.4 ?

Code: Select all

if (hit.dist <2.5f && hit.dist >= 0.3f) { IPersistantDebug *iPD = gEnv->pGameFramework->GetIPersistantDebug(); iPD->Begin("EnshaAllah5", false); iPD->AddText3D(hit.pt, 2.15f, ColorF(0, 1, 1), 12.1f, "C4 Boom here"); SEntitySpawnParams spawnParams; spawnParams.pClass =gEnv->pEntitySystem->GetClassRegistry()->GetDefaultClass(); spawnParams.vPosition =hit.pt; spawnParams.qRotation= ??? const float C4BomScale = 1.25f; spawnParams.vScale = Vec3(C4BomScale); IEntity* pEntity = gEnv->pEntitySystem->SpawnEntity(spawnParams); pEntity->CreateComponentClass<CC4BombComponent>(); ... .. .

spawnParams.qRotation= ???


Please help me , Thank you
C++ Programmer
https://www.youtube.com/AhmadKarami

Re: How to set the object surface correctly with C++ CE 5.4 ?

#2
qRotation is rotation of your entity in Quaternion. You don't have to set it at all. You can delete this line. Unless you want some particular rotation for it? You really should google more. You come here everytime with new question, and all of your questions so far have been answered in the past. Just google it before you post here.
However. . Did you firstly TRY to change surface in c++ ? What code did you use to achieve that and failed before you came here ?
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: How to set the object surface correctly with C++ CE 5.4 ?

#3
qRotation is rotation of your entity in Quaternion. You don't have to set it at all. You can delete this line. Unless you want some particular rotation for it? You really should google more. You come here everytime with new question, and all of your questions so far have been answered in the past. Just google it before you post here.
However. . Did you firstly TRY to change surface in c++ ? What code did you use to achieve that and failed before you came here ?
thank you dear fury22uk , I found answers for a few question by myself , yes , I searched google with unity answers like as :

01- Dot (U , L) <0 or Dot(U,L) >0
02-transform.rotation = Quaternion.FromToRotation(transform.up, hit.normal) * transform.rotation;


but I did it but does not work :-(
spawnParams.vPosition =Vec3(hit.pt.x + hit.n.x*0.2f, hit.pt.y + hit.n.y*0.2f, hit.pt.z + hit.n.z*0.2f); // hit.pt;//+Vec3(0,3,0); // all my c4bomb are one direction!


yes, I did it , for my project (Unity) :
https://www.youtube.com/watch?v=lFMZwnV ... pJJ_dlZAG7

yes , I changed different rotations , if my C4bomb was a sphere ,that I no had problem , but my C4bomb is rectangle model :-)

I'm game play programmer at unity/s2engine/ue4 (C# / javascript / blueprints) , I migrate to CryEngine C++ , I stay in C++ CryEngine for always , so , I need to time for found my answers and I learning advanced C++ , I must read lot c++ books , for knowledge how to work methods,functions,class,etc in C++ CryEngine , I hope you can understand me
I need to answers , thank you again dear fury22uk ;-)
C++ Programmer
https://www.youtube.com/AhmadKarami

Who is online

Users browsing this forum: No registered users and 2 guests