• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Question about Character Camera Rotation Range

Newbie Spellweaver
Joined
Sep 11, 2022
Messages
20
Reaction score
5
Hello, I'd like to increase the camera rotation range when the character is moving along walls.

Essentially, I want the same freedom of perspective as when not climbing walls.
When climbing a wall, I want to be able to check if enemies are approaching from behind,
but I've been searching for a solution for days without any luck.Does anyone know how to achieve this?

I'm sorry my English isn't very good.
I used Google Translate.
 
Junior Spellweaver
Joined
Feb 2, 2012
Messages
164
Reaction score
56
Hello, I'd like to increase the camera rotation range when the character is moving along walls.

Essentially, I want the same freedom of perspective as when not climbing walls.
When climbing a wall, I want to be able to check if enemies are approaching from behind,
but I've been searching for a solution for days without any luck.Does anyone know how to achieve this?

I'm sorry my English isn't very good.
I used Google Translate.
Do you mean during the wall running animation?
 
Upvote 0
Junior Spellweaver
Joined
Apr 23, 2021
Messages
106
Reaction score
15
find function where are animation & GAME animation updated from and add command to it there.
 
Upvote 0
Junior Spellweaver
Joined
Apr 23, 2021
Messages
106
Reaction score
15
not sure if you were able to solve this by yourself but i felt will to give some handbook text relative to camera in source just in theoritically wrote it down without test so caution to way you may want to adapt and adjust it, some common details to consider and understand how the output is calculcated so you cant just change one of them, or you endup violating the algorytm and math formula how that is now, so focus on whole math formula if you change method somehow :)

CAMERA_TRACKSPEED
CAMERA_WALL_TRACKSPEED
ZCAMERA_FREELOOK
on movement direction/target/position in normal state of animation (minus and plus) conditional animations occured after this.

m_Position
m_CurrentTarget
updates the camera's position (m_Position) based on the target position, direction, and current distance.

m_fCurrentAngleX and m_fCurrentAngleZ
updates the camera's target position (m_CurrentTarget) and angles (m_fCurrentAngleX and m_fCurrentAngleZ) based on tracking speed and desired angles


some basics of cameraroot methods to control and change ingame camera adjustment and definations to override camera's view :

m_Position
updates the camera's position

m_CurrentTarget
updates the camera's target position


Booleans to call function if neccessary and Check for Collider condition,"bCollisionWall".

Depending on whether a collision with a wall was detected

this adjusts the camera's distance (m_fCurrentDist).
its following defination under of m_fCurrentDist and if a collision occurred, it adjusts the distance at a faster rate (CAMERA_WALL_TRACKSPEED) compared previous updated to when no collision occurred (CAMERA_TRACKSPEED).


CheckCollisionWall
function to perform additional collision checks and adjust the camera distance further if necessary.

RSetCamera (Realspace to set device for camera)
m_bShocked (in condition checked camera(interrupted/and etc to cause screen shocked)
CameraPos(Default adjustment)

"ZCAMERA_FREELOOK"
this enabled will add "observation-mode" , free rotation mode to camera to player .


(pos)
Collision Checking performs collision checks in four directions: up, down, left, and right relative to the camera's position (pos) and direction (dir). For each direction
(dir).
the collision point plus the direction vector and from these 3 and other factors are calculated the fRealDist camera position and distance ingame.
(-dir).
(the camera values are added or decreased by various conditions to calculate real adjust of camera, so be aware of this as you change one function conditons, you may break the method for all the other conditions by skipping or changing one of them to not return neccessary update state.)

fRealDist
mix of cam distance between target and adjusted position by default its minus 10 units to overcome any overlaps that can be caused by camera position glitched so this is the physical camera vol presence.

Advanced state of camera adjusts:

initializes variables and calculates values related to the camera's field of view and aspect ratio.

fNearZ

It calculates a target position (tar) based on the camera's near plane distance (fNearZ)

tar
pos & dir

calculates a target position (tar) based on the camera's near plane distance (fNearZ) and the direction vector.

fD
Pick
The environment using the Pick function.
If a collision is detected, it further calculates the intersection point (bpi.PickPos) and compares it with the target position to determine if the collision is closer.
If the collision is closer, it calculates the distance (fD) between the target position and the intersection point.

fPH or fPV
If the distance is within certain thresholds (fPH or fPV), it determines if the collision is significant based on the angle between vectors.

end of methods
Return: It returns a boolean value indicating whether any collision with a wall was detected ("bCollisionWall") remember
bCollisionWall = true;
m_bCollision[1] = true;
but it has to update the boolean to false once you are further away from walls so to update current player position you return to check everytime you meet req to collide with objects.
->>
return bCollisionWall;
 
Upvote 0
Newbie Spellweaver
Joined
Sep 11, 2022
Messages
20
Reaction score
5
not sure if you were able to solve this by yourself but i felt will to give some handbook text relative to camera in source just in theoritically wrote it down without test so caution to way you may want to adapt and adjust it, some common details to consider and understand how the output is calculcated so you cant just change one of them, or you endup violating the algorytm and math formula how that is now, so focus on whole math formula if you change method somehow :)

Thank you so much, Megaju9, for dedicating your valuable time to me.

Your great codes will be useful not only to me but to many others as well.
Thank you once again for spending your precious time.

(Please note that using Google Translate may not convey my sincere gratitude 100%.
Thank you for understanding!) (y)
 
Upvote 0
Junior Spellweaver
Joined
Apr 23, 2021
Messages
106
Reaction score
15
Thank you so much, Megaju9, for dedicating your valuable time to me.

Your great codes will be useful not only to me but to many others as well.
Thank you once again for spending your precious time.

(Please note that using Google Translate may not convey my sincere gratitude 100%.
Thank you for understanding!) (y)
no problem, I should use the translator myself when I start writing these long messages. and from that now I hope you get an idea of how things would work in theory when you read it from the code, my purpose was to offer you the answers to your question so that you know where to look and the basic camera.cpp features in the source listed by name so that you know where to look and what you need to know if you intend to proceed independently .
 
Upvote 0
Back
Top