Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_d3d_model_floor

(view raw script w/o annotations or w/e)
1
function d3d_model_floor(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8) //gml_Script_d3d_model_floor
2
{
3
    var __ind = argument0
4
    var __x1 = argument1
5
    var __y1 = argument2
6
    var __z1 = argument3
7
    var __x2 = argument4
8
    var __y2 = argument5
9
    var __z2 = argument6
10
    var __hrepeat = argument7
11
    var __vrepeat = argument8
12
    var __xdiff = __x2 - __x1
13
    var __zdiff = __z2 - __z1
14
    var __lsquared = __xdiff * __xdiff + __zdiff * __zdiff
15
    if (__lsquared == 0)
16
        return 0;
17
    var __l = sqrt(__lsquared)
18
    var __nx = (-__zdiff) / __l
19
    var __nz = __xdiff / __l
20
    d3d_model_primitive_begin(__ind, 6)
21
    d3d_model_vertex_normal_texture(__ind, __x1, __y1, __z1, __nx, 0, __nz, 0, 0)
22
    d3d_model_vertex_normal_texture(__ind, __x1, __y2, __z1, __nx, 0, __nz, 0, __vrepeat)
23
    d3d_model_vertex_normal_texture(__ind, __x2, __y2, __z2, __nx, 0, __nz, __hrepeat, __vrepeat)
24
    d3d_model_vertex_normal_texture(__ind, __x2, __y1, __z2, __nx, 0, __nz, __hrepeat, 0)
25
    d3d_model_primitive_end(__ind)
26
}