mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-28 14:26:05 +10:00
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:
@@ -103,6 +103,8 @@ var Sphere = function ( radius, segments_width, segments_height ) {
|
||||
}
|
||||
}
|
||||
|
||||
this.boundingSphere = { radius: radius };
|
||||
|
||||
this.computeCentroids();
|
||||
this.computeFaceNormals();
|
||||
this.computeVertexNormals();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user