Files
dusk/src/duskrpg/scene/overworldscene.h
T
2026-07-19 14:05:46 -05:00

46 lines
1.3 KiB
C

/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "scene/scenebase.h"
#include "entity/entitybase.h"
typedef struct {
float_t angle;
float_t radius;
float_t height;
float_t speed;
} overworldcameraorbit_t;
/**
* Creates the overworld scene: a static ground plane, a player entity
* (dynamic capsule body, moved relative to the camera by
* COMPONENT_TYPE_PLAYER's own update callback), and a camera orbiting the
* origin (see overworldSceneCameraOrbitUpdate). Does not make the scene
* active -- call sceneSetActive with the returned ID.
*
* @return The ID of the newly created scene.
*/
sceneid_t overworldSceneCreate(void);
/**
* Per-tick update for the test camera: orbits it around the world origin
* at a fixed radius/height/speed, always looking back at the origin.
* Registered automatically by overworldSceneCreate.
*
* @param mgr The entity manager that owns the entity.
* @param entityId The camera entity ID.
* @param componentId The camera's position component ID.
* @param user Pointer to this camera's overworldcameraorbit_t state.
*/
void overworldSceneCameraOrbitUpdate(
entitymanager_t *mgr,
const entityid_t entityId,
const componentid_t componentId,
void *user
);