renderObject method

void renderObject(
  1. Object3D object,
  2. dynamic scene,
  3. Camera camera,
  4. BufferGeometry geometry,
  5. Material material,
  6. Map<String, dynamic>? group,
)

Implementation

void renderObject(Object3D object, scene, Camera camera, BufferGeometry geometry, Material material, Map<String, dynamic>? group) {
  object.onBeforeRender?.call(
    renderer: this,
    mesh: object,
    scene: scene,
    camera: camera,
    geometry: geometry,
    material: material,
    group: group
  );

  object.modelViewMatrix.multiply2(camera.matrixWorldInverse, object.matrixWorld);
  object.normalMatrix.getNormalMatrix(object.modelViewMatrix);

  material.onBeforeRender?.call(this, scene, camera, geometry, object, group);

  if (material.transparent == true && material.side == DoubleSide) {
    material.side = BackSide;
    material.needsUpdate = true;
    renderBufferDirect(camera, scene, geometry, material, object, group);

    material.side = FrontSide;
    material.needsUpdate = true;
    renderBufferDirect(camera, scene, geometry, material, object, group);

    material.side = DoubleSide;
  }
  else {
    renderBufferDirect(camera, scene, geometry, material, object, group);
  }

  object.onAfterRender?.call(renderer: this, scene: scene, camera: camera, geometry: geometry, material: material, group: group);
}