Skip to content

Commit

Permalink
remove Object3D.getAbsPos3d
Browse files Browse the repository at this point in the history
  • Loading branch information
SpiraTom committed Jan 26, 2024
1 parent b9db9a8 commit 1067332
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
35 changes: 0 additions & 35 deletions hrt/prefab/Object3D.hx
Original file line number Diff line number Diff line change
Expand Up @@ -142,41 +142,6 @@ class Object3D extends Prefab {
return getTransform();
}

/**
Returns the absolute position of this prefab using heaps object when instanciated
**/
public function getAbsPos3d() {
if( local3d != null )
return local3d.getAbsPos();
var p = parent;
var m = getTransform();
while( p != null ) {
var obj = p.to(Object3D);
if( obj == null ) {
if( p.parent == null ) {
p = p.shared.parentPrefab;
continue;
}
p = p.parent;
continue;
}

var abs : h3d.Matrix;
if( obj.local3d != null ) {
abs = obj.local3d.getAbsPos();
} else {
abs = obj.getAbsPos(true);
}
m.multiply3x4(m, abs);
return m;
}
if( shared.root3d != null ) {
m.multiply3x4(m, shared.root3d.getAbsPos());
return m;
}
return m;
}

/**
Returns the list of all h3d.scene.Object with the given class contained
by this prefab and all of it's children
Expand Down
2 changes: 1 addition & 1 deletion hrt/prefab/Prefab.hx
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class Prefab {
The result is stored in the given array `arr` if it's defined, otherwise an array is created. The final array
is then returned.
**/
public function findAll<T:Prefab>(?cl: Class<T>, ?filter : Prefab -> Bool, followRefs : Bool = false, ?arr : Array<T> ) : Array<T> {
public function findAll<T:Prefab>(?cl: Class<T>, ?filter : Prefab -> Bool, followRefs : Bool = false, ?arr : Array<T> ) : Array<T> {
if( arr == null ) arr = [];
var asCl = cl != null ? Std.downcast(this, cl) : cast this;
if (asCl != null) {
Expand Down

0 comments on commit 1067332

Please sign in to comment.