mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add entity trigger type parameter
This commit is contained in:
parent
5b154b57b3
commit
8add39e506
5 changed files with 15 additions and 8 deletions
|
|
@ -52,7 +52,7 @@ entityid_t Entities::spawn(
|
|||
registry.emplace<Transform>(entity, pos, size, glm::mat3(1.0f));
|
||||
auto& body = registry.emplace<Rigidbody>(
|
||||
entity, true, Hitbox {pos, def.hitbox}, std::vector<Trigger>{});
|
||||
for (auto& box : def.triggers) {
|
||||
for (auto& box : def.boxTriggers) {
|
||||
body.triggers.emplace_back(Trigger{
|
||||
true,
|
||||
id,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ struct EntityDef {
|
|||
|
||||
std::string scriptName = name.substr(name.find(':')+1);
|
||||
glm::vec3 hitbox {0.5f};
|
||||
std::vector<AABB> triggers {};
|
||||
std::vector<AABB> boxTriggers {};
|
||||
std::string rigName = name.substr(name.find(":")+1);
|
||||
|
||||
struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue