mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-12-31 04:12:17 +00:00
speed up a little and fix camera bug
This commit is contained in:
parent
947aee6937
commit
9d040c371c
3 changed files with 14 additions and 3 deletions
|
|
@ -893,11 +893,11 @@ class DtsObject extends GameObject {
|
|||
if (mountPoint < 32) {
|
||||
var ni = mountPointNodes[mountPoint];
|
||||
if (ni != -1) {
|
||||
var mtransform = this.graphNodes[ni].getAbsPos().clone();
|
||||
var mtransform = this.graphNodes[ni].getAbsPos();
|
||||
return mtransform;
|
||||
}
|
||||
}
|
||||
return this.getTransform().clone();
|
||||
return this.getTransform();
|
||||
}
|
||||
|
||||
public function setOpacity(opacity:Float) {
|
||||
|
|
|
|||
|
|
@ -288,6 +288,8 @@ class MarbleWorld extends Scheduler {
|
|||
this.marble.camera.init(cast this);
|
||||
this.marble.camera.CameraYaw = euler.z + Math.PI / 2;
|
||||
this.marble.camera.CameraPitch = 0.45;
|
||||
this.marble.camera.nextCameraPitch = 0.45;
|
||||
this.marble.camera.nextCameraYaw = euler.z + Math.PI / 2;
|
||||
this.marble.camera.oob = false;
|
||||
this.marble.camera.finish = false;
|
||||
this.marble.mode = Start;
|
||||
|
|
@ -693,6 +695,7 @@ class MarbleWorld extends Scheduler {
|
|||
this.forceObjects.push(cast obj);
|
||||
}
|
||||
obj.init(cast this);
|
||||
obj.update(this.timeState);
|
||||
if (obj.useInstancing) {
|
||||
this.instanceManager.addObject(obj);
|
||||
} else
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ class Octree {
|
|||
/** A map of each object in the octree to the node that it's in. This accelerates removal drastically, as the lookup step can be skipped. */
|
||||
public var objectToNode:Map<IOctreeObject, OctreeNode>;
|
||||
|
||||
public var tempBox = new Bounds();
|
||||
var prevBoundSearch:Bounds;
|
||||
var boundSearchCache:Array<IOctreeElement>;
|
||||
|
||||
public function new() {
|
||||
this.root = new OctreeNode(this, 0);
|
||||
|
|
@ -140,7 +141,14 @@ class Octree {
|
|||
|
||||
public function boundingSearch(bounds:Bounds) {
|
||||
var intersections = [];
|
||||
if (this.prevBoundSearch != null) {
|
||||
if (this.prevBoundSearch.containsBounds(bounds)) {
|
||||
return boundSearchCache;
|
||||
}
|
||||
}
|
||||
this.root.boundingSearch(bounds, intersections);
|
||||
prevBoundSearch = bounds;
|
||||
boundSearchCache = intersections;
|
||||
return intersections;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue