Constructor
new(x:Float = 0, y:Float = 0, z:Float = 0, _bgColor:FlxColor = 0x0, ortho:Bool = false, withLightData:Bool = true)
Variables
passes:Array<FoxRenderPass> = [new FoxRenderPass([0], "default")]
Any custom pass you want for this camera, add them here.
By default, there's one pass that will render everything in group 0 on the "default" render target.
Warning! If you create two cameras, make sure to change the output or else it'll overwrite the previous camera render!
projectionOrigin:FlxPoint = FlxPoint.get(0, 0)
Origin of the screen to where a perspective or isometric view would rotate
__prevViewMatrix:Matrix3D = new Matrix3D()
This is the view matrix from a previous frame, used for motion vector calculations
doFrustumCulling:Bool = true
If enabled, this camera will calculate its frustum planes and determine if models are inside it, culling what's outside the view and improving performance.
This is much needed for big worlds and/or small details that are not needed when off-screen
lightData:FoxLightData
The light data associated with this camera.
This handles all dynamic lighting that's visible by this camera, including ambient light.
Normally, this is handled by the camera itself and the lights on the scene, so you don't need to touch this unless you know what you're doing!
Methods
getScreenPoint(point:Vector3D):Vector3D
Projects a world-space 3D point to Normalized Device Coordinate (NDC, aka Screen-Space Position).
Note: the center is at (0,0) instead of (0.5, 0.5). If you need flixel coordinates, use toFlixelScreenPoint()
Note 2: The values are unclamped! Make sure to clamp them if needed.
toFlixelScreenPoint(point:Vector3D, screenWidth:Float, screenHeight:Float, ?output:FlxPoint):FlxPoint
inlinegetFlixelScreenPoint(position:Vector3D, screenWidth:Float, screenHeight:Float):FlxPoint
Shortcut method, calls getScreenPoint() and then toFlixelScreenPoint()
Also returns a FlxPoint instead
getWorldSpace(point:Vector3D):Vector3D
Re-projects a screen-space point to world space, useful for point and click in 3D with raycast.