2023-08-22 20:10:09 +02:00
|
|
|
function __3dPlane() : __3dObject() constructor {
|
|
|
|
VF = global.VF_POS_NORM_TEX_COL;
|
|
|
|
render_type = pr_trianglelist;
|
|
|
|
|
2023-08-23 20:01:09 +02:00
|
|
|
self.side = 0.5;
|
|
|
|
self.normal = 0;
|
2023-08-22 20:10:09 +02:00
|
|
|
|
2023-08-23 20:01:09 +02:00
|
|
|
static initModel = function() {
|
|
|
|
var _nor = [ 0, 0, 1 ];
|
|
|
|
switch(normal) {
|
|
|
|
case 0 :
|
|
|
|
vertex = [[
|
2023-08-29 14:33:44 +02:00
|
|
|
new __vertex(0, -side, -side).setNormal(1, 0, 0).setUV(0, 0),
|
|
|
|
new __vertex(0, side, side).setNormal(1, 0, 0).setUV(1, 1),
|
|
|
|
new __vertex(0, side, -side).setNormal(1, 0, 0).setUV(1, 0),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-08-29 14:33:44 +02:00
|
|
|
new __vertex(0, -side, -side).setNormal(1, 0, 0).setUV(0, 0),
|
|
|
|
new __vertex(0, -side, side).setNormal(1, 0, 0).setUV(0, 1),
|
|
|
|
new __vertex(0, side, side).setNormal(1, 0, 0).setUV(1, 1),
|
2023-08-23 20:01:09 +02:00
|
|
|
]];
|
|
|
|
break;
|
|
|
|
case 1 :
|
|
|
|
vertex = [[
|
2023-08-29 14:33:44 +02:00
|
|
|
new __vertex(-side, 0, -side).setNormal(0, 1, 0).setUV(0, 0),
|
|
|
|
new __vertex( side, 0, -side).setNormal(0, 1, 0).setUV(1, 0),
|
|
|
|
new __vertex( side, 0, side).setNormal(0, 1, 0).setUV(1, 1),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-08-29 14:33:44 +02:00
|
|
|
new __vertex(-side, 0, -side).setNormal(0, 1, 0).setUV(0, 0),
|
|
|
|
new __vertex( side, 0, side).setNormal(0, 1, 0).setUV(1, 1),
|
|
|
|
new __vertex(-side, 0, side).setNormal(0, 1, 0).setUV(0, 1),
|
2023-08-23 20:01:09 +02:00
|
|
|
]];
|
|
|
|
break;
|
|
|
|
case 2 :
|
|
|
|
vertex = [[
|
2023-08-29 14:33:44 +02:00
|
|
|
new __vertex(-side, -side, 0).setNormal(0, 0, 1).setUV(0, 0),
|
|
|
|
new __vertex( side, side, 0).setNormal(0, 0, 1).setUV(1, 1),
|
|
|
|
new __vertex( side, -side, 0).setNormal(0, 0, 1).setUV(1, 0),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-08-29 14:33:44 +02:00
|
|
|
new __vertex(-side, -side, 0).setNormal(0, 0, 1).setUV(0, 0),
|
|
|
|
new __vertex(-side, side, 0).setNormal(0, 0, 1).setUV(0, 1),
|
|
|
|
new __vertex( side, side, 0).setNormal(0, 0, 1).setUV(1, 1),
|
2023-08-23 20:01:09 +02:00
|
|
|
]];
|
|
|
|
break;
|
|
|
|
}
|
2023-08-22 20:10:09 +02:00
|
|
|
|
|
|
|
VB = build();
|
2023-08-23 20:01:09 +02:00
|
|
|
} initModel();
|
|
|
|
|
|
|
|
onParameterUpdate = initModel;
|
2023-08-22 20:10:09 +02:00
|
|
|
}
|