Skip to content

Commit

Permalink
fixed errors in Core
Browse files Browse the repository at this point in the history
  • Loading branch information
CreedVI committed Jul 1, 2021
1 parent 1eab216 commit 3b533e4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/com/creedvi/raylib/java/rlj/core/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -974,12 +974,12 @@ public Ray GetMouseRay(Vector2 mouse, Camera3D camera){

Matrix matProj = MatrixIdentity();

if (camera.getType() == CAMERA_PERSPECTIVE.getCamType()){
if (camera.getType() == CAMERA_PERSPECTIVE){
// Calculate projection matrix from perspective
matProj = MatrixPerspective(camera.getFovy() * DEG2RAD,
((double) GetScreenWidth() / (double) GetScreenHeight()), RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR);
}
else if (camera.getType() == CAMERA_ORTHOGRAPHIC.getCamType()){
else if (camera.getType() == CAMERA_ORTHOGRAPHIC){
float aspect = (float) window.screen.getWidth() / (float) window.screen.getHeight();
double top = camera.getFovy() / 2.0;
double right = top * aspect;
Expand All @@ -1003,10 +1003,10 @@ else if (camera.getType() == CAMERA_ORTHOGRAPHIC.getCamType()){
// Calculate normalized direction vector
Vector3 direction = Vector3Normalize(Vector3Subtract(farPoint, nearPoint));

if (camera.getType() == CAMERA_PERSPECTIVE.getCamType()){
if (camera.getType() == CAMERA_PERSPECTIVE){
ray.position = camera.getPosition();
}
else if (camera.getType() == CAMERA_ORTHOGRAPHIC.getCamType()){
else if (camera.getType() == CAMERA_ORTHOGRAPHIC){
ray.position = cameraPlanePointerPos;
}

Expand Down Expand Up @@ -1063,12 +1063,12 @@ Vector2 GetWorldToScreenEx(Vector3 position, Camera3D camera, int width, int hei
// Calculate projection matrix (from perspective instead of frustum
Matrix matProj = MatrixIdentity();

if (camera.getType() == CAMERA_PERSPECTIVE.getCamType()){
if (camera.getType() == CAMERA_PERSPECTIVE){
// Calculate projection matrix from perspective
matProj = MatrixPerspective(camera.getFovy() * DEG2RAD, ((double) width / (double) height),
RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR);
}
else if (camera.getType() == CAMERA_ORTHOGRAPHIC.getCamType()){
else if (camera.getType() == CAMERA_ORTHOGRAPHIC){
float aspect = (float) window.screen.getWidth() / (float) window.screen.getHeight();
double top = camera.getFovy() / 2.0;
double right = top * aspect;
Expand Down

0 comments on commit 3b533e4

Please sign in to comment.