Camera funcs, review params names
Just for a better consistency
This commit is contained in:
parent
9097d0b4ef
commit
d82113ec34
2 changed files with 22 additions and 22 deletions
36
src/camera.h
36
src/camera.h
|
@ -110,12 +110,12 @@ extern "C" { // Prevents name mangling of functions
|
||||||
void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available)
|
void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available)
|
||||||
void UpdateCamera(Camera *camera); // Update camera position for selected mode
|
void UpdateCamera(Camera *camera); // Update camera position for selected mode
|
||||||
|
|
||||||
void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera)
|
void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera)
|
||||||
void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera)
|
void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera)
|
||||||
void SetCameraSmoothZoomControl(int szoomKey); // Set camera smooth zoom key to combine with mouse (free camera)
|
void SetCameraSmoothZoomControl(int szoomKey); // Set camera smooth zoom key to combine with mouse (free camera)
|
||||||
void SetCameraMoveControls(int frontKey, int backKey,
|
void SetCameraMoveControls(int keyFront, int keyBack,
|
||||||
int rightKey, int leftKey,
|
int keyRight, int keyLeft,
|
||||||
int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras)
|
int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -289,8 +289,8 @@ void UpdateCamera(Camera *camera)
|
||||||
|
|
||||||
// Keys input detection
|
// Keys input detection
|
||||||
// TODO: Input detection is raylib-dependant, it could be moved outside the module
|
// TODO: Input detection is raylib-dependant, it could be moved outside the module
|
||||||
bool panKey = IsMouseButtonDown(CAMERA.panControl);
|
bool keyPan = IsMouseButtonDown(CAMERA.panControl);
|
||||||
bool altKey = IsKeyDown(CAMERA.altControl);
|
bool keyAlt = IsKeyDown(CAMERA.altControl);
|
||||||
bool szoomKey = IsKeyDown(CAMERA.smoothZoomControl);
|
bool szoomKey = IsKeyDown(CAMERA.smoothZoomControl);
|
||||||
bool direction[6] = { IsKeyDown(CAMERA.moveControl[MOVE_FRONT]),
|
bool direction[6] = { IsKeyDown(CAMERA.moveControl[MOVE_FRONT]),
|
||||||
IsKeyDown(CAMERA.moveControl[MOVE_BACK]),
|
IsKeyDown(CAMERA.moveControl[MOVE_BACK]),
|
||||||
|
@ -362,9 +362,9 @@ void UpdateCamera(Camera *camera)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Input keys checks
|
// Input keys checks
|
||||||
if (panKey)
|
if (keyPan)
|
||||||
{
|
{
|
||||||
if (altKey) // Alternative key behaviour
|
if (keyAlt) // Alternative key behaviour
|
||||||
{
|
{
|
||||||
if (szoomKey)
|
if (szoomKey)
|
||||||
{
|
{
|
||||||
|
@ -500,23 +500,23 @@ void UpdateCamera(Camera *camera)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set camera pan key to combine with mouse movement (free camera)
|
// Set camera pan key to combine with mouse movement (free camera)
|
||||||
void SetCameraPanControl(int panKey) { CAMERA.panControl = panKey; }
|
void SetCameraPanControl(int keyPan) { CAMERA.panControl = keyPan; }
|
||||||
|
|
||||||
// Set camera alt key to combine with mouse movement (free camera)
|
// Set camera alt key to combine with mouse movement (free camera)
|
||||||
void SetCameraAltControl(int altKey) { CAMERA.altControl = altKey; }
|
void SetCameraAltControl(int keyAlt) { CAMERA.altControl = keyAlt; }
|
||||||
|
|
||||||
// Set camera smooth zoom key to combine with mouse (free camera)
|
// Set camera smooth zoom key to combine with mouse (free camera)
|
||||||
void SetCameraSmoothZoomControl(int szoomKey) { CAMERA.smoothZoomControl = szoomKey; }
|
void SetCameraSmoothZoomControl(int szoomKey) { CAMERA.smoothZoomControl = szoomKey; }
|
||||||
|
|
||||||
// Set camera move controls (1st person and 3rd person cameras)
|
// Set camera move controls (1st person and 3rd person cameras)
|
||||||
void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey)
|
void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown)
|
||||||
{
|
{
|
||||||
CAMERA.moveControl[MOVE_FRONT] = frontKey;
|
CAMERA.moveControl[MOVE_FRONT] = keyFront;
|
||||||
CAMERA.moveControl[MOVE_BACK] = backKey;
|
CAMERA.moveControl[MOVE_BACK] = keyBack;
|
||||||
CAMERA.moveControl[MOVE_RIGHT] = rightKey;
|
CAMERA.moveControl[MOVE_RIGHT] = keyRight;
|
||||||
CAMERA.moveControl[MOVE_LEFT] = leftKey;
|
CAMERA.moveControl[MOVE_LEFT] = keyLeft;
|
||||||
CAMERA.moveControl[MOVE_UP] = upKey;
|
CAMERA.moveControl[MOVE_UP] = keyUp;
|
||||||
CAMERA.moveControl[MOVE_DOWN] = downKey;
|
CAMERA.moveControl[MOVE_DOWN] = keyDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CAMERA_IMPLEMENTATION
|
#endif // CAMERA_IMPLEMENTATION
|
||||||
|
|
|
@ -1074,10 +1074,10 @@ RLAPI float GetGesturePinchAngle(void); // Get gesture pin
|
||||||
RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available)
|
RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available)
|
||||||
RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode
|
RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode
|
||||||
|
|
||||||
RLAPI void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera)
|
RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera)
|
||||||
RLAPI void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera)
|
RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera)
|
||||||
RLAPI void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera)
|
RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera)
|
||||||
RLAPI void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras)
|
RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras)
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Basic Shapes Drawing Functions (Module: shapes)
|
// Basic Shapes Drawing Functions (Module: shapes)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue