38 [&translation](
auto& transform)
40 transform.local.translation += translation;
54 [
angle, &axis](
auto& transform)
72 transform.local.translation =
position;
88 transform.local.translation =
position;
102 [&
scale](
auto& transform)
104 transform.local.scale =
scale;
118 [&other_transform = transform](
auto& transform)
120 transform.local = other_transform;
139 [layer_mask](
auto& component)
141 component.layer_mask = layer_mask;
152 return transform->
local;
163 return transform->
world;
Commands which operate on entity::id components.
void translate(entity::registry ®istry, entity::id eid, const math::fvec3 &translation)
math::transform< float > get_world_transform(entity::registry ®istry, entity::id eid)
void set_transform(entity::registry ®istry, entity::id eid, const math::transform< float > &transform)
void warp_to(entity::registry ®istry, entity::id eid, const math::fvec3 &position)
void place(entity::registry ®istry, entity::id eid, entity::id celestial_body_id, double altitude, double latitude, double longitude)
void move_to(entity::registry ®istry, entity::id eid, const math::fvec3 &position)
void assign_render_layers(entity::registry ®istry, entity::id eid, std::uint8_t layer_mask)
void set_scale(entity::registry ®istry, entity::id eid, const math::fvec3 &scale)
math::transform< float > get_local_transform(entity::registry ®istry, entity::id eid)
void rotate(entity::registry ®istry, entity::id eid, float angle, const math::fvec3 &axis)
entt::registry registry
Component registry type.
entt::entity id
Entity ID type.
T angle(const vector< T, N > &from, const vector< T, N > &to)
Calculates the angle between two direction vectors.
quaternion< T > normalize(const quaternion< T > &q)
Normalizes a quaternion.
quaternion< T > angle_axis(T angle, const vec3< T > &axis)
Creates a rotation from an angle and axis.
constexpr mat4< T > scale(const vec3< T > &v)
Constructs a scale matrix.
@ position
Vertex position (vec3)