#include <hxcpp.h>

#ifndef INCLUDED_phoenix_Matrix
#include <phoenix/Matrix.h>
#endif
#ifndef INCLUDED_phoenix_MatrixTransform
#include <phoenix/MatrixTransform.h>
#endif
#ifndef INCLUDED_phoenix_Quaternion
#include <phoenix/Quaternion.h>
#endif
#ifndef INCLUDED_phoenix_Spatial
#include <phoenix/Spatial.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 Spatial_obj::__construct()
{
HX_STACK_FRAME("phoenix.Spatial","new",0x51d44037,"phoenix.Spatial.new","phoenix/Transform.hx",534,0x44da8ab2)
{
	HX_STACK_LINE(549)
	this->_setup = true;
	HX_STACK_LINE(543)
	this->ignore_listeners = false;
	HX_STACK_LINE(553)
	this->set_matrix(::phoenix::Matrix_obj::__new(null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null(),null()));
	HX_STACK_LINE(554)
	this->floats = this->get_matrix()->float32array();
	HX_STACK_LINE(556)
	this->set_pos(::phoenix::Vector_obj::__new(null(),null(),null(),null()));
	HX_STACK_LINE(557)
	this->set_rotation(::phoenix::Quaternion_obj::__new(null(),null(),null(),null()));
	HX_STACK_LINE(558)
	this->set_scale(::phoenix::Vector_obj::__new((int)1,(int)1,(int)1,null()));
	HX_STACK_LINE(560)
	this->_setup = false;
}
;
	return null();
}

//Spatial_obj::~Spatial_obj() { }

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

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

Void Spatial_obj::decompose( ){
{
		HX_STACK_FRAME("phoenix.Spatial","decompose",0xa72c2ec8,"phoenix.Spatial.decompose","phoenix/Transform.hx",565,0x44da8ab2)
		HX_STACK_THIS(this)
		HX_STACK_LINE(567)
		::phoenix::MatrixTransform _transform = this->get_matrix()->decompose(null(),null(),null());		HX_STACK_VAR(_transform,"_transform");
		HX_STACK_LINE(569)
		this->set_pos(_transform->pos);
		HX_STACK_LINE(570)
		this->set_rotation(_transform->rotation);
		HX_STACK_LINE(571)
		this->set_scale(_transform->scale);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Spatial_obj,decompose,(void))

::phoenix::Matrix Spatial_obj::get_matrix( ){
	HX_STACK_FRAME("phoenix.Spatial","get_matrix",0x73a8ef13,"phoenix.Spatial.get_matrix","phoenix/Transform.hx",577,0x44da8ab2)
	HX_STACK_THIS(this)
	HX_STACK_LINE(577)
	return this->matrix;
}


HX_DEFINE_DYNAMIC_FUNC0(Spatial_obj,get_matrix,return )

::phoenix::Matrix Spatial_obj::set_matrix( ::phoenix::Matrix _m){
	HX_STACK_FRAME("phoenix.Spatial","set_matrix",0x77268d87,"phoenix.Spatial.set_matrix","phoenix/Transform.hx",581,0x44da8ab2)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_m,"_m")
	HX_STACK_LINE(583)
	this->matrix = _m;
	HX_STACK_LINE(586)
	this->floats = this->get_matrix()->float32array();
	HX_STACK_LINE(588)
	return this->get_matrix();
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,set_matrix,return )

Void Spatial_obj::propagate_pos( ::phoenix::Vector _p){
{
		HX_STACK_FRAME("phoenix.Spatial","propagate_pos",0x23adb615,"phoenix.Spatial.propagate_pos","phoenix/Transform.hx",593,0x44da8ab2)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_p,"_p")
		HX_STACK_LINE(593)
		if (((bool((this->pos_changed_dyn() != null())) && bool(!(this->ignore_listeners))))){
			HX_STACK_LINE(594)
			this->pos_changed(_p);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,propagate_pos,(void))

Void Spatial_obj::propagate_rotation( ::phoenix::Quaternion _r){
{
		HX_STACK_FRAME("phoenix.Spatial","propagate_rotation",0xc1f8711d,"phoenix.Spatial.propagate_rotation","phoenix/Transform.hx",599,0x44da8ab2)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_r,"_r")
		HX_STACK_LINE(599)
		if (((bool((this->rotation_changed_dyn() != null())) && bool(!(this->ignore_listeners))))){
			HX_STACK_LINE(600)
			this->rotation_changed(_r);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,propagate_rotation,(void))

Void Spatial_obj::propagate_scale( ::phoenix::Vector _s){
{
		HX_STACK_FRAME("phoenix.Spatial","propagate_scale",0x654f094b,"phoenix.Spatial.propagate_scale","phoenix/Transform.hx",605,0x44da8ab2)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_s,"_s")
		HX_STACK_LINE(605)
		if (((bool((this->scale_changed_dyn() != null())) && bool(!(this->ignore_listeners))))){
			HX_STACK_LINE(606)
			this->scale_changed(_s);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,propagate_scale,(void))

::phoenix::Vector Spatial_obj::set_pos( ::phoenix::Vector _p){
	HX_STACK_FRAME("phoenix.Spatial","set_pos",0x70d65e8e,"phoenix.Spatial.set_pos","phoenix/Transform.hx",610,0x44da8ab2)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_p,"_p")
	HX_STACK_LINE(612)
	this->pos = _p;
	HX_STACK_LINE(614)
	::phoenix::Vector_obj::listen(this->pos,this->_pos_change_dyn());
	HX_STACK_LINE(616)
	this->propagate_pos(this->pos);
	HX_STACK_LINE(618)
	return this->pos;
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,set_pos,return )

::phoenix::Quaternion Spatial_obj::set_rotation( ::phoenix::Quaternion _r){
	HX_STACK_FRAME("phoenix.Spatial","set_rotation",0x199d7204,"phoenix.Spatial.set_rotation","phoenix/Transform.hx",622,0x44da8ab2)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_r,"_r")
	HX_STACK_LINE(624)
	this->rotation = _r;
	HX_STACK_LINE(626)
	::phoenix::Quaternion_obj::listen(this->rotation,this->_rotation_change_dyn());
	HX_STACK_LINE(628)
	this->propagate_rotation(this->rotation);
	HX_STACK_LINE(630)
	return this->rotation;
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,set_rotation,return )

::phoenix::Vector Spatial_obj::set_scale( ::phoenix::Vector _s){
	HX_STACK_FRAME("phoenix.Spatial","set_scale",0xcc4d8204,"phoenix.Spatial.set_scale","phoenix/Transform.hx",634,0x44da8ab2)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_s,"_s")
	HX_STACK_LINE(636)
	this->scale = _s;
	HX_STACK_LINE(638)
	::phoenix::Vector_obj::listen(this->scale,this->_scale_change_dyn());
	HX_STACK_LINE(640)
	this->propagate_scale(this->scale);
	HX_STACK_LINE(642)
	return this->scale;
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,set_scale,return )

Void Spatial_obj::_pos_change( Float _v){
{
		HX_STACK_FRAME("phoenix.Spatial","_pos_change",0xe8244bf1,"phoenix.Spatial._pos_change","phoenix/Transform.hx",649,0x44da8ab2)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_v,"_v")
		HX_STACK_LINE(649)
		this->set_pos(this->pos);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,_pos_change,(void))

Void Spatial_obj::_scale_change( Float _v){
{
		HX_STACK_FRAME("phoenix.Spatial","_scale_change",0xaf1def3b,"phoenix.Spatial._scale_change","phoenix/Transform.hx",651,0x44da8ab2)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_v,"_v")
		HX_STACK_LINE(651)
		this->set_scale(this->scale);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,_scale_change,(void))

Void Spatial_obj::_rotation_change( Float _v){
{
		HX_STACK_FRAME("phoenix.Spatial","_rotation_change",0x09a321db,"phoenix.Spatial._rotation_change","phoenix/Transform.hx",653,0x44da8ab2)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_v,"_v")
		HX_STACK_LINE(653)
		this->set_rotation(this->rotation);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Spatial_obj,_rotation_change,(void))


Spatial_obj::Spatial_obj()
{
}

void Spatial_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(Spatial);
	HX_MARK_MEMBER_NAME(pos,"pos");
	HX_MARK_MEMBER_NAME(rotation,"rotation");
	HX_MARK_MEMBER_NAME(scale,"scale");
	HX_MARK_MEMBER_NAME(matrix,"matrix");
	HX_MARK_MEMBER_NAME(floats,"floats");
	HX_MARK_MEMBER_NAME(ignore_listeners,"ignore_listeners");
	HX_MARK_MEMBER_NAME(pos_changed,"pos_changed");
	HX_MARK_MEMBER_NAME(rotation_changed,"rotation_changed");
	HX_MARK_MEMBER_NAME(scale_changed,"scale_changed");
	HX_MARK_MEMBER_NAME(_setup,"_setup");
	HX_MARK_END_CLASS();
}

void Spatial_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(pos,"pos");
	HX_VISIT_MEMBER_NAME(rotation,"rotation");
	HX_VISIT_MEMBER_NAME(scale,"scale");
	HX_VISIT_MEMBER_NAME(matrix,"matrix");
	HX_VISIT_MEMBER_NAME(floats,"floats");
	HX_VISIT_MEMBER_NAME(ignore_listeners,"ignore_listeners");
	HX_VISIT_MEMBER_NAME(pos_changed,"pos_changed");
	HX_VISIT_MEMBER_NAME(rotation_changed,"rotation_changed");
	HX_VISIT_MEMBER_NAME(scale_changed,"scale_changed");
	HX_VISIT_MEMBER_NAME(_setup,"_setup");
}

Dynamic Spatial_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"pos") ) { return pos; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"scale") ) { return scale; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"matrix") ) { return inCallProp ? get_matrix() : matrix; }
		if (HX_FIELD_EQ(inName,"floats") ) { return floats; }
		if (HX_FIELD_EQ(inName,"_setup") ) { return _setup; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"set_pos") ) { return set_pos_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"rotation") ) { return rotation; }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"decompose") ) { return decompose_dyn(); }
		if (HX_FIELD_EQ(inName,"set_scale") ) { return set_scale_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"get_matrix") ) { return get_matrix_dyn(); }
		if (HX_FIELD_EQ(inName,"set_matrix") ) { return set_matrix_dyn(); }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"pos_changed") ) { return pos_changed; }
		if (HX_FIELD_EQ(inName,"_pos_change") ) { return _pos_change_dyn(); }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"set_rotation") ) { return set_rotation_dyn(); }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"scale_changed") ) { return scale_changed; }
		if (HX_FIELD_EQ(inName,"propagate_pos") ) { return propagate_pos_dyn(); }
		if (HX_FIELD_EQ(inName,"_scale_change") ) { return _scale_change_dyn(); }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"propagate_scale") ) { return propagate_scale_dyn(); }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"ignore_listeners") ) { return ignore_listeners; }
		if (HX_FIELD_EQ(inName,"rotation_changed") ) { return rotation_changed; }
		if (HX_FIELD_EQ(inName,"_rotation_change") ) { return _rotation_change_dyn(); }
		break;
	case 18:
		if (HX_FIELD_EQ(inName,"propagate_rotation") ) { return propagate_rotation_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic Spatial_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"pos") ) { if (inCallProp) return set_pos(inValue);pos=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"scale") ) { if (inCallProp) return set_scale(inValue);scale=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"matrix") ) { if (inCallProp) return set_matrix(inValue);matrix=inValue.Cast< ::phoenix::Matrix >(); return inValue; }
		if (HX_FIELD_EQ(inName,"floats") ) { floats=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		if (HX_FIELD_EQ(inName,"_setup") ) { _setup=inValue.Cast< bool >(); return inValue; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"rotation") ) { if (inCallProp) return set_rotation(inValue);rotation=inValue.Cast< ::phoenix::Quaternion >(); return inValue; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"pos_changed") ) { pos_changed=inValue.Cast< Dynamic >(); return inValue; }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"scale_changed") ) { scale_changed=inValue.Cast< Dynamic >(); return inValue; }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"ignore_listeners") ) { ignore_listeners=inValue.Cast< bool >(); return inValue; }
		if (HX_FIELD_EQ(inName,"rotation_changed") ) { rotation_changed=inValue.Cast< Dynamic >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void Spatial_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("pos"));
	outFields->push(HX_CSTRING("rotation"));
	outFields->push(HX_CSTRING("scale"));
	outFields->push(HX_CSTRING("matrix"));
	outFields->push(HX_CSTRING("floats"));
	outFields->push(HX_CSTRING("ignore_listeners"));
	outFields->push(HX_CSTRING("_setup"));
	super::__GetFields(outFields);
};

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

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(Spatial_obj,pos),HX_CSTRING("pos")},
	{hx::fsObject /*::phoenix::Quaternion*/ ,(int)offsetof(Spatial_obj,rotation),HX_CSTRING("rotation")},
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(Spatial_obj,scale),HX_CSTRING("scale")},
	{hx::fsObject /*::phoenix::Matrix*/ ,(int)offsetof(Spatial_obj,matrix),HX_CSTRING("matrix")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Spatial_obj,floats),HX_CSTRING("floats")},
	{hx::fsBool,(int)offsetof(Spatial_obj,ignore_listeners),HX_CSTRING("ignore_listeners")},
	{hx::fsObject /*Dynamic*/ ,(int)offsetof(Spatial_obj,pos_changed),HX_CSTRING("pos_changed")},
	{hx::fsObject /*Dynamic*/ ,(int)offsetof(Spatial_obj,rotation_changed),HX_CSTRING("rotation_changed")},
	{hx::fsObject /*Dynamic*/ ,(int)offsetof(Spatial_obj,scale_changed),HX_CSTRING("scale_changed")},
	{hx::fsBool,(int)offsetof(Spatial_obj,_setup),HX_CSTRING("_setup")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("pos"),
	HX_CSTRING("rotation"),
	HX_CSTRING("scale"),
	HX_CSTRING("matrix"),
	HX_CSTRING("floats"),
	HX_CSTRING("ignore_listeners"),
	HX_CSTRING("pos_changed"),
	HX_CSTRING("rotation_changed"),
	HX_CSTRING("scale_changed"),
	HX_CSTRING("_setup"),
	HX_CSTRING("decompose"),
	HX_CSTRING("get_matrix"),
	HX_CSTRING("set_matrix"),
	HX_CSTRING("propagate_pos"),
	HX_CSTRING("propagate_rotation"),
	HX_CSTRING("propagate_scale"),
	HX_CSTRING("set_pos"),
	HX_CSTRING("set_rotation"),
	HX_CSTRING("set_scale"),
	HX_CSTRING("_pos_change"),
	HX_CSTRING("_scale_change"),
	HX_CSTRING("_rotation_change"),
	String(null()) };

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

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

#endif

Class Spatial_obj::__mClass;

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

void Spatial_obj::__boot()
{
}

} // end namespace phoenix
