Skip to content

Commit

Permalink
Merge pull request #16 from pmacom/release/0.0.23
Browse files Browse the repository at this point in the history
Updated TriggerZone to allow for setting TriggerZone parent
  • Loading branch information
pmacom authored Apr 30, 2022
2 parents 23052d1 + 9eacb5b commit fd4d750
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dcldash",
"version": "0.0.22",
"version": "0.0.23",
"description": "DCLconnect utility library",
"main": "./dist/index.js",
"scripts": {
Expand Down
21 changes: 19 additions & 2 deletions src/utils/TriggerZone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,27 @@ export class Dash_TriggerZone extends Entity {
}

private check(){
let p = this.getParent()
let t = new Vector3()
let s = new Vector3()
let r = new Quaternion()

do {
if(p){
let localTransform = p.getComponentOrCreate(Transform)
t.addInPlace(localTransform.position.clone())
s.addInPlace(localTransform.scale.clone())
r.eulerAngles.addInPlace(localTransform.eulerAngles)
p = p.getParent()
}
} while (p && p.uuid !== '0')

const transform = this.getComponentOrCreate(Transform)

this.getParent()
const withinVolume = Dash_CheckWithinVolume(
transform.position,
transform.scale,
Vector3.Add(t, transform.position),
Vector3.Add(s, transform.scale),
new Vector3(
Camera.instance.feetPosition.x,
Camera.instance.feetPosition.y,
Expand Down

0 comments on commit fd4d750

Please sign in to comment.