<commit_before>local class = require 'middleclass'


local Matrix4 = class('core/Matrix4')

function Matrix4:initialize( handle )
    if handle then
        self.handle = handle
    else
        self.handle = NATIVE.CreateMatrix4()
    end
end

function Matrix4:copy()
    return Matrix4.new(NATIVE.CopyMatrix4(self.handle))
end

function Matrix4:__add( other )
    return Matrix4.new(NATIVE.AddMatrix4(self, other))
end

function Matrix4:__sub( other )
    return Matrix4.new(NATIVE.SubMatrix4(self, other))
end

function Matrix4:__mul( other )
    return Matrix4.new(NATIVE.MulMatrix4(self, other))
end

function Matrix4:__div( other )
    return Matrix4.new(NATIVE.DivMatrix4(self, other))
end

function Matrix4:translate( x, y, z )
    return Matrix4.new(NATIVE.TranslateMatrix4(self.handle, x, y, z))
end

function Matrix4:scale( x, y, z )
    return Matrix4.new(NATIVE.ScaleMatrix4(self.handle, x, y, z))
end

function Matrix4:rotate( angle, x, y, z )
    return Matrix4.new(NATIVE.RotateMatrix4(self.handle, angle, x, y, z))
end

function Matrix4:transform( x, y, z, w )
    w = w or 0
    return NATIVE.Matrix4TransformVector(self.handle, x, y, z, w)
end

function Matrix4:toRotationMatrix()
    return Matrix4.new(NATIVE.MakeRotationMatrix(self.handle))
end


return Matrix4
<commit_msg>Fixed Matrix4 class.<commit_after>local class = require 'middleclass'


local Matrix4 = class('core/Matrix4')

function Matrix4:initialize( handle )
    self.handle = handle or NATIVE.CreateMatrix4()
end

function Matrix4:copy()
    return Matrix4:new(NATIVE.CopyMatrix4(self.handle))
end

function Matrix4:__add( other )
    return Matrix4:new(NATIVE.AddMatrix4(self, other))
end

function Matrix4:__sub( other )
    return Matrix4:new(NATIVE.SubMatrix4(self, other))
end

function Matrix4:__mul( other )
    return Matrix4:new(NATIVE.MulMatrix4(self, other))
end

function Matrix4:__div( other )
    return Matrix4:new(NATIVE.DivMatrix4(self, other))
end

function Matrix4:translate( x, y, z )
    return Matrix4:new(NATIVE.TranslateMatrix4(self.handle, x, y, z))
end

function Matrix4:scale( x, y, z )
    return Matrix4:new(NATIVE.ScaleMatrix4(self.handle, x, y, z))
end

function Matrix4:rotate( angle, x, y, z )
    return Matrix4:new(NATIVE.RotateMatrix4(self.handle, angle, x, y, z))
end

function Matrix4:transform( x, y, z, w )
    w = w or 0
    return NATIVE.Matrix4TransformVector(self.handle, x, y, z, w)
end

function Matrix4:toRotationMatrix()
    return Matrix4:new(NATIVE.MakeRotationMatrix(self.handle))
end


return Matrix4

{'fraction_non_alphanumeric': 0.11299212598425197, 'fraction_numerical': 0.02716535433070866, 'mean_word_length': 4.671875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6911664', 'n_tokens_mistral': 900, 'n_tokens_neox': 875, 'n_words': 221}