This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/util/coly2d/hittest.h

54 lines
943 B
C
Raw Permalink Normal View History

#pragma once
#include <stdbool.h>
#include "util/math/vector.h"
bool
coly2d_hittest_point_and_rect(
const vec2_t* pos1,
const vec2_t* pos2,
const vec2_t* size2
);
bool
coly2d_hittest_point_and_triangle(
const vec2_t* pos1,
const vec2_t* pos2_a,
const vec2_t* pos2_b,
const vec2_t* pos2_c
);
bool
coly2d_hittest_lineseg_and_lineseg(
const vec2_t* pos1_st,
const vec2_t* pos1_ed,
const vec2_t* pos2_st,
const vec2_t* pos2_ed
);
bool
coly2d_hittest_lineseg_and_rect(
const vec2_t* pos1_st,
const vec2_t* pos1_ed,
const vec2_t* pos2,
const vec2_t* size2
);
bool
coly2d_hittest_lineseg_and_ellipse(
const vec2_t* pos1_st,
const vec2_t* pos1_ed,
const vec2_t* pos2,
const vec2_t* size2
);
bool
coly2d_hittest_lineseg_and_triangle(
const vec2_t* pos1_st,
const vec2_t* pos1_ed,
const vec2_t* pos2_a,
const vec2_t* pos2_b,
const vec2_t* pos2_c
);