projectObject method

void projectObject(
  1. Object3D object
)

Implementation

void projectObject(Object3D object) {
  if (!object.visible) return;
  if (object is Light) {
    _renderData.lights.add(object);
  } else if (object is Mesh || object is Line || object is Points) {
    if (!object.material.visible) return;
    if (object.frustumCulled && !_frustum.intersectsObject(object)) return;
    addObject(object);
  } else if (object is Sprite) {
    if (!object.material.visible) return;
    if (object.frustumCulled && !_frustum.intersectsSprite(object)) return;
    addObject(object);
  }

  List<Object3D> children = object.children;
  if (children.isNotEmpty) {
    for (int i = 0; i < children.length; i++) {
      projectObject(children[i]);
    }
  }
}