Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_d3d_model_wall

(view raw script w/o annotations or w/e)
1
function d3d_model_wall(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8) //gml_Script_d3d_model_wall
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 __ydiff = __y2 - __y1
14
    var __lsquared = __xdiff * __xdiff + __ydiff * __ydiff
15
    if (__lsquared == 0)
16
        return 0;
17
    var __l = sqrt(__lsquared)
18
    var __nx = __ydiff / __l
19
    var __ny = (-__xdiff) / __l
20
    d3d_model_primitive_begin(__ind, 6)
21
    d3d_model_vertex_normal_texture(__ind, __x1, __y1, __z1, __nx, __ny, 0, 0, 0)
22
    d3d_model_vertex_normal_texture(__ind, __x2, __y2, __z1, __nx, __ny, 0, __hrepeat, 0)
23
    d3d_model_vertex_normal_texture(__ind, __x2, __y2, __z2, __nx, __ny, 0, __hrepeat, __vrepeat)
24
    d3d_model_vertex_normal_texture(__ind, __x1, __y1, __z2, __nx, __ny, 0, 0, __vrepeat)
25
    d3d_model_primitive_end(__ind)
26
}