I=(S=Uno.Transform = function(){
}).prototype;

S.Identity = function()
{
    return Uno.Transform.$0(Uno.Float3.$1(0.0, 0.0, 0.0), Uno.Float4.$1(0.0, 0.0, 0.0, 1.0), Uno.Float3.$1(1.0, 1.0, 1.0));
};

I.Position = function()
{
    return this.position;
};

I.Rotation = function()
{
    return this.rotation;
};

I.Scaling = function()
{
    return this.scale;
};

I.Local = function(value)
{
    if (value !== undefined)
    {
        Uno.Matrix.Decompose(value, ref(function(){return this.$.scale}, function($){this.$.scale=$}, this), ref(function(){return this.$.rotation}, function($){this.$.rotation=$}, this), ref(function(){return this.$.position}, function($){this.$.position=$}, this));
    }

    else
    {
        return Uno.Matrix.Mul(Uno.Matrix.Mul(Uno.Matrix.Scaling(this.Scaling()), Uno.Matrix.RotationQuaternion(this.Rotation())), Uno.Matrix.Translation(this.Position()));
    }
};

I.Absolute = function()
{
    return (this.parent != null) ? Uno.Matrix.Mul(this.parent.Absolute(), this.Local()) : this.Local();
};

I.AbsolutePosition = function()
{
    return (this.parent != null) ? Uno.Float3.operator_Add(this.parent.AbsolutePosition(), this.position) : this.position;
};

S.$0 = function(pos, rot, scale, $this) {
    if (!$this) $this = new Uno.Transform;
    $this.position = pos;
    $this.rotation = rot;
    $this.scale = scale;
    $this.parent = null;
    return $this;
};
