Fixed triggers mesh collision to account for all faces

This commit is contained in:
Antoine Pilote
2021-07-02 03:30:12 -04:00
parent e5306bfed4
commit 68d276c4b6
10 changed files with 80 additions and 54 deletions

View File

@@ -18,7 +18,7 @@ class TriggerScript is ScriptableEntity {
fixedUpdate(ts) {
var trigger = this.GetComponent("Trigger")
Engine.Log("Hello")
if(trigger.GetOverlappingBodyCount() > 0) {
var bodies = trigger.GetOverlappingBodies()
var brush = this.GetComponent("Brush")
@@ -32,7 +32,7 @@ class TriggerScript is ScriptableEntity {
for(t in brush.GetTargets()) {
var transform = t.GetComponent("Transform")
var pos = transform.GetTranslation()
Engine.Log("Hello")
pos.x = pos.x + 1.0 * ts
transform.SetTranslation(pos)