Skip to content
Flecs v4.1
script_math.h
Go to the documentation of this file.
1/**
2 * @file addons/script_math.h
3 * @brief Math functions for Flecs script.
4 */
5
6#ifdef FLECS_SCRIPT_MATH
7
8#ifndef FLECS_SCRIPT
9#define FLECS_SCRIPT
10#endif
11
12/**
13 * @defgroup c_addons_script_math Script Math
14 * @ingroup c_addons
15 * Math functions for Flecs script.
16 * @{
17 */
18
19#ifndef FLECS_SCRIPT_MATH_H
20#define FLECS_SCRIPT_MATH_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26FLECS_API
27extern ECS_COMPONENT_DECLARE(EcsScriptRng);
28
29/** Random number generator. */
30typedef struct {
31 uint64_t seed; /**< Random seed value. */
32 void *impl; /**< Implementation data. */
33} EcsScriptRng;
34
35/** Script math import function.
36 * Usage:
37 * @code
38 * ECS_IMPORT(world, FlecsScriptMath)
39 * @endcode
40 *
41 * @param world The world.
42 */
43FLECS_API
44void FlecsScriptMathImport(
45 ecs_world_t *world);
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif
52
53/** @} */
54
55#endif
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:439
#define ECS_COMPONENT_DECLARE(id)
Forward declare a component.
Definition flecs_c.h:65