mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-26 12:41:40 +00:00
use fast transforms for colliders
This commit is contained in:
parent
b5a1d5af6b
commit
5b8b802dfd
2 changed files with 3 additions and 1 deletions
|
|
@ -107,6 +107,7 @@ class PathedInterior extends InteriorObject {
|
||||||
|
|
||||||
this.setRotationQuat(this.baseOrientation.clone());
|
this.setRotationQuat(this.baseOrientation.clone());
|
||||||
this.collider.setTransform(this.getTransform());
|
this.collider.setTransform(this.getTransform());
|
||||||
|
this.collider.fastTransform = true;
|
||||||
|
|
||||||
this.path = cast this.simGroup.elements.filter((element) -> element._type == MissionElementType.Path)[0];
|
this.path = cast this.simGroup.elements.filter((element) -> element._type == MissionElementType.Path)[0];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ class CollisionEntity implements IOctreeObject implements IBVHObject {
|
||||||
public var go:GameObject;
|
public var go:GameObject;
|
||||||
|
|
||||||
public var userData:Int;
|
public var userData:Int;
|
||||||
|
public var fastTransform:Bool = false;
|
||||||
|
|
||||||
public var difEdgeMap:Map<Int, dif.Edge>;
|
public var difEdgeMap:Map<Int, dif.Edge>;
|
||||||
|
|
||||||
|
|
@ -72,7 +73,7 @@ class CollisionEntity implements IOctreeObject implements IBVHObject {
|
||||||
if (this.transform.equal(transform))
|
if (this.transform.equal(transform))
|
||||||
return;
|
return;
|
||||||
// Speedup
|
// Speedup
|
||||||
if (Util.mat3x3equal(this.transform, transform)) {
|
if (this.fastTransform && Util.mat3x3equal(this.transform, transform)) {
|
||||||
var oldPos = this.transform.getPosition();
|
var oldPos = this.transform.getPosition();
|
||||||
var newPos = transform.getPosition();
|
var newPos = transform.getPosition();
|
||||||
this.transform.setPosition(newPos);
|
this.transform.setPosition(newPos);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue