model collision demo

This commit is contained in:
Zack Buhman 2025-04-15 15:11:37 -05:00
parent e053b9646f
commit 71021e3388
6 changed files with 1238 additions and 85 deletions

View File

@ -9,6 +9,8 @@ DEBUG = -g -gdwarf-5
CFLAGS += -Wall -Werror -Wfatal-errors
CFLAGS += -Wno-error=unused-function
CFLAGS += -Wno-error=unused-but-set-variable
CFLAGS += -Wno-error=unused-variable
CFLAGS += -std=c++23
CFLAGS += -I$(SDL)/include -D_REENTRANT
CFLAGS += $(shell pkg-config --cflags freetype2)

27
line_intersection.cpp Normal file
View File

@ -0,0 +1,27 @@
vec2 line_intersection(vec2 a1, vec2 a2,
vec2 b1, vec2 b2)
{
float x1 = a1.x;
float y1 = a1.y;
float x2 = a2.x;
float y2 = a2.y;
float x3 = b1.x;
float y3 = b1.y;
float x4 = b2.x;
float y4 = b2.y;
float x1x2 = x1 - x2;
float x1x3 = x1 - x3;
float x3x4 = x3 - x4;
float y1y2 = y1 - y2;
float y1y3 = y1 - y3;
float y3y4 = y3 - y4;
float div = 1.0f / (x1x2 * y3y4 - y1y2 * x3x4);
float t = (x1x3 * y3y4 - y1y3 * x3x4) * div;
float u = (x1x2 * y1y3 - y1y2 * x1x3) * div;
return {t, u};
}

249
main.cpp
View File

@ -25,7 +25,11 @@ using vec4 = vec<4, float>;
using mat3x3 = mat<3, 3, float>;
using mat4x4 = mat<4, 4, float>;
#include "cube.hpp"
using vertex_position = vec<3, float>;
using vertex_normal = vec<3, float>;
using vertex_texture = vec<2, float>;
#include "model_collision.h"
struct glyph {
int32_t width;
@ -169,7 +173,7 @@ int32_t render_text(SDL_Renderer * renderer, int32_t x, int32_t y, const char *
return x_advance;
}
struct line {
struct line3 {
vec3 a;
vec3 b;
};
@ -177,7 +181,7 @@ struct line {
constexpr int num_lines = 5;
struct state {
struct line line[num_lines];
struct line3 line[num_lines];
vec3 normal;
vec3 mouse_position;
};
@ -194,7 +198,7 @@ struct state state = {
};
struct edge_normal {
struct line edge;
struct line3 edge;
vec3 normal;
};
@ -232,38 +236,14 @@ static inline int min(int a, int b)
const float deg = 0.017453292519943295;
float deg45 = 0.7853981633974483;
static float vtheta = 0;
static float vtheta = 0.5;
vec3 transform_vertex(vec3 v, float scale)
mat4x4 trans;
vec3 screen_transform_vertex(vec3 v)
{
float dim = ((float)min(window_height, window_width)) / 2.0f;
v = v * scale;
mat3x3 rot1 = {
cos(vtheta), -sin(vtheta), 0,
sin(vtheta), cos(vtheta), 0,
0, 0, 1,
};
mat3x3 rot2 = {
1, 0, 0,
0, cos(deg45), -sin(deg45),
0, sin(deg45), cos(deg45),
};
mat3x3 rot3 = {
cos(-deg45), 0, sin(-deg45),
0, 1, 0,
sin(-deg45), 0, cos(-deg45),
};
(void)rot1; (void)rot2; (void)rot3;
v = rot1 * v;
//v = rot3 * v;
v = rot2 * v;
//
return {
v.x * dim + window_width / 2.0f,
v.y * dim + window_height / 2.0f,
@ -271,6 +251,19 @@ vec3 transform_vertex(vec3 v, float scale)
};
}
vec3 _transform_vertex(vec3 v, float w)
{
vec4 v4 = {v.x, v.y, v.z, w};
vec4 v4t = trans * v4;
return {v4t.x, v4t.y, v4t.z};
}
vec3 transform_vertex(vec3 v, float scale)
{
return screen_transform_vertex(_transform_vertex(v * scale, 1.0f));
}
vec3 inverse_transform(float x, float y)
{
float dim = ((float)min(window_height, window_width)) / 2.0f;
@ -283,7 +276,7 @@ vec3 inverse_transform(float x, float y)
};
}
struct line transform_line(struct line line, float scale)
struct line3 transform_line(struct line3 line, float scale)
{
return {
transform_vertex(line.a, scale),
@ -291,7 +284,7 @@ struct line transform_line(struct line line, float scale)
};
}
static inline void render_line(SDL_Renderer * renderer, struct line line)
static inline void render_line(SDL_Renderer * renderer, struct line3 line)
{
assert(SDL_RenderLine(renderer, line.a.x, line.a.y, line.b.x, line.b.y));
}
@ -376,6 +369,16 @@ void set_edge_coloring(uint8_t * edge_coloring,
edge_coloring[ma * edge_stride + mb] |= bit;
}
mat4x4 translate(const vec3 v)
{
return (mat4x4){
1, 0, 0, v.x,
0, 1, 0, v.y,
0, 0, 1, v.z,
0, 0, 0, 1,
};
}
void render_quad(SDL_Renderer * renderer,
const vec3 * position,
const vec3 * normal,
@ -466,30 +469,6 @@ void render_silhouette(SDL_Renderer * renderer,
}
}
void render_cube(SDL_Renderer * renderer, const vec3 light_vec)
{
const int edge_stride = 8;
const int edge_coloring_length = edge_stride * edge_stride;
uint8_t edge_coloring[edge_coloring_length];
for (int i = 0; i < edge_coloring_length; i++)
edge_coloring[i] = 0;
for (int i = 0; i < 6; i++) {
render_quad(renderer,
cube_position,
cube_normal,
&cube_Cube_quadrilateral[i],
light_vec,
edge_coloring,
edge_stride);
}
render_silhouette(renderer,
cube_position,
edge_coloring,
edge_stride);
}
mat3x3 rotate_to(vec3 old_normal, vec3 new_normal)
{
vec3 s = cross(old_normal, new_normal);
@ -547,18 +526,18 @@ void render_lines(SDL_Renderer * renderer)
// line
assert(SDL_SetRenderDrawColorFloat(renderer, 1, 0.5, 0.5, 1));
for (int i = 0; i < num_lines; i++) {
struct line tl = transform_line(state.line[i], 1.0f);
struct line3 tl = transform_line(state.line[i], 1.0f);
render_line(renderer, tl);
}
// normal
assert(SDL_SetRenderDrawColorFloat(renderer, 1, 0, 0, 1));
struct line normal_line = {{0, 0, 0}, state.normal};
struct line3 normal_line = {{0, 0, 0}, state.normal};
render_line(renderer, transform_line(normal_line, 0.5f));
// mouse
assert(SDL_SetRenderDrawColorFloat(renderer, 0, 0, 1, 1));
struct line mouse_line = {{0, 0, 0}, state.mouse_position};
struct line3 mouse_line = {{0, 0, 0}, state.mouse_position};
render_line(renderer, transform_line(mouse_line, 0.5f));
// foo
@ -568,13 +547,13 @@ void render_lines(SDL_Renderer * renderer)
//vec4 nr4 = t * (vec4){state.normal.x, state.normal.y, state.normal.z, 0};
//vec3 nr = {nr.x, nr.y, nr.z};
assert(SDL_SetRenderDrawColorFloat(renderer, 0, 1, 0, 1));
struct line nr_line = {{0, 0, 0}, nr};
struct line3 nr_line = {{0, 0, 0}, nr};
render_line(renderer, transform_line(nr_line, 0.5f));
{
assert(SDL_SetRenderDrawColorFloat(renderer, 0.5, 1, 0.5, 1));
for (int i = 0; i < num_lines; i++) {
struct line l = state.line[i];
struct line3 l = state.line[i];
/*
vec4 a4 = t * l.a;
vec4 b4 = t * l.b;
@ -583,7 +562,7 @@ void render_lines(SDL_Renderer * renderer)
*/
vec3 a = t * l.a;
vec3 b = t * l.b;
struct line tl = {a, b};
struct line3 tl = {a, b};
render_line(renderer, transform_line(tl, 1.0f));
}
}
@ -605,6 +584,30 @@ void render_text_state(SDL_Renderer * renderer)
*/
}
bool collided[256] = {0};
void render_collision(SDL_Renderer * renderer)
{
const struct model * model = &haunted_mansion_collision_model;
const struct object * object = &haunted_mansion_collision_house_coll_display;
float scale = 1.f;
for (int i = 0; i < object->line_count; i++) {
const union line * line = &object->line[i];
if (collided[i])
SDL_SetRenderDrawColor(renderer, 255, 100, 100, 255);
else
SDL_SetRenderDrawColor(renderer, 100, 100, 255, 255);
render_line_vtx(renderer,
transform_vertex(model->position[line->a], scale),
transform_vertex(model->position[line->b], scale));
}
}
static float theta = 0;
void update_mouse_position()
@ -622,6 +625,70 @@ void update_mouse_position()
theta += deg;
}
vec2 line_intersection(vec2 a1, vec2 a2,
vec2 b1, vec2 b2)
{
float x1 = a1.x;
float y1 = a1.y;
float x2 = a2.x;
float y2 = a2.y;
float x3 = b1.x;
float y3 = b1.y;
float x4 = b2.x;
float y4 = b2.y;
float x1x2 = x1 - x2;
float x1x3 = x1 - x3;
float x3x4 = x3 - x4;
float y1y2 = y1 - y2;
float y1y3 = y1 - y3;
float y3y4 = y3 - y4;
float div = 1.0f / (x1x2 * y3y4 - y1y2 * x3x4);
float t = (x1x3 * y3y4 - y1y3 * x3x4) * div;
float u = -(x1x2 * y1y3 - y1y2 * x1x3) * div;
return {t, u};
}
bool line_has_collision(vec3 a1, vec3 a2)
{
const struct model * model = &haunted_mansion_collision_model;
const struct object * object = &haunted_mansion_collision_house_coll_display;
for (int i = 0; i < object->line_count; i++) {
const union line * line = &object->line[i];
vec3 b1 = _transform_vertex(model->position[line->a], 1.0f);
vec3 b2 = _transform_vertex(model->position[line->b], 1.0f);
vec2 tu = line_intersection({a1.x, a1.y},
{a2.x, a2.y},
{b1.x, b1.y},
{b2.x, b2.y});
if (tu.x >= 0.0f && tu.x <= 1.0f && tu.y >= 0.0f && tu.y <= 1.0f) {
collided[i] = true;
return true;
}
}
return false;
}
void move(SDL_Renderer * renderer, vec3 direction)
{
SDL_SetRenderDrawColor(renderer, 128, 255, 50, 255);
render_line_vtx(renderer,
screen_transform_vertex({0, 0, 0}),
screen_transform_vertex(-direction * 2.0f));
if (!line_has_collision({0, 0, 0}, -direction * 1.0f))
trans = translate(direction) * trans;
}
int main()
{
SDL_Window * window;
@ -661,21 +728,46 @@ int main()
int font_size = 25;
load_font(renderer, font_size);
trans = {
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
};
trans = trans * 0.2f;
mat4x4 rot1 = {
cos(deg45), -sin(deg45), 0, 0,
sin(deg45), cos(deg45), 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
};
mat4x4 rot2 = {
1, 0, 0, 0,
0, cos(deg45), -sin(deg45), 0,
0, sin(deg45), cos(deg45), 0,
0, 0, 0, 1,
};
mat4x4 rot3 = {
cos(-deg45), 0, sin(-deg45), 0,
0, 1, 0, 0,
sin(-deg45), 0, cos(-deg45), 0,
0, 0, 0, 1,
};
(void)rot1; (void)rot2; (void)rot3;
trans = rot2 * rot1 * trans;
while (1) {
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
bool success = SDL_GetWindowSizeInPixels(window, &window_width, &window_height);
assert(success == true);
vec3 light_vec = update_light(renderer);
render_text_state(renderer);
render_basis(renderer);
render_cube(renderer, light_vec);
while (SDL_GetTicks() - ticks < (1000 / 60)) { SDL_Delay(1); }
SDL_RenderPresent(renderer);
ticks = SDL_GetTicks();
render_collision(renderer);
SDL_Event event;
while (SDL_PollEvent(&event)) {
@ -685,6 +777,15 @@ int main()
case SDL_EVENT_KEY_DOWN:
if (event.key.key == SDLK_ESCAPE)
goto exit;
if (event.key.key == SDLK_LEFT)
move(renderer, {0.03, 0.0, 0.0});
if (event.key.key == SDLK_RIGHT)
move(renderer, {-0.03, 0.0, 0.0});
if (event.key.key == SDLK_UP)
move(renderer, {0.0, 0.03, 0.0});
if (event.key.key == SDLK_DOWN)
move(renderer, {0.0, -0.03, 0.0});
break;
case SDL_EVENT_MOUSE_BUTTON_DOWN:
if (event.button.button == 1) {
@ -698,8 +799,12 @@ int main()
}
}
while (SDL_GetTicks() - ticks < (1000 / 60)) { SDL_Delay(1); }
SDL_RenderPresent(renderer);
ticks = SDL_GetTicks();
//update_mouse_position();
vtheta += deg / 10;
//vtheta += deg / 10;
}
exit:

69
model.h Normal file
View File

@ -0,0 +1,69 @@
#pragma once
#include <stdint.h>
#include "math/vec3.hpp"
#include "math/vec2.hpp"
#ifdef __dreamcast__
using vertex_position = vec<3, float>;
using vertex_normal = vec<3, float>;
using vertex_texture = vec<2, float>;
#endif
#ifdef __saturn__
#include "math/fp.hpp"
using vertex_position = vec<3, fp16_16>;
using vertex_normal = vec<3, fp16_16>;
using vertex_texture = vec<2, fp16_16>;
#endif
struct index_ptn {
uint16_t position;
uint16_t texture;
uint16_t normal;
};
union triangle {
struct {
struct index_ptn a;
struct index_ptn b;
struct index_ptn c;
};
struct index_ptn v[3];
};
union quadrilateral {
struct {
struct index_ptn a;
struct index_ptn b;
struct index_ptn c;
struct index_ptn d;
};
struct index_ptn v[4];
};
union line {
struct {
int a;
int b;
};
int v[2];
};
struct object {
const union triangle * triangle;
const union quadrilateral * quadrilateral;
const union line * line;
const int triangle_count;
const int quadrilateral_count;
const int line_count;
const int material;
};
struct model {
const vertex_position * position;
const vertex_texture * texture;
const vertex_normal * normal;
const struct object ** object;
const int object_count;
};

View File

@ -5,22 +5,34 @@
#include "math/vec3.hpp"
#include "math/vec2.hpp"
typedef struct index_ptn {
#ifdef __dreamcast__
using vertex_position = vec<3, float>;
using vertex_normal = vec<3, float>;
using vertex_texture = vec<2, float>;
#endif
#ifdef __saturn__
#include "math/fp.hpp"
using vertex_position = vec<3, fp16_16>;
using vertex_normal = vec<3, fp16_16>;
using vertex_texture = vec<2, fp16_16>;
#endif
struct index_ptn {
uint16_t position;
uint16_t texture;
uint16_t normal;
} index_ptn;
};
typedef union triangle {
union triangle {
struct {
struct index_ptn a;
struct index_ptn b;
struct index_ptn c;
};
struct index_ptn v[3];
} triangle;
};
typedef union quadrilateral {
union quadrilateral {
struct {
struct index_ptn a;
struct index_ptn b;
@ -28,24 +40,30 @@ typedef union quadrilateral {
struct index_ptn d;
};
struct index_ptn v[4];
} quadrilateral;
};
using vertex_position = vec<3, float>;
using vertex_normal = vec<3, float>;
using vertex_texture = vec<2, float>;
union line {
struct {
int a;
int b;
};
int v[2];
};
typedef struct object {
struct object {
const union triangle * triangle;
const union quadrilateral * quadrilateral;
const union line * line;
const int triangle_count;
const int quadrilateral_count;
const int line_count;
const int material;
} object;
};
typedef struct model {
struct model {
const vertex_position * position;
const vertex_texture * texture;
const vertex_normal * normal;
const struct object ** object;
const int object_count;
} model;
};

932
model_collision.h Normal file
View File

@ -0,0 +1,932 @@
#pragma once
#include "model.hpp"
const vertex_position haunted_mansion_collision_position[] = {
{9.468655f, 18.171686f, -0.000001f},
{9.468655f, -11.468163f, -0.000001f},
{11.768676f, 6.959891f, -0.000001f},
{11.768676f, -0.458513f, -0.000001f},
{-1.959310f, 6.487949f, 0.000000f},
{-1.959310f, 6.959890f, 0.000000f},
{-1.959310f, 0.000950f, 0.000000f},
{-1.959310f, -0.458513f, 0.000000f},
{-0.034380f, -7.700261f, 0.000000f},
{-1.639923f, 6.684578f, 0.000000f},
{0.260841f, 1.695189f, -0.000000f},
{-1.639923f, -0.395491f, 0.000000f},
{4.497604f, 18.171686f, -0.000000f},
{4.497604f, 6.487949f, -0.000000f},
{4.497604f, 6.959890f, -0.000000f},
{4.497604f, 0.000950f, -0.000000f},
{4.497604f, -0.458513f, -0.000000f},
{4.178310f, 6.684578f, -0.000000f},
{2.417353f, 1.695189f, -0.000000f},
{9.468655f, -5.209778f, -0.000001f},
{-0.034380f, -6.403114f, 0.000000f},
{11.768676f, -4.928789f, -0.000001f},
{-1.959310f, -4.928789f, 0.000000f},
{-1.639923f, -4.928789f, 0.000000f},
{4.497604f, -4.928789f, -0.000000f},
{4.178310f, -4.928789f, -0.000000f},
{-5.530122f, 18.171686f, 0.000000f},
{-5.530122f, -11.468163f, 0.000000f},
{0.516239f, 4.961135f, -0.000000f},
{2.003563f, 4.961135f, -0.000000f},
{-5.530122f, -5.209778f, 0.000000f},
{0.286729f, -11.468163f, -0.000000f},
{0.286729f, -5.209778f, -0.000000f},
{-0.034380f, -11.468163f, 0.000000f},
{-3.538448f, -5.209778f, 0.000000f},
{-0.921080f, -5.209778f, 0.000000f},
{-4.641364f, -5.209778f, 0.000000f},
{11.768676f, 11.356500f, -0.000001f},
{-1.959310f, 11.356500f, 0.000000f},
{-1.639923f, 11.522879f, 0.000000f},
{4.497604f, 11.356500f, -0.000000f},
{4.178310f, 11.522879f, -0.000000f},
{0.516239f, 1.695189f, -0.000000f},
{0.516239f, -4.928789f, -0.000000f},
{2.003563f, -4.928789f, -0.000000f},
{2.003563f, 1.695189f, -0.000000f},
{2.614596f, 13.142808f, -0.000000f},
{-0.076209f, 13.142808f, 0.000000f},
{-12.607601f, 2.479054f, 0.000001f},
{-12.607601f, 4.197836f, 0.000001f},
{-12.349248f, 0.000951f, 0.000001f},
{-12.352005f, 6.487949f, 0.000001f},
{-12.583817f, 1.727151f, 0.000001f},
{-12.582272f, 4.799030f, 0.000001f},
{-12.174327f, 7.221593f, 0.000001f},
{-12.165005f, -0.753008f, 0.000001f},
{-7.615463f, 6.959890f, 0.000001f},
{-7.615463f, 11.356500f, 0.000001f},
{-7.615463f, 0.000951f, 0.000001f},
{-7.615463f, 6.487949f, 0.000001f},
{-7.615463f, -4.928789f, 0.000001f},
{-7.615463f, -0.458513f, 0.000001f},
{-7.615463f, 4.197836f, 0.000001f},
{-7.615463f, 2.479054f, 0.000001f},
{-1.959310f, 9.934581f, 0.000000f},
{-1.639923f, 9.934581f, 0.000000f},
{4.497604f, 9.934581f, -0.000000f},
{4.178310f, 9.934581f, -0.000000f},
{-1.639923f, -3.482409f, 0.000000f},
{-1.959310f, -1.987983f, 0.000000f},
{4.497604f, -1.987983f, -0.000000f},
{4.178310f, -3.482409f, -0.000000f},
{4.178310f, -1.987983f, -0.000000f},
{-1.959310f, -3.482409f, 0.000000f},
{4.497604f, -3.482409f, -0.000000f},
{-1.639923f, -1.987983f, 0.000000f},
{9.468655f, 11.693382f, -0.000001f},
{-1.959310f, 11.693382f, 0.000000f},
{2.614596f, 4.961135f, -0.000000f},
{4.497604f, 11.693382f, -0.000000f},
{-0.076209f, 4.961135f, 0.000000f},
{-5.530122f, 11.693382f, 0.000000f},
{4.178310f, -0.031970f, -0.000000f},
{-0.236704f, 4.799030f, 0.000000f},
{-0.236704f, 4.197837f, 0.000000f},
{-0.236704f, 2.479054f, 0.000000f},
{-0.236704f, 1.727151f, 0.000000f},
{0.516240f, 13.142808f, -0.000000f},
{2.003563f, 13.142808f, -0.000000f},
{2.676960f, 4.561967f, -0.000000f},
{2.676960f, 4.197836f, -0.000000f},
{2.676960f, 2.479054f, -0.000000f},
{2.676960f, 1.891271f, -0.000000f},
{-1.639923f, 10.952084f, 0.000000f},
{4.178310f, 10.952084f, -0.000000f},
{4.497604f, 10.950237f, -0.000000f},
{-1.959310f, 10.952084f, 0.000000f},
{12.588175f, 0.000950f, -0.000001f},
{12.588175f, 6.487949f, -0.000001f},
{14.280035f, 1.677614f, -0.000001f},
{14.280035f, 4.801496f, -0.000001f},
{0.516239f, 2.479054f, -0.000000f},
{0.516239f, 4.197837f, -0.000000f},
{2.003563f, 4.197837f, -0.000000f},
{2.003563f, 2.479054f, -0.000000f},
{-6.127061f, 6.487949f, 0.000000f},
{-6.127061f, -0.458513f, 0.000000f},
{-6.127060f, 6.959890f, 0.000000f},
{-6.127060f, 0.000951f, 0.000000f},
{-3.538448f, 6.487949f, 0.000000f},
{-3.538448f, 6.959890f, 0.000000f},
{-3.538448f, -0.458513f, 0.000000f},
{-3.538448f, 0.000951f, 0.000000f},
{-3.538448f, -4.928789f, 0.000000f},
{-3.538448f, 11.356500f, 0.000000f},
{-4.641364f, -4.928789f, 0.000000f},
{-4.641364f, 11.356500f, 0.000000f},
{2.003563f, -5.209778f, -0.000000f},
{0.516239f, -5.209778f, -0.000000f},
{7.522186f, -5.209778f, -0.000001f},
{6.182686f, -5.209778f, -0.000000f},
{0.286729f, -6.406253f, -0.000000f},
{0.286729f, -7.699028f, -0.000000f},
{7.522186f, -0.458513f, -0.000001f},
{7.522186f, 6.487949f, -0.000001f},
{7.522186f, 0.000950f, -0.000001f},
{7.522186f, 11.693382f, -0.000001f},
{7.522186f, 11.356500f, -0.000001f},
{7.522186f, -4.928789f, -0.000001f},
{7.522186f, 6.959890f, -0.000001f},
{6.182686f, -0.458513f, -0.000000f},
{6.182686f, -4.928789f, -0.000000f},
{6.182686f, 6.487949f, -0.000000f},
{6.182686f, 0.000950f, -0.000000f},
{6.182686f, 6.959890f, -0.000000f},
{6.182686f, 11.693382f, -0.000000f},
{6.182686f, 11.356500f, -0.000000f},
{4.497604f, 13.394125f, -0.000000f},
{-4.695820f, 11.693382f, 0.000000f},
{-3.505549f, 11.693382f, 0.000000f},
{-1.959310f, 16.679245f, 0.000000f},
{-1.959310f, 12.984167f, 0.000000f},
{2.003563f, 18.741804f, -0.000000f},
{0.516240f, 18.741804f, -0.000000f},
{-1.577724f, 21.941124f, 0.000000f},
{5.434333f, 21.941124f, -0.000000f},
{2.985128f, 12.758956f, -0.000000f},
{-0.446740f, 12.758956f, 0.000000f},
{3.867863f, 11.844486f, -0.000000f},
{-1.329476f, 11.844486f, 0.000000f},
{-1.959310f, 12.032170f, 0.000000f},
{-1.670803f, 12.032170f, 0.000000f},
{0.516240f, 13.474504f, -0.000000f},
{2.003563f, 13.474504f, -0.000000f},
{0.516240f, 16.687757f, -0.000000f},
{2.003563f, 16.687757f, -0.000000f},
{2.572726f, 13.474504f, -0.000000f},
{2.572726f, 16.687757f, -0.000000f},
{-0.081743f, 13.474504f, 0.000000f},
{-0.081743f, 16.687757f, 0.000000f},
{0.516240f, 17.029930f, -0.000000f},
{0.516240f, 18.182152f, -0.000000f},
{-0.391281f, 13.212752f, 0.000000f},
{-0.668785f, 12.984167f, 0.000000f},
{-0.391281f, 17.029930f, 0.000000f},
{-1.677333f, 16.679245f, 0.000000f},
{-1.677333f, 12.984167f, 0.000000f},
{4.154991f, 12.163081f, -0.000000f},
{4.497604f, 12.163081f, -0.000000f},
{2.985128f, 13.382598f, -0.000000f},
{5.434333f, 18.741804f, -0.000000f},
{-1.577724f, 18.741804f, 0.000000f},
{-0.921202f, -4.928789f, 0.000000f},
{-0.034380f, -4.928789f, 0.000000f},
{-8.584578f, 2.479054f, 0.000001f},
{-8.584578f, 4.197836f, 0.000001f},
{-8.584578f, 7.221593f, 0.000001f},
{-8.584578f, -0.753008f, 0.000001f},
};
const vertex_texture haunted_mansion_collision_texture[] = {
};
const vertex_normal haunted_mansion_collision_normal[] = {
};
const union triangle haunted_mansion_collision_house_coll_display_triangle[] = {
};
const union quadrilateral haunted_mansion_collision_house_coll_display_quadrilateral[] = {
};
const union line haunted_mansion_collision_house_coll_display_line[] = {
{
.a = 8,
.b = 122,
},
{
.a = 119,
.b = 128,
},
{
.a = 19,
.b = 119,
},
{
.a = 1,
.b = 19,
},
{
.a = 31,
.b = 122,
},
{
.a = 37,
.b = 127,
},
{
.a = 37,
.b = 2,
},
{
.a = 12,
.b = 137,
},
{
.a = 0,
.b = 12,
},
{
.a = 152,
.b = 158,
},
{
.a = 158,
.b = 159,
},
{
.a = 76,
.b = 126,
},
{
.a = 8,
.b = 33,
},
{
.a = 34,
.b = 35,
},
{
.a = 27,
.b = 33,
},
{
.a = 30,
.b = 36,
},
{
.a = 27,
.b = 30,
},
{
.a = 36,
.b = 115,
},
{
.a = 34,
.b = 113,
},
{
.a = 35,
.b = 172,
},
{
.a = 20,
.b = 173,
},
{
.a = 15,
.b = 133,
},
{
.a = 48,
.b = 49,
},
{
.a = 48,
.b = 52,
},
{
.a = 51,
.b = 53,
},
{
.a = 49,
.b = 53,
},
{
.a = 50,
.b = 52,
},
{
.a = 175,
.b = 176,
},
{
.a = 54,
.b = 176,
},
{
.a = 51,
.b = 54,
},
{
.a = 105,
.b = 107,
},
{
.a = 77,
.b = 139,
},
{
.a = 77,
.b = 150,
},
{
.a = 98,
.b = 100,
},
{
.a = 91,
.b = 92,
},
{
.a = 89,
.b = 90,
},
{
.a = 13,
.b = 89,
},
{
.a = 15,
.b = 92,
},
{
.a = 98,
.b = 124,
},
{
.a = 24,
.b = 74,
},
{
.a = 24,
.b = 131,
},
{
.a = 43,
.b = 173,
},
{
.a = 59,
.b = 105,
},
{
.a = 17,
.b = 78,
},
{
.a = 29,
.b = 78,
},
{
.a = 25,
.b = 44,
},
{
.a = 25,
.b = 71,
},
{
.a = 16,
.b = 70,
},
{
.a = 16,
.b = 130,
},
{
.a = 14,
.b = 66,
},
{
.a = 14,
.b = 134,
},
{
.a = 71,
.b = 74,
},
{
.a = 70,
.b = 72,
},
{
.a = 18,
.b = 45,
},
{
.a = 18,
.b = 82,
},
{
.a = 58,
.b = 63,
},
{
.a = 58,
.b = 108,
},
{
.a = 29,
.b = 103,
},
{
.a = 39,
.b = 93,
},
{
.a = 46,
.b = 146,
},
{
.a = 46,
.b = 88,
},
{
.a = 9,
.b = 65,
},
{
.a = 7,
.b = 69,
},
{
.a = 7,
.b = 111,
},
{
.a = 123,
.b = 125,
},
{
.a = 82,
.b = 72,
},
{
.a = 68,
.b = 73,
},
{
.a = 69,
.b = 75,
},
{
.a = 83,
.b = 84,
},
{
.a = 10,
.b = 42,
},
{
.a = 6,
.b = 86,
},
{
.a = 4,
.b = 83,
},
{
.a = 85,
.b = 86,
},
{
.a = 28,
.b = 102,
},
{
.a = 47,
.b = 87,
},
{
.a = 47,
.b = 147,
},
{
.a = 28,
.b = 80,
},
{
.a = 9,
.b = 80,
},
{
.a = 17,
.b = 67,
},
{
.a = 42,
.b = 101,
},
{
.a = 45,
.b = 104,
},
{
.a = 90,
.b = 103,
},
{
.a = 91,
.b = 104,
},
{
.a = 85,
.b = 101,
},
{
.a = 84,
.b = 102,
},
{
.a = 41,
.b = 94,
},
{
.a = 40,
.b = 136,
},
{
.a = 40,
.b = 95,
},
{
.a = 94,
.b = 95,
},
{
.a = 66,
.b = 67,
},
{
.a = 38,
.b = 96,
},
{
.a = 38,
.b = 114,
},
{
.a = 93,
.b = 96,
},
{
.a = 64,
.b = 65,
},
{
.a = 106,
.b = 108,
},
{
.a = 111,
.b = 112,
},
{
.a = 61,
.b = 106,
},
{
.a = 61,
.b = 60,
},
{
.a = 59,
.b = 62,
},
{
.a = 22,
.b = 113,
},
{
.a = 22,
.b = 73,
},
{
.a = 4,
.b = 109,
},
{
.a = 5,
.b = 110,
},
{
.a = 5,
.b = 64,
},
{
.a = 57,
.b = 116,
},
{
.a = 6,
.b = 112,
},
{
.a = 60,
.b = 115,
},
{
.a = 109,
.b = 110,
},
{
.a = 97,
.b = 125,
},
{
.a = 97,
.b = 99,
},
{
.a = 99,
.b = 100,
},
{
.a = 31,
.b = 1,
},
{
.a = 43,
.b = 118,
},
{
.a = 44,
.b = 117,
},
{
.a = 117,
.b = 120,
},
{
.a = 32,
.b = 118,
},
{
.a = 32,
.b = 121,
},
{
.a = 20,
.b = 121,
},
{
.a = 21,
.b = 128,
},
{
.a = 2,
.b = 129,
},
{
.a = 3,
.b = 123,
},
{
.a = 56,
.b = 57,
},
{
.a = 56,
.b = 107,
},
{
.a = 3,
.b = 21,
},
{
.a = 162,
.b = 164,
},
{
.a = 126,
.b = 127,
},
{
.a = 135,
.b = 136,
},
{
.a = 124,
.b = 129,
},
{
.a = 132,
.b = 134,
},
{
.a = 13,
.b = 132,
},
{
.a = 130,
.b = 133,
},
{
.a = 120,
.b = 131,
},
{
.a = 81,
.b = 138,
},
{
.a = 140,
.b = 141,
},
{
.a = 114,
.b = 139,
},
{
.a = 116,
.b = 138,
},
{
.a = 143,
.b = 161,
},
{
.a = 145,
.b = 170,
},
{
.a = 142,
.b = 170,
},
{
.a = 153,
.b = 156,
},
{
.a = 156,
.b = 157,
},
{
.a = 155,
.b = 157,
},
{
.a = 41,
.b = 148,
},
{
.a = 39,
.b = 149,
},
{
.a = 149,
.b = 151,
},
{
.a = 147,
.b = 163,
},
{
.a = 26,
.b = 81,
},
{
.a = 141,
.b = 166,
},
{
.a = 150,
.b = 151,
},
{
.a = 87,
.b = 152,
},
{
.a = 88,
.b = 153,
},
{
.a = 154,
.b = 160,
},
{
.a = 142,
.b = 155,
},
{
.a = 162,
.b = 163,
},
{
.a = 165,
.b = 166,
},
{
.a = 160,
.b = 164,
},
{
.a = 140,
.b = 165,
},
{
.a = 26,
.b = 161,
},
{
.a = 79,
.b = 135,
},
{
.a = 79,
.b = 168,
},
{
.a = 0,
.b = 76,
},
{
.a = 167,
.b = 168,
},
{
.a = 148,
.b = 167,
},
{
.a = 146,
.b = 169,
},
{
.a = 137,
.b = 169,
},
{
.a = 144,
.b = 145,
},
{
.a = 144,
.b = 171,
},
{
.a = 143,
.b = 171,
},
{
.a = 154,
.b = 159,
},
{
.a = 11,
.b = 10,
},
{
.a = 11,
.b = 75,
},
{
.a = 23,
.b = 68,
},
{
.a = 23,
.b = 172,
},
{
.a = 62,
.b = 175,
},
{
.a = 63,
.b = 174,
},
{
.a = 50,
.b = 55,
},
{
.a = 55,
.b = 177,
},
{
.a = 174,
.b = 177,
},
};
const struct object haunted_mansion_collision_house_coll_display = {
.triangle = &haunted_mansion_collision_house_coll_display_triangle[0],
.quadrilateral = &haunted_mansion_collision_house_coll_display_quadrilateral[0],
.line = &haunted_mansion_collision_house_coll_display_line[0],
.triangle_count = 0,
.quadrilateral_count = 0,
.line_count = 178,
.material = 0,
};
const struct object * haunted_mansion_collision_object[] = {
&haunted_mansion_collision_house_coll_display,
};
const struct model haunted_mansion_collision_model = {
.position = haunted_mansion_collision_position,
.texture = haunted_mansion_collision_texture,
.normal = haunted_mansion_collision_normal,
.object = haunted_mansion_collision_object,
.object_count = 1
};