Change project structure;
Added new c# binding;
This commit is contained in:
17
native/source/Rendering/Camera.c
Normal file
17
native/source/Rendering/Camera.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "Rendering/Camera.h"
|
||||
|
||||
camera_t camera_create(vec3s position, versors rotation, float focal_length, float size_x, float aspect_ratio)
|
||||
{
|
||||
camera_t camera =
|
||||
{
|
||||
.position = position,
|
||||
.rotation = rotation,
|
||||
.focal_length = focal_length,
|
||||
.size_x = size_x,
|
||||
.size_y = size_x / aspect_ratio,
|
||||
.fov_x = 2.0f * (float)atan(size_x / (2.0f * focal_length)),
|
||||
.fov_y = 2.0f * (float)atan(size_x / (2.0f * focal_length * aspect_ratio)),
|
||||
};
|
||||
|
||||
return camera;
|
||||
}
|
||||
Reference in New Issue
Block a user