Unravel Engine C++ Reference
Loading...
Searching...
No Matches
bullet_backend.h
Go to the documentation of this file.
1#pragma once
2#include <engine/engine_export.h>
3
4#include <base/basetypes.hpp>
5#include <context/context.hpp>
6
10#include <hpp/small_vector.hpp>
11
12namespace unravel
13{
14class camera;
15
16template<typename T, size_t SmallSizeCapacity = 8>
17using physics_vector = hpp::small_vector<T, SmallSizeCapacity>;
18
20{
21 void init();
22 void deinit();
25 void on_play_end(rtti::context& ctx);
26 void on_pause(rtti::context& ctx);
27 void on_resume(rtti::context& ctx);
29
31 float explosion_force,
32 const math::vec3& explosion_position,
33 float explosion_radius,
34 float upwards_modifier,
35 force_mode mode);
36 static void apply_force(physics_component& comp, const math::vec3& force, force_mode mode);
37 static void apply_torque(physics_component& comp, const math::vec3& toruqe, force_mode mode);
39
40 static auto ray_cast(const math::vec3& origin,
41 const math::vec3& direction,
42 float max_distance,
43 int layer_mask,
44 bool query_sensors) -> hpp::optional<raycast_hit>;
45
46 static auto ray_cast_all(const math::vec3& origin,
47 const math::vec3& direction,
48 float max_distance,
49 int layer_mask,
51
52 static auto sphere_cast(const math::vec3& origin,
53 const math::vec3& direction,
54 float radius,
55 float max_distance,
56 int layer_mask,
57 bool query_sensors) -> hpp::optional<raycast_hit>;
58
59 static auto sphere_cast_all(const math::vec3& origin,
60 const math::vec3& direction,
61 float radius,
62 float max_distance,
63 int layer_mask,
65
66 static auto sphere_overlap(const math::vec3& origin, float radius, int layer_mask, bool query_sensors)
68
69 static void on_create_component(entt::registry& r, entt::entity e);
70 static void on_destroy_component(entt::registry& r, entt::entity e);
71 static void on_destroy_bullet_rigidbody_component(entt::registry& r, entt::entity e);
72
73 static void on_create_active_component(entt::registry& r, entt::entity e);
74 static void on_destroy_active_component(entt::registry& r, entt::entity e);
75
76 static void draw_system_gizmos(rtti::context& ctx, const camera& cam, gfx::dd_raii& dd);
77 static void draw_gizmo(rtti::context& ctx, physics_component& comp, const camera& cam, gfx::dd_raii& dd);
78};
79} // namespace unravel
bool query_sensors
Class representing a camera. Contains functionality for manipulating and updating a camera....
Definition camera.h:35
Component that handles physics properties and behaviors.
std::chrono::duration< float > delta_t
hpp::small_vector< T, SmallSizeCapacity > physics_vector
void on_skip_next_frame(rtti::context &ctx)
static auto sphere_cast_all(const math::vec3 &origin, const math::vec3 &direction, float radius, float max_distance, int layer_mask, bool query_sensors) -> physics_vector< raycast_hit >
static void on_create_component(entt::registry &r, entt::entity e)
static void on_create_active_component(entt::registry &r, entt::entity e)
static void draw_gizmo(rtti::context &ctx, physics_component &comp, const camera &cam, gfx::dd_raii &dd)
static auto ray_cast(const math::vec3 &origin, const math::vec3 &direction, float max_distance, int layer_mask, bool query_sensors) -> hpp::optional< raycast_hit >
void on_play_begin(rtti::context &ctx)
static void apply_force(physics_component &comp, const math::vec3 &force, force_mode mode)
static void on_destroy_active_component(entt::registry &r, entt::entity e)
void on_resume(rtti::context &ctx)
void on_pause(rtti::context &ctx)
static void draw_system_gizmos(rtti::context &ctx, const camera &cam, gfx::dd_raii &dd)
static auto sphere_overlap(const math::vec3 &origin, float radius, int layer_mask, bool query_sensors) -> physics_vector< entt::entity >
static auto sphere_cast(const math::vec3 &origin, const math::vec3 &direction, float radius, float max_distance, int layer_mask, bool query_sensors) -> hpp::optional< raycast_hit >
static void apply_torque(physics_component &comp, const math::vec3 &toruqe, force_mode mode)
static void apply_explosion_force(physics_component &comp, float explosion_force, const math::vec3 &explosion_position, float explosion_radius, float upwards_modifier, force_mode mode)
static void on_destroy_component(entt::registry &r, entt::entity e)
static void clear_kinematic_velocities(physics_component &comp)
static void on_destroy_bullet_rigidbody_component(entt::registry &r, entt::entity e)
void on_frame_update(rtti::context &ctx, delta_t dt)
static auto ray_cast_all(const math::vec3 &origin, const math::vec3 &direction, float max_distance, int layer_mask, bool query_sensors) -> physics_vector< raycast_hit >
void on_play_end(rtti::context &ctx)