Projector::projectScene now does a first pass through Projector::projectObject (which does frustum culling and object sorting).

So now CanvasRenderer and SVGRenderer feature frustum culling too.
This commit is contained in:
Mr.doob
2010-12-21 14:07:23 +00:00
parent 2c1e6a1368
commit c39eca33ee
7 changed files with 610 additions and 607 deletions
+2
View File
@@ -103,6 +103,8 @@ var Sphere = function ( radius, segments_width, segments_height ) {
}
}
this.boundingSphere = { radius: radius };
this.computeCentroids();
this.computeFaceNormals();
this.computeVertexNormals();
+3 -3
View File
@@ -38,7 +38,7 @@ THREE.Projector = function() {
object = objects[ o ];
if ( !object.visible || !isInFrustum( object ) ) continue;
if ( !object.visible || ( object instanceof THREE.Mesh && !isInFrustum( object ) ) ) continue;
_object = _objectPool[ _objectCount ] = _objectPool[ _objectCount ] || new THREE.RenderableObject();
@@ -76,11 +76,11 @@ THREE.Projector = function() {
_projScreenMatrix.multiply( camera.projectionMatrix, camera.matrix );
objects = scene.objects;
objects = this.projectObjects( scene, camera, true ); // scene.objects;
for ( o = 0, ol = objects.length; o < ol; o++ ) {
object = objects[ o ];
object = objects[ o ].object;
if ( !object.visible ) continue;