Camera constructor
const
Camera({})
Creates a camera with explicit intrinsics and extrinsics.
width/heightare in pixels and must be > 0.fx/fyare focal lengths in pixels and must be > 0.rotationis camera → world (columns are right, up, forward).znear/zfardefine clip planes (OpenGL-style),znear > 0,zfar > znear.
Implementation
const Camera({
required this.id,
required this.width,
required this.height,
required this.position,
required this.rotation,
required this.fx,
required this.fy,
this.znear = 0.2,
this.zfar = 200.0,
this.ndcYSign = -1.0, // default for Flutter texture targets
}) : assert(width > 0, 'Camera width must be greater than 0, got: $width'),
assert(
height > 0,
'Camera height must be greater than 0, got: $height',
),
assert(fx > 0, 'Focal length fx must be greater than 0, got: $fx'),
assert(fy > 0, 'Focal length fy must be greater than 0, got: $fy'),
assert(
znear > 0,
'Near clip plane must be greater than 0, got: $znear',
),
assert(
zfar > znear,
'Far clip plane ($zfar) must be '
'greater than near clip plane ($znear)',
);