stm Posted August 21, 2018 Share Posted August 21, 2018 Need functions to control the firing point on the vertical axis, for the full implementation of the first-person view. Link to comment
qaisjp Posted August 22, 2018 Share Posted August 22, 2018 What functions are you currently using, and what extra functions do you need? Link to comment
stm Posted August 22, 2018 Author Share Posted August 22, 2018 I do custom camera control. tracking mouse movement in onClientCursorMove modify the camera position in onClientPreRender change the camera position setCameraMatrix localPlayer turn in the direction of the camera using setElementRotation, set direction to target setCameraTarget( targetX, target, target ) at the same time visually the model directs the weapon in the right direction, but the shooting is not in this direction but strictly forward for the horizontal plane, this is not critical because in this plane the direction of the player and the camera are the same, but for the vertical plane this is not the case, the obvious solution to rotate the player in the vertical plane leads to 2 problems: at significant angles difficult movement of the player it is not possible to use this mechanism for a third-person regime Need a function that allows you to set the direction of fire.it could be setCameraTarget, if it changed not only the visual direction, but the actual direction of the fire. Or a separate function allows you to set the angle of fire in the vertical plane. I would also like to be able to set for the camera not only FOV but also AspectRatio, NearClip, FarClip Link to comment
stm Posted August 23, 2018 Author Share Posted August 23, 2018 https://github.com/multitheftauto/mtasa-blue/blob/2918d952c50b10553286e5a6c7bbbcd391ac206d/Client/mods/deathmatch/logic/CClientPed.cpp#L4772 https://github.com/multitheftauto/mtasa-blue/blob/2918d952c50b10553286e5a6c7bbbcd391ac206d/Client/mods/deathmatch/logic/CClientPed.cpp#L4772It may be sufficient here to change the computation of the vector vecTarget vecTarget = CVector(vecOrigin.fX + (vecTemp.fX * fRange), vecOrigin.fY + (vecTemp.fY * fRange), vecOrigin.fZ); Link to comment
stm Posted August 23, 2018 Author Share Posted August 23, 2018 Or add forced override pCurrentWeaponInfo->IsFlagSet(WEAPONTYPE_FIRSTPERSON) for first-person camera mode https://github.com/multitheftauto/mtasa-blue/blob/2918d952c50b10553286e5a6c7bbbcd391ac206d/Client/mods/deathmatch/logic/CClientPed.cpp#L4707 https://github.com/multitheftauto/mtasa-blue/blob/2918d952c50b10553286e5a6c7bbbcd391ac206d/Client/mods/deathmatch/logic/CClientPed.cpp#L4707 Link to comment
Recommended Posts