Search found 118 matches

Re: Is there a math utility (help to do things like: get angle between 2 vector, get yaw from a vector,...) in CryEngine

Maybe I'm wrong, but I think it's ridiculously complicated. It is supposed to be ridiculously complicated, yet it has its own advantage, check Unity's post Benefit: Quaternion rotations do not suffer from Gimbal Lock. Unity also uses quaternion Unity uses Quaternions internally, but shows values of...

Re: Is there a math utility (help to do things like: get angle between 2 vector, get yaw from a vector,...) in CryEngine

Also I don't understand why use quaternion for rotation instead of Ang3 (yaw, pitch, roll)? I think that quaternion is too complicated. (it's not a complaint, it's a question) Please show me the power of quaternion that Ang3 can't archive, if any. I haven't seen the advantage of quaternion, but I'v...

Is there a math utility (help to do things like: get angle between 2 vector, get yaw from a vector,...) in CryEngine?

For now, if I want to get angle between 2 vector (2D), is write this code: float dot = faceDir.x*m_lstFaceDir.x + faceDir.y*m_lstFaceDir.y;//dot product of faceDir and m_lstFaceDir float det = faceDir.x*m_lstFaceDir.y - faceDir.y*m_lstFaceDir.x;//determinant float angle = atan2(det, dot);//atan2(y, ...

Re: Quaternion - Even when CryEngine draws it out, I still don't get it

Now think about the m_lookOrientation with this code to add it to debug IPersistantDebug *pDebug = gEnv->pGameFramework->GetIPersistantDebug(); if (pDebug) { pDebug->Begin("InteractionVector", false); Vec3 pos = m_pEntity->GetWorldPos() + m_pEntity->GetWorldRotation().GetColumn2() * 2.0f; pDebug->Ad...

Re: Quaternion - Even when CryEngine draws it out, I still don't get it

Ok, so there is some hint A quaternion doesn't have a direction by itself. It is a rotation. It can be used to rotate any vector by the rotation it represents. Just multiply a Vector3 by the quaternion. Vector3 targetForward = targetRot * Vector3.forward; Vector3 targetUp = targetRot * Vector3.up; W...

Re: CryEngine 5.4 source code - float A != float B ? should it be absolute of float A - float B > Epsilon instead?

I can't seem to find that expression in CE code base, can you kindly point me to the location? At my first post, I pointed out this code in the file CRYENGINE/Code/CryEngine/CryEntitySystem/Entity.cpp For example, this code if (m_qRotation.v != qRotation.v || m_qRotation.w != qRotation.w) { nWhyFla...

Quaternion - Even when CryEngine draws it out, I still don't get it

So I read this article I prefer thinking of a quaternion as an object that contains a vector and a scalar. so I just vaguely understand quaternion as a vector with weight/scalar. So I tried to visualize it in CryEngine. if (m_pCharacterController->IsWalking()) { Vec3 dir = m_pCharacterController->Ge...

Go to advanced search