2023-05-19 10:24:58 +02:00
|
|
|
\documentclass{usiinfbachelorproject}
|
|
|
|
|
2023-05-28 10:10:28 +02:00
|
|
|
\usepackage[]{caption}
|
|
|
|
\usepackage[]{url}
|
|
|
|
\usepackage[]{subcaption}
|
|
|
|
\usepackage[]{float}
|
2023-06-13 13:44:11 +02:00
|
|
|
\usepackage[]{multicol}
|
2023-06-14 11:59:21 +02:00
|
|
|
\usepackage{mathtools}
|
2023-06-22 18:19:12 +02:00
|
|
|
\usepackage[]{listings}
|
2023-05-28 10:10:28 +02:00
|
|
|
|
|
|
|
\usepackage{tikz}
|
|
|
|
\usepackage{tkz-euclide}
|
2023-06-14 11:59:21 +02:00
|
|
|
\usetikzlibrary{external,shapes,through,arrows}
|
2023-05-28 10:10:28 +02:00
|
|
|
|
|
|
|
\tikzexternalize[prefix=figures/]
|
|
|
|
\tikzstyle{none}=[]
|
|
|
|
\input{./tikzs/styles.tikzstyles}
|
|
|
|
|
2023-06-14 11:59:21 +02:00
|
|
|
\tikzset{>=stealth}
|
|
|
|
|
2023-05-28 10:10:28 +02:00
|
|
|
\pgfdeclarelayer{nodelayer}
|
|
|
|
\pgfdeclarelayer{edgelayer}
|
|
|
|
\pgfsetlayers{edgelayer,nodelayer,main}
|
|
|
|
|
2023-06-22 18:19:12 +02:00
|
|
|
|
|
|
|
\lstset{language=C++,
|
|
|
|
basicstyle=\ttfamily,
|
|
|
|
keywordstyle=\color{blue}\ttfamily,
|
|
|
|
stringstyle=\color{red}\ttfamily,
|
|
|
|
commentstyle=\color{green}\ttfamily,
|
|
|
|
morecomment=[l][\color{magenta}]{\#},
|
|
|
|
emph={std, vector, vec2d, polygon, collision},
|
|
|
|
emphstyle=\color{orange}\ttfamily,
|
|
|
|
numbers=left,
|
|
|
|
morekeywords={uint},
|
|
|
|
numberstyle=\footnotesize,
|
|
|
|
numbersep=5pt,
|
|
|
|
frame=lines,
|
|
|
|
% breaklines=true,
|
|
|
|
% breaklines=true,
|
|
|
|
% postbreak=\raisebox{0ex}[0ex][0ex]{\space\ensuremath{\hookrightarrow}},
|
|
|
|
}
|
|
|
|
|
2023-05-28 10:10:28 +02:00
|
|
|
\graphicspath{{../figures/}{./figures/}}
|
|
|
|
|
2023-06-06 11:24:25 +02:00
|
|
|
\newcommand*{\vv}[1]{\overrightarrow{#1}}
|
2023-05-28 10:10:28 +02:00
|
|
|
\newcommand*{\figref}[1]{\figurename~\ref{#1}}
|
|
|
|
|
2023-05-19 10:24:58 +02:00
|
|
|
\captionsetup{labelfont={bf}}
|
2023-05-28 10:10:28 +02:00
|
|
|
\newcommand{\diff}{\mathop{}\!\mathrm{d}}
|
2023-05-19 10:24:58 +02:00
|
|
|
|
|
|
|
\author{Arnaud Fauconnet}
|
|
|
|
|
2023-05-28 10:10:28 +02:00
|
|
|
\title{From Flying Balls to Colliding Polygons}
|
2023-05-19 10:24:58 +02:00
|
|
|
\subtitle{2D Physics Engine: Rigid Body Simulation}
|
|
|
|
\versiondate{\today}
|
|
|
|
|
|
|
|
\begin{committee}
|
|
|
|
\advisor[Universit\`a della Svizzera Italiana,
|
|
|
|
Switzerland]{Prof.}{Antonio}{Carzaniga}
|
|
|
|
\end{committee}
|
|
|
|
|
2023-05-28 10:10:28 +02:00
|
|
|
\newcommand{\inputtikz}[2][1]{
|
|
|
|
\resizebox{#1 \textwidth}{!}{
|
|
|
|
\tikzsetnextfilename{#2}
|
|
|
|
\input{../tikzs/#2.tikz}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-02 12:08:41 +02:00
|
|
|
\abstract {Physics engines are a fun and interesting way to learn
|
|
|
|
about a the laws of physics, as well as computer science. They
|
|
|
|
provide a real-time simulation of common physical phenomena, and
|
|
|
|
therefore illustrate theoretical concepts such as the equations that
|
|
|
|
dictate the motion of objects, The goal of this project was to
|
|
|
|
extend an existing physics engine built for demonstration purposes.
|
|
|
|
This engine was initially designed and developed to simulate
|
|
|
|
circular objects (``balls'') in 2D. With this project, we intended
|
|
|
|
to extend this engine to also simulate arbitrary polygons, again in
|
|
|
|
a physically accurate way. The main technical challenges of the
|
|
|
|
project is therefore the correct simulation of the dynamics of
|
|
|
|
rigid, polygonal objects. In particular, we developed a model of
|
|
|
|
polygonal rigid objects; we implemented a simulation of their
|
|
|
|
inertial motion, possibly in the presence of a constant force field
|
|
|
|
such as gravity; we detect collisions between objects; we compute
|
|
|
|
and then simulate the dynamic effects of collisions. The
|
|
|
|
simulations are animated and displayed in real-time. It is also
|
|
|
|
therefore crucial that the simulation code be efficient to obtain
|
|
|
|
smooth animations.}
|
2023-05-19 10:24:58 +02:00
|
|
|
|
2023-06-13 13:44:11 +02:00
|
|
|
\counterwithin{figure}{section}
|
|
|
|
\counterwithin{equation}{section}
|
2023-05-19 10:24:58 +02:00
|
|
|
|
|
|
|
\usepackage{subfiles} % Best loaded last in the preamble
|
|
|
|
|
|
|
|
\begin{document}
|
|
|
|
\maketitle
|
|
|
|
\tableofcontents
|
2023-05-28 10:14:47 +02:00
|
|
|
\newpage
|
2023-05-19 10:24:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
\subfile{./sections/intro.tex}
|
2023-05-28 10:14:47 +02:00
|
|
|
\newpage
|
2023-05-19 10:24:58 +02:00
|
|
|
\subfile{./sections/tech_background.tex}
|
2023-05-28 10:14:47 +02:00
|
|
|
\newpage
|
2023-05-19 10:24:58 +02:00
|
|
|
\subfile{./sections/theoretical_background.tex}
|
2023-05-28 10:14:47 +02:00
|
|
|
\newpage
|
2023-06-13 22:56:32 +02:00
|
|
|
\subfile{./sections/implementation.tex}
|
2023-05-28 10:14:47 +02:00
|
|
|
\newpage
|
2023-05-19 10:24:58 +02:00
|
|
|
\subfile{./sections/conclusion.tex}
|
2023-05-28 10:14:47 +02:00
|
|
|
\newpage
|
2023-05-19 10:24:58 +02:00
|
|
|
|
|
|
|
%%%%%
|
2023-05-28 10:14:47 +02:00
|
|
|
\bibliographystyle{unsrt}
|
2023-05-19 10:24:58 +02:00
|
|
|
\bibliography{references}
|
2023-05-28 10:14:47 +02:00
|
|
|
\newpage
|
|
|
|
\subfile{./sections/appendix.tex}
|
2023-05-19 10:24:58 +02:00
|
|
|
|
|
|
|
\end{document}
|