Script-side API exposed to user DLLs. More...
Namespaces | |
| namespace | Raven::Script::Log::Internal |
| Internal ABI-stable log sinks. Prefer the typed templates below. | |
Classes | |
| class | Raven::ScriptBase |
| Abstract base class for all user-authored native scripts. More... | |
| struct | Raven::ScriptLifecycle |
| Factory and destructor callbacks for a single registered script type. More... | |
Macros | |
| #define | RV_REFLECT(Type) |
| Registers a script class with the Ignite reflection and lifecycle system. | |
| #define | RV_REFLECT_MEMBER(Type, Member) |
| Exposes a member variable of a reflected script class to the inspector and serialisation system. | |
Typedefs | |
| using | RV_RegisterScriptsFn = void (*)(Raven::TypeRegistry*, std::unordered_map<Raven::TypeID, Raven::ScriptLifecycle>*) |
| Type alias for the exported registration function pointer. | |
Functions | |
| template<typename... Args> | |
| void | Raven::Script::Log::Debug (std::format_string< Args... > fmt, Args &&... args) |
Logs a debug-level message from a script. Supports std::format syntax. | |
| template<typename... Args> | |
| void | Raven::Script::Log::Info (std::format_string< Args... > fmt, Args &&... args) |
Logs an info-level message from a script. Supports std::format syntax. | |
| template<typename... Args> | |
| void | Raven::Script::Log::Warning (std::format_string< Args... > fmt, Args &&... args) |
Logs a warning-level message from a script. Supports std::format syntax. | |
| template<typename... Args> | |
| void | Raven::Script::Log::Error (std::format_string< Args... > fmt, Args &&... args) |
Logs an error-level message from a script. Supports std::format syntax. | |
| template<typename... Args> | |
| void | Raven::Script::Log::Critical (std::format_string< Args... > fmt, Args &&... args) |
Logs a critical-level message from a script. Supports std::format syntax. | |
| void | Raven::Script::Physics::AddImpulse (u64 entityID, const Crux::vec3 &impulse) |
| Applies an instantaneous linear impulse to an entity's physics body. | |
| void | Raven::Script::Physics::AddForce (u64 entityID, const Crux::vec3 &force) |
| Applies a continuous force to an entity's physics body for the current sub-step. | |
| void | Raven::Script::Physics::AddTorque (u64 entityID, const Crux::vec3 &torque) |
| Applies a continuous torque to an entity's physics body for the current sub-step. | |
| void | Raven::Script::Physics::AddLinearVelocity (u64 entityID, const Crux::vec3 &velocity) |
| Adds a delta to the current linear velocity of an entity's physics body. | |
| void | Raven::Script::Physics::SetLinearVelocity (u64 entityID, const Crux::vec3 &velocity) |
| Overwrites the linear velocity of an entity's physics body. | |
| Crux::vec3 | Raven::Script::Physics::GetLinearVelocity (u64 entityID) |
| Returns the current linear velocity of an entity's physics body. | |
| void | Raven::Script::Physics::AddAngularImpulse (u64 entityID, const Crux::vec3 &impulse) |
| Applies an instantaneous angular impulse to an entity's physics body. | |
| void | Raven::Script::Physics::SetAngularVelocity (u64 entityID, const Crux::vec3 &velocity) |
| Overwrites the angular velocity of an entity's physics body. | |
| Crux::vec3 | Raven::Script::Physics::GetAngularVelocity (u64 entityID) |
| Returns the current angular velocity of an entity's physics body. | |
| void | Raven::Script::Physics::SetGravityFactor (u64 entityID, float factor) |
| Scales the world gravity vector for a single entity's physics body. | |
| void | Raven::Script::Physics::SetActive (u64 entityID, bool active) |
| Activates or deactivates an entity's physics body in the simulation. | |
| void | Raven::Script::Random::Seed (u64 seed) |
| Seeds the script-side random engine with an explicit value. | |
| f32 | Raven::Script::Random::Float () |
Returns a random f32 in [0, 1). | |
| f32 | Raven::Script::Random::Float (f32 max) |
Returns a random f32 in [0, max). | |
| f32 | Raven::Script::Random::Float (f32 min, f32 max) |
Returns a random f32 in [min, max). | |
| u32 | Raven::Script::Random::Int () |
Returns a random u32 over the full range. | |
| u32 | Raven::Script::Random::Int (u32 max) |
Returns a random u32 in [0, max). | |
| u32 | Raven::Script::Random::Int (u32 min, u32 max) |
Returns a random u32 in [min, max). | |
| u64 | Raven::Script::Random::U64 () |
Returns a random u64 constructed from two u32 draws. | |
| f64 | Raven::Script::Random::Double () |
Returns a random f64 in [0, 1). | |
| f64 | Raven::Script::Random::Double (f64 max) |
Returns a random f64 in [0, max). | |
| f64 | Raven::Script::Random::Double (f64 min, f64 max) |
Returns a random f64 in [min, max). | |
| void | Raven::Script::Renderer::CreateMesh (Entity &entity, const std::string &path) |
| Loads a static mesh asset and attaches it to an entity. | |
| void | Raven::Script::Scene::SetContext (class Scene *scene) |
| Sets the scene that all Script::Scene API calls will operate on. | |
| Entity | Raven::Script::Scene::CreateEntity (const std::string &name) |
| Creates a new entity in the active scene. | |
| void | Raven::Script::Scene::DestroyEntity (u64 entityID) |
| Destroys the entity with the given ID in the active scene. | |
| Entity | Raven::Script::Scene::FindEntityByName (const std::string &name) |
Searches the active scene for an entity whose TagComponent matches name. | |
Script-side API exposed to user DLLs.
Contains the base class, lifecycle descriptors, reflection registration machinery (RV_REFLECT / RV_REFLECT_MEMBER macros and the pending-registration lists), the scene context, and the facade namespaces scripts call into.
| #define RV_REFLECT | ( | Type | ) |
Registers a script class with the Ignite reflection and lifecycle system.
Place at file scope in ScriptEntry.cpp, after including the class header. The class must inherit from Raven::ScriptBase. Generates a static Raven::PendingRegistration instance that self-registers at DLL load time and is flushed into the engine registry when RV_RegisterScripts is called.
| Type | Fully-qualified script class name. |
| #define RV_REFLECT_MEMBER | ( | Type, | |
| Member ) |
Exposes a member variable of a reflected script class to the inspector and serialisation system.
Place at file scope in ScriptEntry.cpp immediately after the RV_REFLECT call for the owning class. Generates a static Raven::PendingMemberRegistration that records the member's name, type, and byte offset. Supported member types are those covered by TypeCategoryTrait (scalars, strings, and Crux vector types).
| Type | Fully-qualified script class name. |
| Member | Unqualified member variable name. |
| using RV_RegisterScriptsFn = void (*)(Raven::TypeRegistry*, std::unordered_map<Raven::TypeID, Raven::ScriptLifecycle>*) |
Type alias for the exported registration function pointer.
Raven::ScriptRegistry resolves this symbol via GetProcAddress and calls it to populate the engine's type registry and lifecycle map.
| IGNITE_API void Raven::Script::Physics::AddAngularImpulse | ( | u64 | entityID, |
| const Crux::vec3 & | impulse ) |
Applies an instantaneous angular impulse to an entity's physics body.
| entityID | ECS entity identifier. |
| impulse | Angular impulse in world space (kg*m²/s). |
| IGNITE_API void Raven::Script::Physics::AddForce | ( | u64 | entityID, |
| const Crux::vec3 & | force ) |
Applies a continuous force to an entity's physics body for the current sub-step.
| entityID | ECS entity identifier. |
| force | Force vector in world space (N). |
| IGNITE_API void Raven::Script::Physics::AddImpulse | ( | u64 | entityID, |
| const Crux::vec3 & | impulse ) |
Applies an instantaneous linear impulse to an entity's physics body.
| entityID | ECS entity identifier. |
| impulse | Impulse vector in world space (kg*m/s). |
| IGNITE_API void Raven::Script::Physics::AddLinearVelocity | ( | u64 | entityID, |
| const Crux::vec3 & | velocity ) |
Adds a delta to the current linear velocity of an entity's physics body.
| entityID | ECS entity identifier. |
| velocity | Velocity delta in world space (m/s). |
| IGNITE_API void Raven::Script::Physics::AddTorque | ( | u64 | entityID, |
| const Crux::vec3 & | torque ) |
Applies a continuous torque to an entity's physics body for the current sub-step.
| entityID | ECS entity identifier. |
| torque | Torque vector in world space (N*m). |
| IGNITE_API Entity Raven::Script::Scene::CreateEntity | ( | const std::string & | name | ) |
Creates a new entity in the active scene.
| name | Display name assigned to the entity's TagComponent. |
| IGNITE_API void Raven::Script::Renderer::CreateMesh | ( | Entity & | entity, |
| const std::string & | path ) |
Loads a static mesh asset and attaches it to an entity.
| entity | Reference to the entity that will receive a StaticMeshComponent. |
| path | Project-relative path to the mesh asset. |
| void Raven::Script::Log::Critical | ( | std::format_string< Args... > | fmt, |
| Args &&... | args ) |
Logs a critical-level message from a script. Supports std::format syntax.
| Args | Format argument types. |
| fmt | Format string. |
| args | Format arguments. |
| void Raven::Script::Log::Debug | ( | std::format_string< Args... > | fmt, |
| Args &&... | args ) |
Logs a debug-level message from a script. Supports std::format syntax.
| Args | Format argument types. |
| fmt | Format string. |
| args | Format arguments. |
| IGNITE_API void Raven::Script::Scene::DestroyEntity | ( | u64 | entityID | ) |
Destroys the entity with the given ID in the active scene.
| entityID | ECS entity identifier (ScriptBase::EntityID). |
| IGNITE_API f64 Raven::Script::Random::Double | ( | ) |
Returns a random f64 in [0, 1).
f32 draw; precision beyond ~7 significant digits is not guaranteed. | IGNITE_API f64 Raven::Script::Random::Double | ( | f64 | max | ) |
Returns a random f64 in [0, max).
| max | Exclusive upper bound. |
| IGNITE_API f64 Raven::Script::Random::Double | ( | f64 | min, |
| f64 | max ) |
Returns a random f64 in [min, max).
| min | Inclusive lower bound. |
| max | Exclusive upper bound. |
| void Raven::Script::Log::Error | ( | std::format_string< Args... > | fmt, |
| Args &&... | args ) |
Logs an error-level message from a script. Supports std::format syntax.
| Args | Format argument types. |
| fmt | Format string. |
| args | Format arguments. |
| IGNITE_API Entity Raven::Script::Scene::FindEntityByName | ( | const std::string & | name | ) |
Searches the active scene for an entity whose TagComponent matches name.
| name | Name to search for (exact match against TagComponent::Tag). |
| IGNITE_API f32 Raven::Script::Random::Float | ( | ) |
Returns a random f32 in [0, 1).
| IGNITE_API f32 Raven::Script::Random::Float | ( | f32 | max | ) |
Returns a random f32 in [0, max).
| max | Exclusive upper bound. |
| IGNITE_API f32 Raven::Script::Random::Float | ( | f32 | min, |
| f32 | max ) |
Returns a random f32 in [min, max).
| min | Inclusive lower bound. |
| max | Exclusive upper bound. |
| IGNITE_API Crux::vec3 Raven::Script::Physics::GetAngularVelocity | ( | u64 | entityID | ) |
Returns the current angular velocity of an entity's physics body.
| entityID | ECS entity identifier. |
| IGNITE_API Crux::vec3 Raven::Script::Physics::GetLinearVelocity | ( | u64 | entityID | ) |
Returns the current linear velocity of an entity's physics body.
| entityID | ECS entity identifier. |
| void Raven::Script::Log::Info | ( | std::format_string< Args... > | fmt, |
| Args &&... | args ) |
Logs an info-level message from a script. Supports std::format syntax.
| Args | Format argument types. |
| fmt | Format string. |
| args | Format arguments. |
| IGNITE_API u32 Raven::Script::Random::Int | ( | ) |
Returns a random u32 over the full range.
| IGNITE_API u32 Raven::Script::Random::Int | ( | u32 | max | ) |
Returns a random u32 in [0, max).
| max | Exclusive upper bound. |
| IGNITE_API u32 Raven::Script::Random::Int | ( | u32 | min, |
| u32 | max ) |
Returns a random u32 in [min, max).
| min | Inclusive lower bound. |
| max | Exclusive upper bound. |
| IGNITE_API void Raven::Script::Random::Seed | ( | u64 | seed | ) |
Seeds the script-side random engine with an explicit value.
If never called, the engine is seeded lazily on first use via Crux::Entropy::GetSeedPair.
| seed | Seed value. The internal sequence is derived as seed ^ 0xdeadbeef. |
| IGNITE_API void Raven::Script::Physics::SetActive | ( | u64 | entityID, |
| bool | active ) |
Activates or deactivates an entity's physics body in the simulation.
| entityID | ECS entity identifier. |
| active | true to activate (wake), false to deactivate (sleep). |
| IGNITE_API void Raven::Script::Physics::SetAngularVelocity | ( | u64 | entityID, |
| const Crux::vec3 & | velocity ) |
Overwrites the angular velocity of an entity's physics body.
| entityID | ECS entity identifier. |
| velocity | New angular velocity in world space (rad/s). |
| IGNITE_API void Raven::Script::Scene::SetContext | ( | class Scene * | scene | ) |
Sets the scene that all Script::Scene API calls will operate on.
Called by ScriptRuntime::OnRuntimeStart with the active scene and by ScriptRuntime::OnRuntimeStop with nullptr.
| scene | Scene to make active, or nullptr to clear the context. |
| IGNITE_API void Raven::Script::Physics::SetGravityFactor | ( | u64 | entityID, |
| float | factor ) |
Scales the world gravity vector for a single entity's physics body.
| entityID | ECS entity identifier. |
| factor | Gravity multiplier: 0 = weightless, 1 = full gravity, negative = anti-gravity. |
| IGNITE_API void Raven::Script::Physics::SetLinearVelocity | ( | u64 | entityID, |
| const Crux::vec3 & | velocity ) |
Overwrites the linear velocity of an entity's physics body.
| entityID | ECS entity identifier. |
| velocity | New linear velocity in world space (m/s). |
| IGNITE_API u64 Raven::Script::Random::U64 | ( | ) |
Returns a random u64 constructed from two u32 draws.
| void Raven::Script::Log::Warning | ( | std::format_string< Args... > | fmt, |
| Args &&... | args ) |
Logs a warning-level message from a script. Supports std::format syntax.
| Args | Format argument types. |
| fmt | Format string. |
| args | Format arguments. |