mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fixed morph being really slow
This commit is contained in:
parent
591bd0a2d5
commit
cfd1a6a139
4 changed files with 8 additions and 7 deletions
|
|
@ -243,7 +243,7 @@ class PathedInterior extends InteriorObject {
|
|||
}
|
||||
|
||||
function updatePosition() {
|
||||
var tform = this.collider.transform;
|
||||
var tform = this.collider.transform.clone();
|
||||
tform.setPosition(this.currentPosition);
|
||||
this.setTransform(tform);
|
||||
this.collider.setTransform(tform);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class CollisionEntity implements IOctreeObject {
|
|||
public function setTransform(transform:Matrix) {
|
||||
if (this.transform == transform)
|
||||
return;
|
||||
this.transform = transform;
|
||||
this.transform.load(transform);
|
||||
this.invTransform = transform.getInverse();
|
||||
generateBoundingBox();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package collision;
|
||||
|
||||
import src.MarbleGame;
|
||||
import src.TimeState;
|
||||
import h3d.col.Bounds;
|
||||
import h3d.col.Sphere;
|
||||
|
|
@ -45,8 +46,8 @@ class CollisionWorld {
|
|||
|
||||
for (obj in dynamicEntities) {
|
||||
if (obj != spherecollision) {
|
||||
// if (obj.boundingBox.collide(box) && obj.go.isCollideable)
|
||||
contacts = contacts.concat(obj.sphereIntersection(spherecollision, timeState));
|
||||
if (obj.boundingBox.collide(box) && obj.go.isCollideable)
|
||||
contacts = contacts.concat(obj.sphereIntersection(spherecollision, timeState));
|
||||
}
|
||||
}
|
||||
return {foundEntities: foundEntities, contacts: contacts};
|
||||
|
|
@ -82,8 +83,8 @@ class CollisionWorld {
|
|||
public function boundingSearch(bounds:Bounds) {
|
||||
var contacts = this.octree.boundingSearch(bounds).map(x -> cast(x, CollisionEntity));
|
||||
for (obj in dynamicEntities) {
|
||||
// if (obj.boundingBox.collide(bounds))
|
||||
contacts.push(obj);
|
||||
if (obj.boundingBox.collide(bounds))
|
||||
contacts.push(obj);
|
||||
}
|
||||
return contacts;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class ConvexHull implements GJKShape {
|
|||
|
||||
public function setTransform(matrix:Matrix):Void {
|
||||
if (this.transform != matrix) {
|
||||
this.transform = matrix;
|
||||
this.transform.load(matrix);
|
||||
this._centercache = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue