submitDraw method

void submitDraw(
  1. Object3D object,
  2. Matrix4 worldTransform
)

Submit a deferred draw.

Implementation

void submitDraw(Object3D object, Matrix4 worldTransform) {
  // Distance for each object in world space. We dont use
  // Vector3 here as that would be unnecessarily allocating
  // values.
  final dx = _cameraPosition.x - worldTransform.m41;
  final dy = _cameraPosition.y - worldTransform.m42;
  final dz = _cameraPosition.z - worldTransform.m43;

  if (_drawCount >= _drawPool.length) {
    _drawPool.add(_DrawEntry());
  }
  _drawPool[_drawCount]
    ..distance = dx * dx + dy * dy + dz * dz
    ..object = object;
  _drawCount++;
}