// I hereby waive this project under the public domain - see UNLICENSE for details.
namespace PlayBark;
///
/// Provides utilities for creating and managing 3D world elements, including camera setup and map generation.
///
internal static class World3D
{
///
/// Creates and returns a configured Camera3D instance.
///
/// The position of the camera in 3D space.
/// The point the camera is looking at.
/// The up direction for the camera.
/// The projection type of the camera.
/// A configured Camera3D instance.
public static Camera3D Camera(Vector3 pos, Vector3 target, Vector3 up, CameraProjection projection)
{
var camera = new Camera3D();
camera.Position = pos;
camera.Target = target;
camera.Up = up;
camera.FovY = 45.0f;
camera.Projection = projection;
return camera;
}
///
/// Generates a 3D cubic map model from a given image map.
///
/// The image used to generate the cubic map.
/// A Model representing the cubic map.
public static Model CubicMap(Image imMap)
{
var mesh = GenMeshCubicmap(imMap, new Vector3(1.0f, 1.0f, 1.0f));
var model = LoadModelFromMesh(mesh);
return model;
}
}