I need to do a raycast which accepts a Vector3D StartPos and a Vector3D EndPos.
I have available to me the characters position and the cameras rotation in 3D vectors.
I need to somehow compute a 'forward heading' from the cameras rotation and apply it to the players position and multiply by some large number to get my EndPos vector however I can't figure out the math behind it, I know I can use sin() and cos() here which is the approach i'd like to take.
irr::core::vector3df CamRotation = GetOwner()->GetRotation(); irr::core::vector3df StartPos(GetOwner()->GetPosition().x(), GetOwner()->GetPosition().y(), GetOwner()->GetPosition().z()); irr::core::vector3df EndPos(0, 0, 0);
I've experimented around with using sin() and cos() in different combinations throwing in negative signs into places but quite frankly I don't know how to properly use those functions.