#include <hxcpp.h>

#ifndef INCLUDED_Luxe
#include <Luxe.h>
#endif
#ifndef INCLUDED_luxe_ID
#include <luxe/ID.h>
#endif
#ifndef INCLUDED_luxe_Screen
#include <luxe/Screen.h>
#endif
#ifndef INCLUDED_phoenix_Camera
#include <phoenix/Camera.h>
#endif
#ifndef INCLUDED_phoenix_Matrix
#include <phoenix/Matrix.h>
#endif
#ifndef INCLUDED_phoenix_ProjectionType
#include <phoenix/ProjectionType.h>
#endif
#ifndef INCLUDED_phoenix_Quaternion
#include <phoenix/Quaternion.h>
#endif
#ifndef INCLUDED_phoenix_Ray
#include <phoenix/Ray.h>
#endif
#ifndef INCLUDED_phoenix_Rectangle
#include <phoenix/Rectangle.h>
#endif
#ifndef INCLUDED_phoenix_RenderState
#include <phoenix/RenderState.h>
#endif
#ifndef INCLUDED_phoenix_Renderer
#include <phoenix/Renderer.h>
#endif
#ifndef INCLUDED_phoenix_Spatial
#include <phoenix/Spatial.h>
#endif
#ifndef INCLUDED_phoenix_Transform
#include <phoenix/Transform.h>
#endif
#ifndef INCLUDED_phoenix_Vector
#include <phoenix/Vector.h>
#endif
#ifndef INCLUDED_snow_platform_native_utils_ArrayBufferView
#include <snow/platform/native/utils/ArrayBufferView.h>
#endif
#ifndef INCLUDED_snow_platform_native_utils_Float32Array
#include <snow/platform/native/utils/Float32Array.h>
#endif
#ifndef INCLUDED_snow_utils_IMemoryRange
#include <snow/utils/IMemoryRange.h>
#endif
namespace phoenix{

Void Camera_obj::__construct(Dynamic _options)
{
HX_STACK_FRAME("phoenix.Camera","new",0x30bf44b6,"phoenix.Camera.new","phoenix/Camera.hx",24,0x1fcabb59)

HX_STACK_ARG(_options,"_options")
{
	HX_STACK_LINE(470)
	this->_refresh_pos = false;
	HX_STACK_LINE(68)
	this->_setup = true;
	HX_STACK_LINE(66)
	this->look_at_dirty = true;
	HX_STACK_LINE(64)
	this->projection_dirty = true;
	HX_STACK_LINE(62)
	this->transform_dirty = true;
	HX_STACK_LINE(47)
	this->minimum_zoom = 0.01;
	HX_STACK_LINE(36)
	this->aspect = 1.5;
	HX_STACK_LINE(35)
	this->fov = (int)60;
	HX_STACK_LINE(33)
	this->far = (int)-1000;
	HX_STACK_LINE(32)
	this->near = (int)1000;
	HX_STACK_LINE(30)
	this->zoom = 1.0;
	HX_STACK_LINE(26)
	this->name = HX_CSTRING("camera");
	HX_STACK_LINE(73)
	this->transform = ::phoenix::Transform_obj::__new();
	HX_STACK_LINE(76)
	this->options = _options;
	HX_STACK_LINE(79)
	if (((this->options == null()))){
		HX_STACK_LINE(80)
		this->options = this->default_camera_options();
	}
	HX_STACK_LINE(84)
	if (((this->options->__Field(HX_CSTRING("camera_name"),true) != null()))){
		HX_STACK_LINE(85)
		this->name = this->options->__Field(HX_CSTRING("camera_name"),true);
	}
	HX_STACK_LINE(89)
	if (((this->options->__Field(HX_CSTRING("projection"),true) != null()))){
		HX_STACK_LINE(90)
		this->projection = this->options->__Field(HX_CSTRING("projection"),true);
	}
	else{
		HX_STACK_LINE(92)
		this->projection = ::phoenix::ProjectionType_obj::ortho;
	}
	HX_STACK_LINE(95)
	::luxe::Screen _g = ::Luxe_obj::get_screen();		HX_STACK_VAR(_g,"_g");
	HX_STACK_LINE(95)
	this->set_center(::phoenix::Vector_obj::__new((Float(_g->w) / Float((int)2)),(Float(::Luxe_obj::get_screen()->h) / Float((int)2)),null(),null()));
	HX_STACK_LINE(96)
	this->set_pos(::phoenix::Vector_obj::__new(null(),null(),null(),null()));
	HX_STACK_LINE(99)
	if (((this->options->__Field(HX_CSTRING("viewport"),true) != null()))){
		HX_STACK_LINE(100)
		this->set_viewport(this->options->__Field(HX_CSTRING("viewport"),true));
	}
	else{
		HX_STACK_LINE(102)
		::luxe::Screen _g1 = ::Luxe_obj::get_screen();		HX_STACK_VAR(_g1,"_g1");
		HX_STACK_LINE(102)
		this->set_viewport(::phoenix::Rectangle_obj::__new((int)0,(int)0,_g1->w,::Luxe_obj::get_screen()->h));
	}
	HX_STACK_LINE(105)
	this->up = ::phoenix::Vector_obj::__new((int)0,(int)1,(int)0,null());
	HX_STACK_LINE(107)
	this->projection_matrix = ::phoenix::Matrix_obj::__new(null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null());
	HX_STACK_LINE(108)
	this->view_matrix = ::phoenix::Matrix_obj::__new(null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null());
	HX_STACK_LINE(109)
	this->view_matrix_inverse = ::phoenix::Matrix_obj::__new(null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null());
	HX_STACK_LINE(110)
	this->look_at_matrix = ::phoenix::Matrix_obj::__new(null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null());
	HX_STACK_LINE(112)
	this->transform->listen(this->on_transform_cleaned_dyn());
	HX_STACK_LINE(114)
	this->apply_default_camera_options();
	HX_STACK_LINE(116)
	{
		HX_STACK_LINE(116)
		::phoenix::ProjectionType _g1 = this->projection;		HX_STACK_VAR(_g1,"_g1");
		HX_STACK_LINE(116)
		switch( (int)(_g1->__Index())){
			case (int)0: {
				HX_STACK_LINE(119)
				this->set_ortho(this->options);
			}
			;break;
			case (int)1: {
				HX_STACK_LINE(121)
				this->set_perspective(this->options);
			}
			;break;
			case (int)2: {
			}
			;break;
		}
	}
	HX_STACK_LINE(128)
	this->_setup = false;
}
;
	return null();
}

//Camera_obj::~Camera_obj() { }

Dynamic Camera_obj::__CreateEmpty() { return  new Camera_obj; }
hx::ObjectPtr< Camera_obj > Camera_obj::__new(Dynamic _options)
{  hx::ObjectPtr< Camera_obj > result = new Camera_obj();
	result->__construct(_options);
	return result;}

Dynamic Camera_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< Camera_obj > result = new Camera_obj();
	result->__construct(inArgs[0]);
	return result;}

Void Camera_obj::set_ortho( Dynamic _options){
{
		HX_STACK_FRAME("phoenix.Camera","set_ortho",0xe0d7b871,"phoenix.Camera.set_ortho","phoenix/Camera.hx",136,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_options,"_options")
		HX_STACK_LINE(139)
		this->projection = ::phoenix::ProjectionType_obj::ortho;
		HX_STACK_LINE(141)
		this->_merge_options(_options);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_ortho,(void))

Void Camera_obj::set_perspective( Dynamic _options){
{
		HX_STACK_FRAME("phoenix.Camera","set_perspective",0xca12b775,"phoenix.Camera.set_perspective","phoenix/Camera.hx",145,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_options,"_options")
		HX_STACK_LINE(148)
		this->projection = ::phoenix::ProjectionType_obj::perspective;
		HX_STACK_LINE(150)
		this->_merge_options(_options);
		HX_STACK_LINE(152)
		this->transform->get_origin()->set_xyz((int)0,(int)0,(int)0);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_perspective,(void))

::phoenix::Vector Camera_obj::project( ::phoenix::Vector _vector){
	HX_STACK_FRAME("phoenix.Camera","project",0x37966a2f,"phoenix.Camera.project","phoenix/Camera.hx",157,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vector,"_vector")
	HX_STACK_LINE(159)
	this->update_view_matrix();
	HX_STACK_LINE(161)
	::phoenix::Matrix _transform = ::phoenix::Matrix_obj::__new(null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null())->multiplyMatrices(this->projection_matrix,this->view_matrix_inverse);		HX_STACK_VAR(_transform,"_transform");
	HX_STACK_LINE(162)
	return _vector->clone()->applyProjection(_transform);
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,project,return )

::phoenix::Vector Camera_obj::unproject( ::phoenix::Vector _vector){
	HX_STACK_FRAME("phoenix.Camera","unproject",0x769d7276,"phoenix.Camera.unproject","phoenix/Camera.hx",167,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vector,"_vector")
	HX_STACK_LINE(169)
	this->update_view_matrix();
	HX_STACK_LINE(171)
	::phoenix::Matrix _inverted = ::phoenix::Matrix_obj::__new(null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null())->multiplyMatrices(this->projection_matrix,this->view_matrix_inverse);		HX_STACK_VAR(_inverted,"_inverted");
	HX_STACK_LINE(172)
	return _vector->clone()->applyProjection(_inverted->getInverse(_inverted));
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,unproject,return )

::phoenix::Ray Camera_obj::screen_point_to_ray( ::phoenix::Vector _vector){
	HX_STACK_FRAME("phoenix.Camera","screen_point_to_ray",0x118f857e,"phoenix.Camera.screen_point_to_ray","phoenix/Camera.hx",178,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vector,"_vector")
	HX_STACK_LINE(178)
	return ::phoenix::Ray_obj::__new(_vector,hx::ObjectPtr<OBJ_>(this),null());
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,screen_point_to_ray,return )

::phoenix::Vector Camera_obj::screen_point_to_world( ::phoenix::Vector _vector){
	HX_STACK_FRAME("phoenix.Camera","screen_point_to_world",0x22d752e6,"phoenix.Camera.screen_point_to_world","phoenix/Camera.hx",182,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vector,"_vector")
	HX_STACK_LINE(184)
	if (((this->projection == ::phoenix::ProjectionType_obj::ortho))){
		HX_STACK_LINE(185)
		return this->ortho_screen_to_world(_vector);
	}
	else{
		HX_STACK_LINE(186)
		if (((this->projection == ::phoenix::ProjectionType_obj::perspective))){
			HX_STACK_LINE(187)
			return this->screen_point_to_ray(_vector)->end;
		}
	}
	HX_STACK_LINE(191)
	return this->ortho_screen_to_world(_vector);
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,screen_point_to_world,return )

::phoenix::Vector Camera_obj::world_point_to_screen( ::phoenix::Vector _vector,::phoenix::Rectangle _viewport){
	HX_STACK_FRAME("phoenix.Camera","world_point_to_screen",0x231a6faa,"phoenix.Camera.world_point_to_screen","phoenix/Camera.hx",195,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vector,"_vector")
	HX_STACK_ARG(_viewport,"_viewport")
	HX_STACK_LINE(197)
	if (((this->projection == ::phoenix::ProjectionType_obj::ortho))){
		HX_STACK_LINE(198)
		return this->ortho_world_to_screen(_vector);
	}
	else{
		HX_STACK_LINE(199)
		if (((this->projection == ::phoenix::ProjectionType_obj::perspective))){
			HX_STACK_LINE(200)
			return this->persepective_world_to_screen(_vector,_viewport);
		}
	}
	HX_STACK_LINE(204)
	return this->ortho_world_to_screen(_vector);
}


HX_DEFINE_DYNAMIC_FUNC2(Camera_obj,world_point_to_screen,return )

Void Camera_obj::process( ){
{
		HX_STACK_FRAME("phoenix.Camera","process",0x32f5f9c5,"phoenix.Camera.process","phoenix/Camera.hx",212,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_LINE(217)
		if (((this->target != null()))){
			HX_STACK_LINE(218)
			this->update_look_at();
		}
		HX_STACK_LINE(222)
		this->update_projection_matrix();
		HX_STACK_LINE(223)
		this->update_view_matrix();
		HX_STACK_LINE(226)
		this->apply_state((int)2884,this->options->__Field(HX_CSTRING("cull_backfaces"),true));
		HX_STACK_LINE(227)
		this->apply_state((int)2929,this->options->__Field(HX_CSTRING("depth_test"),true));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,process,(void))

Void Camera_obj::on_transform_cleaned( ::phoenix::Transform t){
{
		HX_STACK_FRAME("phoenix.Camera","on_transform_cleaned",0x6436d59f,"phoenix.Camera.on_transform_cleaned","phoenix/Camera.hx",236,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_ARG(t,"t")
		HX_STACK_LINE(236)
		this->transform_dirty = true;
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,on_transform_cleaned,(void))

Void Camera_obj::update_look_at( ){
{
		HX_STACK_FRAME("phoenix.Camera","update_look_at",0x27c83a07,"phoenix.Camera.update_look_at","phoenix/Camera.hx",242,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_LINE(242)
		if (((bool(this->look_at_dirty) && bool((this->target != null()))))){
			HX_STACK_LINE(244)
			this->look_at_matrix->lookAt(this->target,this->get_pos(),this->up);
			HX_STACK_LINE(246)
			this->get_rotation()->setFromRotationMatrix(this->look_at_matrix);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,update_look_at,(void))

Void Camera_obj::update_view_matrix( ){
{
		HX_STACK_FRAME("phoenix.Camera","update_view_matrix",0x11cad60f,"phoenix.Camera.update_view_matrix","phoenix/Camera.hx",252,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_LINE(254)
		this->view_matrix = this->transform->get_world()->get_matrix();
		HX_STACK_LINE(256)
		if ((!(this->transform_dirty))){
			HX_STACK_LINE(257)
			return null();
		}
		HX_STACK_LINE(260)
		this->view_matrix_inverse = this->view_matrix->inverse();
		HX_STACK_LINE(261)
		this->view_inverse_float32array = this->view_matrix_inverse->float32array();
		HX_STACK_LINE(263)
		this->transform_dirty = false;
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,update_view_matrix,(void))

Void Camera_obj::update_projection_matrix( ){
{
		HX_STACK_FRAME("phoenix.Camera","update_projection_matrix",0x7401e825,"phoenix.Camera.update_projection_matrix","phoenix/Camera.hx",267,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_LINE(269)
		if ((!(this->projection_dirty))){
			HX_STACK_LINE(270)
			return null();
		}
		HX_STACK_LINE(273)
		{
			HX_STACK_LINE(273)
			::phoenix::ProjectionType _g = this->projection;		HX_STACK_VAR(_g,"_g");
			HX_STACK_LINE(273)
			switch( (int)(_g->__Index())){
				case (int)1: {
					HX_STACK_LINE(276)
					this->projection_matrix->makePerspective(this->fov,this->aspect,this->near,this->far);
				}
				;break;
				case (int)0: {
					HX_STACK_LINE(278)
					::phoenix::Rectangle _g1 = this->get_viewport();		HX_STACK_VAR(_g1,"_g1");
					HX_STACK_LINE(278)
					this->projection_matrix->makeOrthographic((int)0,_g1->w,(int)0,this->get_viewport()->h,this->near,this->far);
				}
				;break;
				case (int)2: {
				}
				;break;
			}
		}
		HX_STACK_LINE(283)
		this->projection_float32array = this->projection_matrix->float32array();
		HX_STACK_LINE(285)
		this->projection_dirty = false;
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,update_projection_matrix,(void))

Void Camera_obj::apply_state( int state,bool value){
{
		HX_STACK_FRAME("phoenix.Camera","apply_state",0xdb71c396,"phoenix.Camera.apply_state","phoenix/Camera.hx",295,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_ARG(state,"state")
		HX_STACK_ARG(value,"value")
		HX_STACK_LINE(295)
		if ((value)){
			HX_STACK_LINE(296)
			::Luxe_obj::renderer->state->enable(state);
		}
		else{
			HX_STACK_LINE(298)
			::Luxe_obj::renderer->state->disable(state);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Camera_obj,apply_state,(void))

Void Camera_obj::apply_default_camera_options( ){
{
		HX_STACK_FRAME("phoenix.Camera","apply_default_camera_options",0xf72e1e5d,"phoenix.Camera.apply_default_camera_options","phoenix/Camera.hx",305,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_LINE(305)
		::phoenix::ProjectionType _g = this->projection;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(305)
		switch( (int)(_g->__Index())){
			case (int)0: {
				HX_STACK_LINE(309)
				if (((this->options->__Field(HX_CSTRING("cull_backfaces"),true) == null()))){
					HX_STACK_LINE(310)
					this->options->__FieldRef(HX_CSTRING("cull_backfaces")) = false;
				}
				HX_STACK_LINE(313)
				if (((this->options->__Field(HX_CSTRING("depth_test"),true) == null()))){
					HX_STACK_LINE(314)
					this->options->__FieldRef(HX_CSTRING("depth_test")) = false;
				}
			}
			;break;
			case (int)1: {
				HX_STACK_LINE(321)
				if (((this->options->__Field(HX_CSTRING("cull_backfaces"),true) == null()))){
					HX_STACK_LINE(322)
					this->options->__FieldRef(HX_CSTRING("cull_backfaces")) = true;
				}
				HX_STACK_LINE(325)
				if (((this->options->__Field(HX_CSTRING("depth_test"),true) == null()))){
					HX_STACK_LINE(326)
					this->options->__FieldRef(HX_CSTRING("depth_test")) = true;
				}
			}
			;break;
			case (int)2: {
			}
			;break;
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,apply_default_camera_options,(void))

Dynamic Camera_obj::default_camera_options( ){
	HX_STACK_FRAME("phoenix.Camera","default_camera_options",0x036c4aec,"phoenix.Camera.default_camera_options","phoenix/Camera.hx",339,0x1fcabb59)
	HX_STACK_THIS(this)
	struct _Function_1_1{
		inline static Dynamic Block( ){
			HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/Camera.hx",339,0x1fcabb59)
			{
				hx::Anon __result = hx::Anon_obj::Create();
				__result->Add(HX_CSTRING("projection") , ::phoenix::ProjectionType_obj::ortho,false);
				__result->Add(HX_CSTRING("depth_test") , false,false);
				__result->Add(HX_CSTRING("cull_backfaces") , false,false);
				__result->Add(HX_CSTRING("near") , (int)1000,false);
				__result->Add(HX_CSTRING("far") , (int)-1000,false);
				return __result;
			}
			return null();
		}
	};
	HX_STACK_LINE(339)
	return _Function_1_1::Block();
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,default_camera_options,return )

::phoenix::Vector Camera_obj::ortho_screen_to_world( ::phoenix::Vector _vector){
	HX_STACK_FRAME("phoenix.Camera","ortho_screen_to_world",0x90978b50,"phoenix.Camera.ortho_screen_to_world","phoenix/Camera.hx",353,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vector,"_vector")
	HX_STACK_LINE(355)
	this->update_view_matrix();
	HX_STACK_LINE(357)
	return _vector->clone()->transform(this->view_matrix);
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,ortho_screen_to_world,return )

::phoenix::Vector Camera_obj::ortho_world_to_screen( ::phoenix::Vector _vector){
	HX_STACK_FRAME("phoenix.Camera","ortho_world_to_screen",0x1f31d512,"phoenix.Camera.ortho_world_to_screen","phoenix/Camera.hx",361,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vector,"_vector")
	HX_STACK_LINE(363)
	this->update_view_matrix();
	HX_STACK_LINE(365)
	return _vector->clone()->transform(this->view_matrix_inverse);
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,ortho_world_to_screen,return )

::phoenix::Vector Camera_obj::persepective_world_to_screen( ::phoenix::Vector _vector,::phoenix::Rectangle _viewport){
	HX_STACK_FRAME("phoenix.Camera","persepective_world_to_screen",0x526987d1,"phoenix.Camera.persepective_world_to_screen","phoenix/Camera.hx",369,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vector,"_vector")
	HX_STACK_ARG(_viewport,"_viewport")
	HX_STACK_LINE(371)
	if (((_viewport == null()))){
		HX_STACK_LINE(371)
		_viewport = this->get_viewport();
	}
	HX_STACK_LINE(373)
	::phoenix::Vector _projected = this->project(_vector);		HX_STACK_VAR(_projected,"_projected");
	HX_STACK_LINE(375)
	Float width_half = (Float(_viewport->w) / Float((int)2));		HX_STACK_VAR(width_half,"width_half");
	HX_STACK_LINE(376)
	Float height_half = (Float(_viewport->h) / Float((int)2));		HX_STACK_VAR(height_half,"height_half");
	HX_STACK_LINE(378)
	return ::phoenix::Vector_obj::__new(((_projected->x * width_half) + width_half),(-(((_projected->y * height_half))) + height_half),null(),null());
}


HX_DEFINE_DYNAMIC_FUNC2(Camera_obj,persepective_world_to_screen,return )

::phoenix::Vector Camera_obj::set_target( ::phoenix::Vector _target){
	HX_STACK_FRAME("phoenix.Camera","set_target",0x108f63f8,"phoenix.Camera.set_target","phoenix/Camera.hx",388,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_target,"_target")
	HX_STACK_LINE(390)
	if (((_target != null()))){
		HX_STACK_LINE(391)
		this->look_at_dirty = true;
	}
	HX_STACK_LINE(394)
	return this->target = _target;
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_target,return )

Float Camera_obj::set_fov( Float _fov){
	HX_STACK_FRAME("phoenix.Camera","set_fov",0x5b6f7806,"phoenix.Camera.set_fov","phoenix/Camera.hx",398,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_fov,"_fov")
	HX_STACK_LINE(400)
	this->projection_dirty = true;
	HX_STACK_LINE(401)
	this->options->__FieldRef(HX_CSTRING("fov")) = _fov;
	HX_STACK_LINE(403)
	return this->fov = _fov;
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_fov,return )

Float Camera_obj::set_aspect( Float _aspect){
	HX_STACK_FRAME("phoenix.Camera","set_aspect",0xd3aa067f,"phoenix.Camera.set_aspect","phoenix/Camera.hx",407,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_aspect,"_aspect")
	HX_STACK_LINE(409)
	this->projection_dirty = true;
	HX_STACK_LINE(410)
	this->options->__FieldRef(HX_CSTRING("aspect")) = _aspect;
	HX_STACK_LINE(412)
	return this->aspect = _aspect;
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_aspect,return )

Float Camera_obj::set_near( Float _near){
	HX_STACK_FRAME("phoenix.Camera","set_near",0xab5b99cf,"phoenix.Camera.set_near","phoenix/Camera.hx",416,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_near,"_near")
	HX_STACK_LINE(418)
	this->projection_dirty = true;
	HX_STACK_LINE(419)
	this->options->__FieldRef(HX_CSTRING("near")) = _near;
	HX_STACK_LINE(421)
	return this->near = _near;
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_near,return )

Float Camera_obj::set_far( Float _far){
	HX_STACK_FRAME("phoenix.Camera","set_far",0x5b6f6bd0,"phoenix.Camera.set_far","phoenix/Camera.hx",425,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_far,"_far")
	HX_STACK_LINE(427)
	this->projection_dirty = true;
	HX_STACK_LINE(428)
	this->options->__FieldRef(HX_CSTRING("far")) = _far;
	HX_STACK_LINE(430)
	return this->far = _far;
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_far,return )

Float Camera_obj::set_zoom( Float _z){
	HX_STACK_FRAME("phoenix.Camera","set_zoom",0xb351cbfa,"phoenix.Camera.set_zoom","phoenix/Camera.hx",436,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_z,"_z")
	HX_STACK_LINE(439)
	Float _new_zoom = _z;		HX_STACK_VAR(_new_zoom,"_new_zoom");
	HX_STACK_LINE(443)
	if (((_new_zoom < this->minimum_zoom))){
		HX_STACK_LINE(444)
		_new_zoom = this->minimum_zoom;
	}
	HX_STACK_LINE(447)
	{
		HX_STACK_LINE(447)
		::phoenix::ProjectionType _g = this->projection;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(447)
		switch( (int)(_g->__Index())){
			case (int)0: {
				HX_STACK_LINE(452)
				this->transform->get_scale()->set_x((Float((int)1) / Float(_new_zoom)));
				HX_STACK_LINE(453)
				this->transform->get_scale()->set_y((Float((int)1) / Float(_new_zoom)));
			}
			;break;
			case (int)1: {
			}
			;break;
			case (int)2: {
			}
			;break;
		}
	}
	HX_STACK_LINE(466)
	return this->zoom = _new_zoom;
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_zoom,return )

::phoenix::Vector Camera_obj::set_center( ::phoenix::Vector _p){
	HX_STACK_FRAME("phoenix.Camera","set_center",0x8f7d967c,"phoenix.Camera.set_center","phoenix/Camera.hx",471,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_p,"_p")
	HX_STACK_LINE(473)
	this->center = _p;
	HX_STACK_LINE(475)
	{
		HX_STACK_LINE(475)
		::phoenix::ProjectionType _g = this->projection;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(475)
		switch( (int)(_g->__Index())){
			case (int)0: {
				HX_STACK_LINE(479)
				if (((bool(!(this->_refresh_pos)) && bool(!(this->_setup))))){
					HX_STACK_LINE(482)
					this->get_pos()->ignore_listeners = true;
					HX_STACK_LINE(483)
					this->get_pos()->set_x((_p->x - (Float(this->get_viewport()->w) / Float((int)2))));
					HX_STACK_LINE(484)
					this->get_pos()->set_y((_p->y - (Float(this->get_viewport()->h) / Float((int)2))));
					HX_STACK_LINE(485)
					this->get_pos()->ignore_listeners = false;
				}
			}
			;break;
			case (int)1: {
			}
			;break;
			case (int)2: {
			}
			;break;
		}
	}
	HX_STACK_LINE(495)
	::phoenix::Vector_obj::listen(this->get_center(),this->_center_changed_dyn());
	HX_STACK_LINE(497)
	return this->get_center();
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_center,return )

::phoenix::Vector Camera_obj::get_center( ){
	HX_STACK_FRAME("phoenix.Camera","get_center",0x8bfff808,"phoenix.Camera.get_center","phoenix/Camera.hx",502,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_LINE(502)
	return this->center;
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,get_center,return )

::phoenix::Vector Camera_obj::get_pos( ){
	HX_STACK_FRAME("phoenix.Camera","get_pos",0x68757d81,"phoenix.Camera.get_pos","phoenix/Camera.hx",506,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_LINE(506)
	return this->pos;
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,get_pos,return )

::phoenix::Quaternion Camera_obj::get_rotation( ){
	HX_STACK_FRAME("phoenix.Camera","get_rotation",0xff2a4231,"phoenix.Camera.get_rotation","phoenix/Camera.hx",510,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_LINE(510)
	return this->transform->get_rotation();
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,get_rotation,return )

::phoenix::Vector Camera_obj::get_scale( ){
	HX_STACK_FRAME("phoenix.Camera","get_scale",0x412883b7,"phoenix.Camera.get_scale","phoenix/Camera.hx",514,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_LINE(514)
	return this->transform->get_scale();
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,get_scale,return )

::phoenix::Rectangle Camera_obj::get_viewport( ){
	HX_STACK_FRAME("phoenix.Camera","get_viewport",0x93495159,"phoenix.Camera.get_viewport","phoenix/Camera.hx",518,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_LINE(518)
	return this->viewport;
}


HX_DEFINE_DYNAMIC_FUNC0(Camera_obj,get_viewport,return )

::phoenix::Rectangle Camera_obj::set_viewport( ::phoenix::Rectangle _r){
	HX_STACK_FRAME("phoenix.Camera","set_viewport",0xa84274cd,"phoenix.Camera.set_viewport","phoenix/Camera.hx",521,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_r,"_r")
	HX_STACK_LINE(523)
	this->viewport = _r;
	HX_STACK_LINE(525)
	{
		HX_STACK_LINE(525)
		::phoenix::ProjectionType _g = this->projection;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(525)
		switch( (int)(_g->__Index())){
			case (int)0: {
				HX_STACK_LINE(530)
				this->transform->set_origin(::phoenix::Vector_obj::__new((Float(_r->w) / Float((int)2)),(Float(_r->h) / Float((int)2)),null(),null()));
				HX_STACK_LINE(532)
				this->set_pos(this->get_pos());
			}
			;break;
			case (int)1: {
			}
			;break;
			case (int)2: {
			}
			;break;
		}
	}
	HX_STACK_LINE(540)
	return this->get_viewport();
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_viewport,return )

::phoenix::Quaternion Camera_obj::set_rotation( ::phoenix::Quaternion _q){
	HX_STACK_FRAME("phoenix.Camera","set_rotation",0x142365a5,"phoenix.Camera.set_rotation","phoenix/Camera.hx",545,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_q,"_q")
	HX_STACK_LINE(545)
	return this->transform->set_rotation(_q);
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_rotation,return )

::phoenix::Vector Camera_obj::set_scale( ::phoenix::Vector _s){
	HX_STACK_FRAME("phoenix.Camera","set_scale",0x24796fc3,"phoenix.Camera.set_scale","phoenix/Camera.hx",549,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_s,"_s")
	HX_STACK_LINE(549)
	return this->transform->set_scale(_s);
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_scale,return )

::phoenix::Vector Camera_obj::set_pos( ::phoenix::Vector _p){
	HX_STACK_FRAME("phoenix.Camera","set_pos",0x5b770e8d,"phoenix.Camera.set_pos","phoenix/Camera.hx",552,0x1fcabb59)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_p,"_p")
	HX_STACK_LINE(554)
	this->pos = _p;
	HX_STACK_LINE(556)
	{
		HX_STACK_LINE(556)
		::phoenix::ProjectionType _g = this->projection;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(556)
		switch( (int)(_g->__Index())){
			case (int)0: {
				HX_STACK_LINE(560)
				Float _cx = this->get_center()->x;		HX_STACK_VAR(_cx,"_cx");
				HX_STACK_LINE(561)
				Float _cy = this->get_center()->y;		HX_STACK_VAR(_cy,"_cy");
				HX_STACK_LINE(563)
				if (((this->get_viewport() != null()))){
					HX_STACK_LINE(564)
					_cx = (_p->x + (Float(this->get_viewport()->w) / Float((int)2)));
					HX_STACK_LINE(565)
					_cy = (_p->y + (Float(this->get_viewport()->h) / Float((int)2)));
				}
				HX_STACK_LINE(568)
				this->_refresh_pos = true;
				HX_STACK_LINE(569)
				this->get_center()->ignore_listeners = true;
				HX_STACK_LINE(570)
				this->get_center()->set_x(_cx);
				HX_STACK_LINE(571)
				this->get_center()->set_y(_cy);
				HX_STACK_LINE(572)
				this->get_center()->ignore_listeners = false;
				HX_STACK_LINE(573)
				this->_refresh_pos = false;
				HX_STACK_LINE(575)
				this->transform->get_pos()->set_x(_cx);
				HX_STACK_LINE(576)
				this->transform->get_pos()->set_y(_cy);
			}
			;break;
			case (int)1: {
				HX_STACK_LINE(580)
				this->transform->set_pos(this->get_pos());
			}
			;break;
			case (int)2: {
			}
			;break;
		}
	}
	HX_STACK_LINE(586)
	::phoenix::Vector_obj::listen(this->get_pos(),this->_pos_changed_dyn());
	HX_STACK_LINE(588)
	return this->get_pos();
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,set_pos,return )

Void Camera_obj::_merge_options( Dynamic _options){
{
		HX_STACK_FRAME("phoenix.Camera","_merge_options",0x6b347742,"phoenix.Camera._merge_options","phoenix/Camera.hx",593,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_options,"_options")
		HX_STACK_LINE(595)
		if (((this->options->__Field(HX_CSTRING("aspect"),true) != null()))){
			HX_STACK_LINE(596)
			this->options->__FieldRef(HX_CSTRING("aspect")) = _options->__Field(HX_CSTRING("aspect"),true);
			HX_STACK_LINE(597)
			this->set_aspect(this->options->__Field(HX_CSTRING("aspect"),true));
		}
		HX_STACK_LINE(600)
		if (((this->options->__Field(HX_CSTRING("far"),true) != null()))){
			HX_STACK_LINE(601)
			this->options->__FieldRef(HX_CSTRING("far")) = _options->__Field(HX_CSTRING("far"),true);
			HX_STACK_LINE(602)
			this->set_far(this->options->__Field(HX_CSTRING("far"),true));
		}
		HX_STACK_LINE(605)
		if (((this->options->__Field(HX_CSTRING("fov"),true) != null()))){
			HX_STACK_LINE(606)
			this->options->__FieldRef(HX_CSTRING("fov")) = _options->__Field(HX_CSTRING("fov"),true);
			HX_STACK_LINE(607)
			this->set_fov(this->options->__Field(HX_CSTRING("fov"),true));
		}
		HX_STACK_LINE(610)
		if (((this->options->__Field(HX_CSTRING("near"),true) != null()))){
			HX_STACK_LINE(611)
			this->options->__FieldRef(HX_CSTRING("near")) = _options->__Field(HX_CSTRING("near"),true);
			HX_STACK_LINE(612)
			this->set_near(this->options->__Field(HX_CSTRING("near"),true));
		}
		HX_STACK_LINE(615)
		if (((this->options->__Field(HX_CSTRING("viewport"),true) != null()))){
			HX_STACK_LINE(616)
			this->options->__FieldRef(HX_CSTRING("viewport")) = _options->__Field(HX_CSTRING("viewport"),true);
			HX_STACK_LINE(617)
			this->set_viewport(this->options->__Field(HX_CSTRING("viewport"),true));
		}
		HX_STACK_LINE(621)
		this->apply_default_camera_options();
		HX_STACK_LINE(623)
		if (((_options->__Field(HX_CSTRING("cull_backfaces"),true) != null()))){
			HX_STACK_LINE(624)
			this->options->__FieldRef(HX_CSTRING("cull_backfaces")) = _options->__Field(HX_CSTRING("cull_backfaces"),true);
		}
		HX_STACK_LINE(627)
		if (((_options->__Field(HX_CSTRING("depth_test"),true) != null()))){
			HX_STACK_LINE(628)
			this->options->__FieldRef(HX_CSTRING("depth_test")) = _options->__Field(HX_CSTRING("depth_test"),true);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,_merge_options,(void))

Void Camera_obj::_pos_changed( Float v){
{
		HX_STACK_FRAME("phoenix.Camera","_pos_changed",0x32241af4,"phoenix.Camera._pos_changed","phoenix/Camera.hx",635,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_ARG(v,"v")
		HX_STACK_LINE(635)
		this->set_pos(this->get_pos());
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,_pos_changed,(void))

Void Camera_obj::_center_changed( Float v){
{
		HX_STACK_FRAME("phoenix.Camera","_center_changed",0xdc3d733f,"phoenix.Camera._center_changed","phoenix/Camera.hx",641,0x1fcabb59)
		HX_STACK_THIS(this)
		HX_STACK_ARG(v,"v")
		HX_STACK_LINE(641)
		this->set_center(this->get_center());
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Camera_obj,_center_changed,(void))


Camera_obj::Camera_obj()
{
}

void Camera_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(Camera);
	HX_MARK_MEMBER_NAME(name,"name");
	HX_MARK_MEMBER_NAME(viewport,"viewport");
	HX_MARK_MEMBER_NAME(center,"center");
	HX_MARK_MEMBER_NAME(zoom,"zoom");
	HX_MARK_MEMBER_NAME(near,"near");
	HX_MARK_MEMBER_NAME(far,"far");
	HX_MARK_MEMBER_NAME(fov,"fov");
	HX_MARK_MEMBER_NAME(aspect,"aspect");
	HX_MARK_MEMBER_NAME(target,"target");
	HX_MARK_MEMBER_NAME(pos,"pos");
	HX_MARK_MEMBER_NAME(transform,"transform");
	HX_MARK_MEMBER_NAME(minimum_zoom,"minimum_zoom");
	HX_MARK_MEMBER_NAME(projection_matrix,"projection_matrix");
	HX_MARK_MEMBER_NAME(view_matrix,"view_matrix");
	HX_MARK_MEMBER_NAME(view_matrix_inverse,"view_matrix_inverse");
	HX_MARK_MEMBER_NAME(look_at_matrix,"look_at_matrix");
	HX_MARK_MEMBER_NAME(options,"options");
	HX_MARK_MEMBER_NAME(projection,"projection");
	HX_MARK_MEMBER_NAME(up,"up");
	HX_MARK_MEMBER_NAME(projection_float32array,"projection_float32array");
	HX_MARK_MEMBER_NAME(view_inverse_float32array,"view_inverse_float32array");
	HX_MARK_MEMBER_NAME(transform_dirty,"transform_dirty");
	HX_MARK_MEMBER_NAME(projection_dirty,"projection_dirty");
	HX_MARK_MEMBER_NAME(look_at_dirty,"look_at_dirty");
	HX_MARK_MEMBER_NAME(_setup,"_setup");
	HX_MARK_MEMBER_NAME(_refresh_pos,"_refresh_pos");
	HX_MARK_END_CLASS();
}

void Camera_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(name,"name");
	HX_VISIT_MEMBER_NAME(viewport,"viewport");
	HX_VISIT_MEMBER_NAME(center,"center");
	HX_VISIT_MEMBER_NAME(zoom,"zoom");
	HX_VISIT_MEMBER_NAME(near,"near");
	HX_VISIT_MEMBER_NAME(far,"far");
	HX_VISIT_MEMBER_NAME(fov,"fov");
	HX_VISIT_MEMBER_NAME(aspect,"aspect");
	HX_VISIT_MEMBER_NAME(target,"target");
	HX_VISIT_MEMBER_NAME(pos,"pos");
	HX_VISIT_MEMBER_NAME(transform,"transform");
	HX_VISIT_MEMBER_NAME(minimum_zoom,"minimum_zoom");
	HX_VISIT_MEMBER_NAME(projection_matrix,"projection_matrix");
	HX_VISIT_MEMBER_NAME(view_matrix,"view_matrix");
	HX_VISIT_MEMBER_NAME(view_matrix_inverse,"view_matrix_inverse");
	HX_VISIT_MEMBER_NAME(look_at_matrix,"look_at_matrix");
	HX_VISIT_MEMBER_NAME(options,"options");
	HX_VISIT_MEMBER_NAME(projection,"projection");
	HX_VISIT_MEMBER_NAME(up,"up");
	HX_VISIT_MEMBER_NAME(projection_float32array,"projection_float32array");
	HX_VISIT_MEMBER_NAME(view_inverse_float32array,"view_inverse_float32array");
	HX_VISIT_MEMBER_NAME(transform_dirty,"transform_dirty");
	HX_VISIT_MEMBER_NAME(projection_dirty,"projection_dirty");
	HX_VISIT_MEMBER_NAME(look_at_dirty,"look_at_dirty");
	HX_VISIT_MEMBER_NAME(_setup,"_setup");
	HX_VISIT_MEMBER_NAME(_refresh_pos,"_refresh_pos");
}

Dynamic Camera_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 2:
		if (HX_FIELD_EQ(inName,"up") ) { return up; }
		break;
	case 3:
		if (HX_FIELD_EQ(inName,"far") ) { return far; }
		if (HX_FIELD_EQ(inName,"fov") ) { return fov; }
		if (HX_FIELD_EQ(inName,"pos") ) { return inCallProp ? get_pos() : pos; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"name") ) { return name; }
		if (HX_FIELD_EQ(inName,"zoom") ) { return zoom; }
		if (HX_FIELD_EQ(inName,"near") ) { return near; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"scale") ) { return get_scale(); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"center") ) { return inCallProp ? get_center() : center; }
		if (HX_FIELD_EQ(inName,"aspect") ) { return aspect; }
		if (HX_FIELD_EQ(inName,"target") ) { return target; }
		if (HX_FIELD_EQ(inName,"_setup") ) { return _setup; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"options") ) { return options; }
		if (HX_FIELD_EQ(inName,"project") ) { return project_dyn(); }
		if (HX_FIELD_EQ(inName,"process") ) { return process_dyn(); }
		if (HX_FIELD_EQ(inName,"set_fov") ) { return set_fov_dyn(); }
		if (HX_FIELD_EQ(inName,"set_far") ) { return set_far_dyn(); }
		if (HX_FIELD_EQ(inName,"get_pos") ) { return get_pos_dyn(); }
		if (HX_FIELD_EQ(inName,"set_pos") ) { return set_pos_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"viewport") ) { return inCallProp ? get_viewport() : viewport; }
		if (HX_FIELD_EQ(inName,"rotation") ) { return get_rotation(); }
		if (HX_FIELD_EQ(inName,"set_near") ) { return set_near_dyn(); }
		if (HX_FIELD_EQ(inName,"set_zoom") ) { return set_zoom_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"transform") ) { return transform; }
		if (HX_FIELD_EQ(inName,"set_ortho") ) { return set_ortho_dyn(); }
		if (HX_FIELD_EQ(inName,"unproject") ) { return unproject_dyn(); }
		if (HX_FIELD_EQ(inName,"get_scale") ) { return get_scale_dyn(); }
		if (HX_FIELD_EQ(inName,"set_scale") ) { return set_scale_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"projection") ) { return projection; }
		if (HX_FIELD_EQ(inName,"set_target") ) { return set_target_dyn(); }
		if (HX_FIELD_EQ(inName,"set_aspect") ) { return set_aspect_dyn(); }
		if (HX_FIELD_EQ(inName,"set_center") ) { return set_center_dyn(); }
		if (HX_FIELD_EQ(inName,"get_center") ) { return get_center_dyn(); }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"view_matrix") ) { return view_matrix; }
		if (HX_FIELD_EQ(inName,"apply_state") ) { return apply_state_dyn(); }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"minimum_zoom") ) { return minimum_zoom; }
		if (HX_FIELD_EQ(inName,"_refresh_pos") ) { return _refresh_pos; }
		if (HX_FIELD_EQ(inName,"get_rotation") ) { return get_rotation_dyn(); }
		if (HX_FIELD_EQ(inName,"get_viewport") ) { return get_viewport_dyn(); }
		if (HX_FIELD_EQ(inName,"set_viewport") ) { return set_viewport_dyn(); }
		if (HX_FIELD_EQ(inName,"set_rotation") ) { return set_rotation_dyn(); }
		if (HX_FIELD_EQ(inName,"_pos_changed") ) { return _pos_changed_dyn(); }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"look_at_dirty") ) { return look_at_dirty; }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"look_at_matrix") ) { return look_at_matrix; }
		if (HX_FIELD_EQ(inName,"update_look_at") ) { return update_look_at_dyn(); }
		if (HX_FIELD_EQ(inName,"_merge_options") ) { return _merge_options_dyn(); }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"transform_dirty") ) { return transform_dirty; }
		if (HX_FIELD_EQ(inName,"set_perspective") ) { return set_perspective_dyn(); }
		if (HX_FIELD_EQ(inName,"_center_changed") ) { return _center_changed_dyn(); }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"projection_dirty") ) { return projection_dirty; }
		break;
	case 17:
		if (HX_FIELD_EQ(inName,"projection_matrix") ) { return projection_matrix; }
		break;
	case 18:
		if (HX_FIELD_EQ(inName,"update_view_matrix") ) { return update_view_matrix_dyn(); }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"view_matrix_inverse") ) { return view_matrix_inverse; }
		if (HX_FIELD_EQ(inName,"screen_point_to_ray") ) { return screen_point_to_ray_dyn(); }
		break;
	case 20:
		if (HX_FIELD_EQ(inName,"on_transform_cleaned") ) { return on_transform_cleaned_dyn(); }
		break;
	case 21:
		if (HX_FIELD_EQ(inName,"screen_point_to_world") ) { return screen_point_to_world_dyn(); }
		if (HX_FIELD_EQ(inName,"world_point_to_screen") ) { return world_point_to_screen_dyn(); }
		if (HX_FIELD_EQ(inName,"ortho_screen_to_world") ) { return ortho_screen_to_world_dyn(); }
		if (HX_FIELD_EQ(inName,"ortho_world_to_screen") ) { return ortho_world_to_screen_dyn(); }
		break;
	case 22:
		if (HX_FIELD_EQ(inName,"default_camera_options") ) { return default_camera_options_dyn(); }
		break;
	case 23:
		if (HX_FIELD_EQ(inName,"projection_float32array") ) { return projection_float32array; }
		break;
	case 24:
		if (HX_FIELD_EQ(inName,"update_projection_matrix") ) { return update_projection_matrix_dyn(); }
		break;
	case 25:
		if (HX_FIELD_EQ(inName,"view_inverse_float32array") ) { return view_inverse_float32array; }
		break;
	case 28:
		if (HX_FIELD_EQ(inName,"apply_default_camera_options") ) { return apply_default_camera_options_dyn(); }
		if (HX_FIELD_EQ(inName,"persepective_world_to_screen") ) { return persepective_world_to_screen_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic Camera_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 2:
		if (HX_FIELD_EQ(inName,"up") ) { up=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		break;
	case 3:
		if (HX_FIELD_EQ(inName,"far") ) { if (inCallProp) return set_far(inValue);far=inValue.Cast< Float >(); return inValue; }
		if (HX_FIELD_EQ(inName,"fov") ) { if (inCallProp) return set_fov(inValue);fov=inValue.Cast< Float >(); return inValue; }
		if (HX_FIELD_EQ(inName,"pos") ) { if (inCallProp) return set_pos(inValue);pos=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"name") ) { name=inValue.Cast< ::String >(); return inValue; }
		if (HX_FIELD_EQ(inName,"zoom") ) { if (inCallProp) return set_zoom(inValue);zoom=inValue.Cast< Float >(); return inValue; }
		if (HX_FIELD_EQ(inName,"near") ) { if (inCallProp) return set_near(inValue);near=inValue.Cast< Float >(); return inValue; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"scale") ) { return set_scale(inValue); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"center") ) { if (inCallProp) return set_center(inValue);center=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		if (HX_FIELD_EQ(inName,"aspect") ) { if (inCallProp) return set_aspect(inValue);aspect=inValue.Cast< Float >(); return inValue; }
		if (HX_FIELD_EQ(inName,"target") ) { if (inCallProp) return set_target(inValue);target=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		if (HX_FIELD_EQ(inName,"_setup") ) { _setup=inValue.Cast< bool >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"options") ) { options=inValue.Cast< Dynamic >(); return inValue; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"viewport") ) { if (inCallProp) return set_viewport(inValue);viewport=inValue.Cast< ::phoenix::Rectangle >(); return inValue; }
		if (HX_FIELD_EQ(inName,"rotation") ) { return set_rotation(inValue); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"transform") ) { transform=inValue.Cast< ::phoenix::Transform >(); return inValue; }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"projection") ) { projection=inValue.Cast< ::phoenix::ProjectionType >(); return inValue; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"view_matrix") ) { view_matrix=inValue.Cast< ::phoenix::Matrix >(); return inValue; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"minimum_zoom") ) { minimum_zoom=inValue.Cast< Float >(); return inValue; }
		if (HX_FIELD_EQ(inName,"_refresh_pos") ) { _refresh_pos=inValue.Cast< bool >(); return inValue; }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"look_at_dirty") ) { look_at_dirty=inValue.Cast< bool >(); return inValue; }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"look_at_matrix") ) { look_at_matrix=inValue.Cast< ::phoenix::Matrix >(); return inValue; }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"transform_dirty") ) { transform_dirty=inValue.Cast< bool >(); return inValue; }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"projection_dirty") ) { projection_dirty=inValue.Cast< bool >(); return inValue; }
		break;
	case 17:
		if (HX_FIELD_EQ(inName,"projection_matrix") ) { projection_matrix=inValue.Cast< ::phoenix::Matrix >(); return inValue; }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"view_matrix_inverse") ) { view_matrix_inverse=inValue.Cast< ::phoenix::Matrix >(); return inValue; }
		break;
	case 23:
		if (HX_FIELD_EQ(inName,"projection_float32array") ) { projection_float32array=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		break;
	case 25:
		if (HX_FIELD_EQ(inName,"view_inverse_float32array") ) { view_inverse_float32array=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void Camera_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("name"));
	outFields->push(HX_CSTRING("viewport"));
	outFields->push(HX_CSTRING("center"));
	outFields->push(HX_CSTRING("zoom"));
	outFields->push(HX_CSTRING("near"));
	outFields->push(HX_CSTRING("far"));
	outFields->push(HX_CSTRING("fov"));
	outFields->push(HX_CSTRING("aspect"));
	outFields->push(HX_CSTRING("target"));
	outFields->push(HX_CSTRING("pos"));
	outFields->push(HX_CSTRING("scale"));
	outFields->push(HX_CSTRING("rotation"));
	outFields->push(HX_CSTRING("transform"));
	outFields->push(HX_CSTRING("minimum_zoom"));
	outFields->push(HX_CSTRING("projection_matrix"));
	outFields->push(HX_CSTRING("view_matrix"));
	outFields->push(HX_CSTRING("view_matrix_inverse"));
	outFields->push(HX_CSTRING("look_at_matrix"));
	outFields->push(HX_CSTRING("options"));
	outFields->push(HX_CSTRING("projection"));
	outFields->push(HX_CSTRING("up"));
	outFields->push(HX_CSTRING("projection_float32array"));
	outFields->push(HX_CSTRING("view_inverse_float32array"));
	outFields->push(HX_CSTRING("transform_dirty"));
	outFields->push(HX_CSTRING("projection_dirty"));
	outFields->push(HX_CSTRING("look_at_dirty"));
	outFields->push(HX_CSTRING("_setup"));
	outFields->push(HX_CSTRING("_refresh_pos"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsString,(int)offsetof(Camera_obj,name),HX_CSTRING("name")},
	{hx::fsObject /*::phoenix::Rectangle*/ ,(int)offsetof(Camera_obj,viewport),HX_CSTRING("viewport")},
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(Camera_obj,center),HX_CSTRING("center")},
	{hx::fsFloat,(int)offsetof(Camera_obj,zoom),HX_CSTRING("zoom")},
	{hx::fsFloat,(int)offsetof(Camera_obj,near),HX_CSTRING("near")},
	{hx::fsFloat,(int)offsetof(Camera_obj,far),HX_CSTRING("far")},
	{hx::fsFloat,(int)offsetof(Camera_obj,fov),HX_CSTRING("fov")},
	{hx::fsFloat,(int)offsetof(Camera_obj,aspect),HX_CSTRING("aspect")},
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(Camera_obj,target),HX_CSTRING("target")},
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(Camera_obj,pos),HX_CSTRING("pos")},
	{hx::fsObject /*::phoenix::Transform*/ ,(int)offsetof(Camera_obj,transform),HX_CSTRING("transform")},
	{hx::fsFloat,(int)offsetof(Camera_obj,minimum_zoom),HX_CSTRING("minimum_zoom")},
	{hx::fsObject /*::phoenix::Matrix*/ ,(int)offsetof(Camera_obj,projection_matrix),HX_CSTRING("projection_matrix")},
	{hx::fsObject /*::phoenix::Matrix*/ ,(int)offsetof(Camera_obj,view_matrix),HX_CSTRING("view_matrix")},
	{hx::fsObject /*::phoenix::Matrix*/ ,(int)offsetof(Camera_obj,view_matrix_inverse),HX_CSTRING("view_matrix_inverse")},
	{hx::fsObject /*::phoenix::Matrix*/ ,(int)offsetof(Camera_obj,look_at_matrix),HX_CSTRING("look_at_matrix")},
	{hx::fsObject /*Dynamic*/ ,(int)offsetof(Camera_obj,options),HX_CSTRING("options")},
	{hx::fsObject /*::phoenix::ProjectionType*/ ,(int)offsetof(Camera_obj,projection),HX_CSTRING("projection")},
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(Camera_obj,up),HX_CSTRING("up")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Camera_obj,projection_float32array),HX_CSTRING("projection_float32array")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Camera_obj,view_inverse_float32array),HX_CSTRING("view_inverse_float32array")},
	{hx::fsBool,(int)offsetof(Camera_obj,transform_dirty),HX_CSTRING("transform_dirty")},
	{hx::fsBool,(int)offsetof(Camera_obj,projection_dirty),HX_CSTRING("projection_dirty")},
	{hx::fsBool,(int)offsetof(Camera_obj,look_at_dirty),HX_CSTRING("look_at_dirty")},
	{hx::fsBool,(int)offsetof(Camera_obj,_setup),HX_CSTRING("_setup")},
	{hx::fsBool,(int)offsetof(Camera_obj,_refresh_pos),HX_CSTRING("_refresh_pos")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("name"),
	HX_CSTRING("viewport"),
	HX_CSTRING("center"),
	HX_CSTRING("zoom"),
	HX_CSTRING("near"),
	HX_CSTRING("far"),
	HX_CSTRING("fov"),
	HX_CSTRING("aspect"),
	HX_CSTRING("target"),
	HX_CSTRING("pos"),
	HX_CSTRING("transform"),
	HX_CSTRING("minimum_zoom"),
	HX_CSTRING("projection_matrix"),
	HX_CSTRING("view_matrix"),
	HX_CSTRING("view_matrix_inverse"),
	HX_CSTRING("look_at_matrix"),
	HX_CSTRING("options"),
	HX_CSTRING("projection"),
	HX_CSTRING("up"),
	HX_CSTRING("projection_float32array"),
	HX_CSTRING("view_inverse_float32array"),
	HX_CSTRING("transform_dirty"),
	HX_CSTRING("projection_dirty"),
	HX_CSTRING("look_at_dirty"),
	HX_CSTRING("_setup"),
	HX_CSTRING("set_ortho"),
	HX_CSTRING("set_perspective"),
	HX_CSTRING("project"),
	HX_CSTRING("unproject"),
	HX_CSTRING("screen_point_to_ray"),
	HX_CSTRING("screen_point_to_world"),
	HX_CSTRING("world_point_to_screen"),
	HX_CSTRING("process"),
	HX_CSTRING("on_transform_cleaned"),
	HX_CSTRING("update_look_at"),
	HX_CSTRING("update_view_matrix"),
	HX_CSTRING("update_projection_matrix"),
	HX_CSTRING("apply_state"),
	HX_CSTRING("apply_default_camera_options"),
	HX_CSTRING("default_camera_options"),
	HX_CSTRING("ortho_screen_to_world"),
	HX_CSTRING("ortho_world_to_screen"),
	HX_CSTRING("persepective_world_to_screen"),
	HX_CSTRING("set_target"),
	HX_CSTRING("set_fov"),
	HX_CSTRING("set_aspect"),
	HX_CSTRING("set_near"),
	HX_CSTRING("set_far"),
	HX_CSTRING("set_zoom"),
	HX_CSTRING("_refresh_pos"),
	HX_CSTRING("set_center"),
	HX_CSTRING("get_center"),
	HX_CSTRING("get_pos"),
	HX_CSTRING("get_rotation"),
	HX_CSTRING("get_scale"),
	HX_CSTRING("get_viewport"),
	HX_CSTRING("set_viewport"),
	HX_CSTRING("set_rotation"),
	HX_CSTRING("set_scale"),
	HX_CSTRING("set_pos"),
	HX_CSTRING("_merge_options"),
	HX_CSTRING("_pos_changed"),
	HX_CSTRING("_center_changed"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(Camera_obj::__mClass,"__mClass");
};

#ifdef HXCPP_VISIT_ALLOCS
static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(Camera_obj::__mClass,"__mClass");
};

#endif

Class Camera_obj::__mClass;

void Camera_obj::__register()
{
	hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("phoenix.Camera"), hx::TCanCast< Camera_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
    , sVisitStatics
#endif
#ifdef HXCPP_SCRIPTABLE
    , sMemberStorageInfo
#endif
);
}

void Camera_obj::__boot()
{
}

} // end namespace phoenix
