An outline of all sections included in this SRS is recorded here for easy reference.
This section records information for easy reference.
The unit system used throughout is SI (Système International d'Unités). In addition to the basic units, several derived units are also used. For each unit, the Table of Units lists the symbol, a description, and the SI name.
Symbol | Description | SI Name |
---|---|---|
J | energy | joule |
kg | mass | kilogram |
m | length | metre |
N | force | newton |
rad | angle | radian |
s | time | second |
The symbols used in this document are summarized in the Table of Symbols along with their units. Throughout the document, symbols in bold will represent vectors, and scalars otherwise. The symbols are listed in alphabetical order. For vector quantities, the units shown are for each component of the vector.
Symbol | Description | Units |
---|---|---|
a(t) | Linear acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
a(t) | Acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
a(t)j | J-Th Body's Acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
CR | Coefficient of restitution | -- |
dj | Distance Between the J-Th Particle and the Axis of Rotation | m |
d | Distance between the center of mass of the rigid bodies | m |
d̂ | Unit vector directed from the center of the large mass to the center of the smaller mass | m |
||d|| | Euclidean norm of the distance between the center of mass of two bodies | m |
||d||2 | Squared distance | m2 |
F | Force | N |
F1 | Force exerted by the first body (on another body) | N |
F2 | Force exerted by the second body (on another body) | N |
Fg | Force of gravity | N |
Fj | Force Applied to the J-Th Body at Time T | N |
G | Gravitational constant | \(\frac{\text{m}^{3}}{\text{kg}\text{s}^{2}}\) |
g | Gravitational acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
h | Height | m |
I | Moment of inertia | kgm2 |
IA | Moment of Inertia of Rigid Body A | kgm2 |
IB | Moment of Inertia of Rigid Body B | kgm2 |
J | Impulse (vector) | Ns |
j | Impulse (scalar) | Ns |
KE | Kinetic energy | J |
L | Length | m |
M | Mass of the Larger Rigid Body | kg |
m | Mass | kg |
m1 | Mass of the first body | kg |
m2 | Mass of the second body | kg |
mA | Mass of Rigid Body A | kg |
mB | Mass of Rigid Body B | kg |
mj | Mass of the J-Th Particle | kg |
mT | Total Mass of the Rigid Body | kg |
n | Collision normal vector | m |
||n|| | Length of the normal vector | m |
PE | Potential energy | J |
p(t) | Position | m |
p(t)CM | Center of Mass | m |
p(t)j | Position Vector of the J-Th Particle | m |
r | Position vector | m |
t | Time | s |
tc | Denotes the time at collision | s |
u(t) | Linear displacement | m |
u | Displacement | m |
||uAP*n|| | Length of the Perpendicular Vector to the Contact Displacement Vector of Rigid Body A | m |
||uBP*n|| | Length of the Perpendicular Vector to the Contact Displacement Vector of Rigid Body B | m |
uOB | Displacement vector between the origin and point B | m |
v(t) | Linear velocity | \(\frac{\text{m}}{\text{s}}\) |
v(t) | Velocity | \(\frac{\text{m}}{\text{s}}\) |
Δv | Change in velocity | \(\frac{\text{m}}{\text{s}}\) |
v(t)AP | Velocity of the Point of Collision P in Body A | \(\frac{\text{m}}{\text{s}}\) |
v(t)BP | Velocity of the Point of Collision P in Body B | \(\frac{\text{m}}{\text{s}}\) |
v(t)1 | Velocity of the First Body | \(\frac{\text{m}}{\text{s}}\) |
v(t)2 | Velocity of the Second Body | \(\frac{\text{m}}{\text{s}}\) |
v(t)A | Velocity at Point A | \(\frac{\text{m}}{\text{s}}\) |
v(t)B | Velocity at Point B | \(\frac{\text{m}}{\text{s}}\) |
v(t)fAB | Final Relative Velocity Between Rigid Bodies of A and B | \(\frac{\text{m}}{\text{s}}\) |
v(t)iAB | Initial Relative Velocity Between Rigid Bodies of A and B | \(\frac{\text{m}}{\text{s}}\) |
v(t)j | Velocity of the J-Th Body | \(\frac{\text{m}}{\text{s}}\) |
v(t)O | Velocity at Point Origin | \(\frac{\text{m}}{\text{s}}\) |
α | Angular acceleration | \(\frac{\text{rad}}{\text{s}^{2}}\) |
αj | J-Th Body's Angular Acceleration | \(\frac{\text{rad}}{\text{s}^{2}}\) |
θ | Angular displacement | rad |
τ | Torque | Nm |
τj | Torque applied to the j-th body | Nm |
ω | Angular velocity | \(\frac{\text{rad}}{\text{s}}\) |
ϕ | Orientation | rad |
Abbreviation | Full Form |
---|---|
2D | Two-Dimensional |
3D | Three-Dimensional |
A | Assumption |
CM | Centre of Mass |
DD | Data Definition |
GD | General Definition |
GS | Goal Statement |
IM | Instance Model |
LC | Likely Change |
ODE | Ordinary Differential Equation |
R | Requirement |
RefBy | Referenced by |
Refname | Reference Name |
SRS | Software Requirements Specification |
TM | Theoretical Model |
UC | Unlikely Change |
Uncert. | Typical Uncertainty |
Due to the rising cost of developing video games, developers are looking for ways to save time and money for their projects. Using an open source physics library that is reliable and free will cut down development costs and lead to better quality products.
The following section provides an overview of the Software Requirements Specification (SRS) for GamePhysics. This section explains the purpose of this document, the scope of the requirements, the characteristics of the intended reader, and the organization of the document.
The primary purpose of this document is to record the requirements of GamePhysics. Goals, assumptions, theoretical models, definitions, and other model derivation information are specified, allowing the reader to fully understand and verify the purpose and scientific basis of GamePhysics. With the exception of system constraints, this SRS will remain abstract, describing what problem is being solved, but not how to solve it.
This document will be used as a starting point for subsequent development phases, including writing the design specification and the software verification and validation plan. The design document will show how the requirements are to be realized, including decisions on the numerical algorithms and programming environment. The verification and validation plan will show the steps that will be used to increase confidence in the software documentation and the implementation. Although the SRS fits in a series of documents that follow the so-called waterfall model, the actual development process is not constrained in any way. Even when the waterfall model is not followed, as Parnas and Clements point out parnasClements1986, the most logical way to present the documentation is still to "fake" a rational design process.
The scope of the requirements includes the physical simulation of 2D rigid bodies acted on by forces.
Reviewers of this documentation should have an understanding of rigid body dynamics and high school calculus. The users of GamePhysics can have a lower level of expertise, as explained in Sec:User Characteristics.
The organization of this document follows the template for an SRS for scientific computing software proposed by koothoor2013, smithLai2005, smithEtAl2007, and smithKoothoor2016. The presentation follows the standard pattern of presenting goals, theories, definitions, and assumptions. For readers that would like a more bottom up approach, they can start reading the instance models and trace back to find any additional information they require.
The goal statements are refined to the theoretical models and the theoretical models to the instance models.
This section provides general information about the system. It identifies the interfaces between the system and its environment, describes the user characteristics, and lists the system constraints.
Fig:sysCtxDiag shows the system context. A circle represents an entity external to the software, the user in this case. A rectangle represents the software system itself (GamePhysics). Arrows are used to show the data flow between the system and its environment.
The interaction between the product and the user is through an application programming interface. The responsibilities of the user and the system are as follows:
The end user of GamePhysics should have an understanding of first year programming concepts and an understanding of high school physics.
There are no system constraints.
This section first presents the problem description, which gives a high-level view of the problem to be solved. This is followed by the solution characteristics specification, which presents the assumptions, theories, and definitions that are used.
A system is needed to simulate 2D rigid body physics for use in game development in a simple, lightweight, fast, and portable manner, which will allow for the production of higher quality products. Creating a gaming physics library is a difficult task. Games need physics libraries that simulate objects acting under various physical conditions, while simultaneously being fast and efficient enough to work in soft real-time during the game. Developing a physics library from scratch takes a long period of time and is very costly, presenting barriers of entry which make it difficult for game developers to include physics in their products. There are a few free, open source and high quality physics libraries available to be used for consumer products.
This subsection provides a list of terms that are used in the subsequent sections and their meaning, with the purpose of reducing ambiguity and making it easier to correctly understand the requirements.
Given the kinematic properties, and forces (including any collision forces) applied on a set of rigid bodies, the goal statements are:
The instance models that govern GamePhysics are presented in the Instance Model Section. The information to understand the meaning of the instance models and their derivation is also presented, so that the instance models can be verified.
This section simplifies the original problem and helps in developing the theoretical models by filling in the missing information for the physical system. The assumptions refine the scope by providing more detail.
This section focuses on the general equations and laws that GamePhysics is based on.
Refname | TM:NewtonSecLawMot |
---|---|
Label | Newton's second law of motion |
Equation | \[\symbf{F}=m \symbf{a}\text{(}t\text{)}\] |
Description | |
Notes |
The net force F on a body is proportional to the acceleration a(t) of the body, where m denotes the mass of the body as the constant of proportionality. |
Source | -- |
RefBy |
Refname | TM:NewtonThirdLawMot |
---|---|
Label | Newton's third law of motion |
Equation | \[{\symbf{F}_{1}}=-{\symbf{F}_{2}}\] |
Description | |
Notes |
Every action has an equal and opposite reaction. In other words, the force F1 exerted on the second rigid body by the first is equal in magnitude and in the opposite direction to the force F2 exerted on the first rigid body by the second. |
Source | -- |
RefBy |
Refname | TM:UniversalGravLaw |
---|---|
Label |
Newton's law of universal gravitation |
Equation | \[\symbf{F}=G \frac{{m_{1}} {m_{2}}}{\|\symbf{d}\|^{2}} \symbf{\hat{d}}=G \frac{{m_{1}} {m_{2}}}{\|\symbf{d}\|^{2}} \frac{\symbf{d}}{\|\symbf{d}\|}\] |
Description | |
Notes |
Two rigid bodies in the universe attract each other with a force F that is directly proportional to the product of their masses, m1 and m2, and inversely proportional to the squared distance ||d||2 between them. |
Source | -- |
RefBy |
Refname | TM:NewtonSecLawRotMot |
---|---|
Label |
Newton's second law for rotational motion |
Equation | \[\symbf{τ}=\symbf{I} α\] |
Description | |
Notes |
The net torque τ on a rigid body is proportional to its angular acceleration α, where I denotes the moment of inertia of the rigid body as the constant of proportionality. We also assume that all rigid bodies involved are two-dimensional (from A:objectDimension). |
Source | -- |
RefBy |
This section collects the laws and equations that will be used to build the instance models.
Refname | GD:accelGravity |
---|---|
Label | Acceleration due to gravity |
Units |
\(\frac{\text{m}}{\text{s}^{2}}\) |
Equation | \[\symbf{g}=-\frac{G M}{\|\symbf{d}\|^{2}} \symbf{\hat{d}}\] |
Description | |
Notes |
If one of the masses is much larger than the other, it is convenient to define a gravitational field around the larger mass as shown above. The negative sign in the equation indicates that the force is an attractive force. |
Source | |
RefBy |
From Newton's law of universal gravitation, we have:
\[\symbf{F}=\frac{G {m_{1}} {m_{2}}}{{\|\symbf{d}\|^{2}}} \symbf{\hat{d}}\]The above equation governs the gravitational attraction between two bodies. Suppose that one of the bodies is significantly more massive than the other, so that we concern ourselves with the force the massive body exerts on the lighter body. Further, suppose that the Cartesian coordinate system is chosen such that this force acts on a line which lies along one of the principal axes. Then our unit vector directed from the center of the large mass to the center of the smaller mass d̂ for the x or y axes is:
\[\symbf{\hat{d}}=\frac{\symbf{d}}{\|\symbf{d}\|}\]Given the above assumptions, let M and m be the mass of the massive and light body respectively. Equating F above with Newton's second law for the force experienced by the light body, we get:
\[{\symbf{F}_{\symbf{g}}}=G \frac{M m}{{\|\symbf{d}\|^{2}}} \symbf{\hat{d}}=m \symbf{g}\]where g is the gravitational acceleration. Dividing the above equation by m, we have:
\[G \frac{M}{{\|\symbf{d}\|^{2}}} \symbf{\hat{d}}=\symbf{g}\]and thus the negative sign indicates that the force is an attractive force:
\[\symbf{g}=-G \frac{M}{{\|\symbf{d}\|^{2}}} \symbf{\hat{d}}\]Refname | GD:impulse |
---|---|
Label | Impulse for Collision |
Units | Ns |
Equation | \[j=\frac{-\left(1+{C_{\text{R}}}\right) {{\symbf{v}\text{(}t\text{)}_{\text{i}}}^{\text{A}\text{B}}}\cdot{}\symbf{n}}{\left(\frac{1}{{m_{\text{A}}}}+\frac{1}{{m_{\text{B}}}}\right) \|\symbf{n}\|^{2}+\frac{\|{\symbf{u}_{\text{A}\text{P}}}\text{*}\symbf{n}\|^{2}}{{\symbf{I}_{\text{A}}}}+\frac{\|{\symbf{u}_{\text{B}\text{P}}}\text{*}\symbf{n}\|^{2}}{{\symbf{I}_{\text{B}}}}}\] |
Description | |
Notes |
All bodies are assumed to be rigid (from A:objectTy) and two-dimensional (from A:objectDimension). A right-handed coordinate system is used (from A:axesDefined). All collisions are vertex-to-edge (from A:collisionType). |
Source | |
RefBy |
This section collects and defines all the data needed to build the instance models.
Refname | DD:ctrOfMass |
---|---|
Label | Center of Mass |
Symbol | p(t)CM |
Units | m |
Equation | \[{\symbf{p}\text{(}t\text{)}_{\text{CM}}}=\frac{\displaystyle\sum{{m_{j}} {\symbf{p}\text{(}t\text{)}_{j}}}}{{m_{T}}}\] |
Description | |
Notes |
All bodies are assumed to be rigid (from A:objectTy). |
Source | -- |
RefBy |
IM:transMot and IM:col2D |
Refname | DD:linDisp |
---|---|
Label | Linear displacement |
Symbol | u(t) |
Units | m |
Equation | \[u\text{(}t\text{)}=\frac{\,d\symbf{p}\text{(}t\text{)}\left(t\right)}{\,dt}\] |
Description | |
Notes |
All bodies are assumed to be rigid (from A:objectTy). |
Source | -- |
RefBy |
Refname | DD:linVel |
---|---|
Label | Linear velocity |
Symbol | v(t) |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[v\text{(}t\text{)}=\frac{\,d\symbf{u}\left(t\right)}{\,dt}\] |
Description | |
Notes |
All bodies are assumed to be rigid (from A:objectTy). |
Source | -- |
RefBy |
Refname | DD:linAcc |
---|---|
Label | Linear acceleration |
Symbol | a(t) |
Units |
\(\frac{\text{m}}{\text{s}^{2}}\) |
Equation | \[a\text{(}t\text{)}=\frac{\,d\symbf{v}\text{(}t\text{)}\left(t\right)}{\,dt}\] |
Description | |
Notes |
All bodies are assumed to be rigid (from A:objectTy). |
Source | -- |
RefBy |
Refname | DD:angDisp |
---|---|
Label | Angular displacement |
Symbol | θ |
Units | rad |
Equation | \[θ=\frac{\,dϕ\left(t\right)}{\,dt}\] |
Description | |
Notes |
All bodies are assumed to be rigid (from A:objectTy) and two-dimensional (from A:objectDimension). |
Source | -- |
RefBy |
Refname | DD:angVel |
---|---|
Label | Angular velocity |
Symbol | ω |
Units |
\(\frac{\text{rad}}{\text{s}}\) |
Equation | \[ω=\frac{\,dθ\left(t\right)}{\,dt}\] |
Description | |
Notes |
All bodies are assumed to be rigid (from A:objectTy) and two-dimensional (from A:objectDimension). |
Source | -- |
RefBy |
Refname | DD:angAccel |
---|---|
Label | Angular acceleration |
Symbol | α |
Units |
\(\frac{\text{rad}}{\text{s}^{2}}\) |
Equation | \[α=\frac{\,dω\left(t\right)}{\,dt}\] |
Description | |
Notes |
All bodies are assumed to be rigid (from A:objectTy) and two-dimensional (from A:objectDimension). |
Source | -- |
RefBy |
Refname | DD:chaslesThm |
---|---|
Label | Chasles' theorem |
Symbol | v(t)B |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[{\symbf{v}\text{(}t\text{)}_{\text{B}}}={\symbf{v}\text{(}t\text{)}_{\text{O}}}+ω\times{\symbf{u}_{\text{O}\text{B}}}\] |
Description | |
Notes |
The linear velocity v(t)B of any point B in a rigid body is the sum of the linear velocity v(t)O of the rigid body at the origin (axis of rotation) and the resultant vector from the cross product of the rigid body's angular velocity ω and the displacement vector between the origin and point B uOB. All bodies are assumed to be rigid (from A:objectTy). |
Source | |
RefBy |
Refname | DD:torque |
---|---|
Label | Torque |
Symbol | τ |
Units | Nm |
Equation | \[\symbf{τ}=\symbf{r}\times\symbf{F}\] |
Description | |
Notes |
The torque on a body measures the tendency of a force to rotate the body around an axis or pivot. |
Source | -- |
RefBy |
Refname | DD:kEnergy |
---|---|
Label | Kinetic energy |
Symbol | KE |
Units | J |
Equation | \[KE=m \frac{\|\symbf{v}\text{(}t\text{)}\|^{2}}{2}\] |
Description | |
Notes |
Kinetic energy is the measure of the energy a body possesses due to its motion. All bodies are assumed to be rigid (from A:objectTy) and two-dimensional (from A:objectDimension). No damping occurs during the simulation (from A:dampingInvolvement). |
Source | -- |
RefBy |
Refname | DD:coeffRestitution |
---|---|
Label | Coefficient of restitution |
Symbol | CR |
Units | Unitless |
Equation | \[{C_{\text{R}}}=-\left(\frac{{{\symbf{v}\text{(}t\text{)}_{\text{f}}}^{\text{A}\text{B}}}\cdot{}\symbf{n}}{{{\symbf{v}\text{(}t\text{)}_{\text{i}}}^{\text{A}\text{B}}}\cdot{}\symbf{n}}\right)\] |
Description | |
Notes |
The coefficient of restitution CR determines the elasticity of a collision between two rigid bodies. CR = 1 results in an elastic collision, CR < 1 results in an inelastic collision, and CR = 0 results in a totally inelastic collision. |
Source | -- |
RefBy |
Refname | DD:reVeInColl |
---|---|
Label |
Initial Relative Velocity Between Rigid Bodies of A and B |
Symbol |
v(t)iAB |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[{{\symbf{v}\text{(}t\text{)}_{\text{i}}}^{\text{A}\text{B}}}={\symbf{v}\text{(}t\text{)}^{\text{A}\text{P}}}-{\symbf{v}\text{(}t\text{)}^{\text{B}\text{P}}}\] |
Description | |
Notes |
In a collision, the velocity of a rigid body A colliding with another rigid body B relative to that body v(t)iAB is the difference between the velocities of A and B at point P. All bodies are assumed to be rigid (from A:objectTy). |
Source | -- |
RefBy |
Refname | DD:impulseV |
---|---|
Label | Impulse (vector) |
Symbol | J |
Units | Ns |
Equation | \[\symbf{J}=m Δ\symbf{v}\] |
Description | |
Notes |
An impulse (vector) J occurs when a force F acts over a body over an interval of time. All bodies are assumed to be rigid (from A:objectTy). |
Source | -- |
RefBy |
Newton's second law of motion states:
\[\symbf{F}=m \symbf{a}\text{(}t\text{)}=m \frac{\,d\symbf{v}\text{(}t\text{)}}{\,dt}\]Rearranging:
\[\int_{{t_{1}}}^{{t_{2}}}{\symbf{F}}\,dt=m \left(\int_{{\symbf{v}\text{(}t\text{)}_{1}}}^{{\symbf{v}\text{(}t\text{)}_{2}}}{1}\,d\symbf{v}\text{(}t\text{)}\right)\]Integrating the right hand side:
\[\int_{{t_{1}}}^{{t_{2}}}{\symbf{F}}\,dt=m {\symbf{v}\text{(}t\text{)}_{2}}-m {\symbf{v}\text{(}t\text{)}_{1}}=m Δ\symbf{v}\]Refname | DD:potEnergy |
---|---|
Label | Potential energy |
Symbol | PE |
Units | J |
Equation | \[PE=m \symbf{g} h\] |
Description | |
Notes |
The potential energy of an object is the energy held by an object because of its position to other objects. All bodies are assumed to be rigid (from A:objectTy) and two-dimensional (from A:objectDimension). No damping occurs during the simulation (from A:dampingInvolvement). |
Source | -- |
RefBy |
Refname | DD:momentOfInertia |
---|---|
Label | Moment of inertia |
Symbol | I |
Units | kgm2 |
Equation | \[\symbf{I}=\displaystyle\sum{{m_{j}} {d_{j}}^{2}}\] |
Description | |
Notes |
The moment of inertia I of a body measures how much torque is needed for the body to achieve angular acceleration about the axis of rotation. All bodies are assumed to be rigid (from A:objectTy). |
Source | -- |
RefBy |
This section transforms the problem defined in the problem description into one which is expressed in mathematical terms. It uses concrete symbols defined in the data definitions to replace the abstract symbols in the models identified in theoretical models and general definitions.
The goal GS:Determine-Linear-Properties is met by IM:transMot and IM:col2D. The goal GS:Determine-Angular-Properties is met by IM:rotMot and IM:col2D.
Refname | IM:transMot |
---|---|
Label | J-Th Body's Acceleration |
Input |
v(t)j, t, g, Fj, mj |
Output | a(t)j |
Input Constraints | \[{\symbf{v}\text{(}t\text{)}_{j}}\gt{}0\] \[t\gt{}0\] \[\symbf{g}\gt{}0\] \[{\symbf{F}_{j}}\gt{}0\] \[{m_{j}}\gt{}0\] |
Output Constraints | |
Equation | \[{\symbf{a}\text{(}t\text{)}_{j}}=\symbf{g}+\frac{{\symbf{F}_{j}}\left(t\right)}{{m_{j}}}\] |
Description | |
Notes |
The above equation expresses the total acceleration of the rigid body j as the sum of gravitational acceleration (from GD:accelGravity) and acceleration due to applied force Fj(t) (from TM:NewtonSecLawMot). The resultant outputs are then obtained from this equation using DD:linDisp, DD:linVel, and DD:linAcc. The output of the instance model will be the functions of position and velocity over time that satisfy the ODE for the acceleration, with the given initial conditions for position and velocity. The motion is translational, so the position and velocity functions are for the centre of mass (from DD:ctrOfMass). All bodies are assumed to be rigid (from A:objectTy) and two-dimensional (from A:objectDimension). It is currently assumed that no damping occurs during the simulation (from A:dampingInvolvement) and that no constraints are involved (from A:constraintsAndJointsInvolvement). |
Source | -- |
RefBy |
We may calculate the total acceleration of rigid body j by calculating the derivative of it's velocity with respect to time (from DD:linAcc).
\[{α_{j}}=\frac{\,d{\symbf{v}\text{(}t\text{)}_{j}}\left(t\right)}{\,dt}\]Performing the derivative, we obtain:
\[{\symbf{a}\text{(}t\text{)}_{j}}=\symbf{g}+\frac{{\symbf{F}_{j}}\left(t\right)}{{m_{j}}}\]Refname | IM:rotMot |
---|---|
Label | J-Th Body's Angular Acceleration |
Input |
ω, t, τj, I |
Output | αj |
Input Constraints | \[ω\gt{}0\] \[t\gt{}0\] \[{\symbf{τ}_{j}}\gt{}0\] \[\symbf{I}\gt{}0\] |
Output Constraints | \[{α_{j}}\gt{}0\] |
Equation | \[{α_{j}}=\frac{{\symbf{τ}_{j}}\left(t\right)}{\symbf{I}}\] |
Description | |
Notes |
The above equation for the total angular acceleration of the rigid body j is derived from TM:NewtonSecLawRotMot, and the resultant outputs are then obtained from this equation using DD:angDisp, DD:angVel, and DD:angAccel. All bodies are assumed to be rigid (from A:objectTy) and two-dimensional (from A:objectDimension). A right-handed coordinate system is used (from A:axesDefined). |
Source | -- |
RefBy |
We may calculate the total angular acceleration of rigid body j by calculating the derivative of its angular velocity with respect to time (from DD:angAccel).
\[{α_{j}}=\frac{\,dω\left(t\right)}{\,dt}\]Performing the derivative, we obtain:
\[{α_{j}}=\frac{{\symbf{τ}_{j}}\left(t\right)}{\symbf{I}}\]Refname | IM:col2D |
---|---|
Label | Collisions on 2D rigid bodies |
Input |
t, j, mA, n |
Output | tc |
Input Constraints | \[t\gt{}0\] \[j\gt{}0\] \[{m_{\text{A}}}\gt{}0\] \[\symbf{n}\gt{}0\] |
Output Constraints | \[{t_{\text{c}}}\gt{}0\] |
Equation | \[{\symbf{v}\text{(}t\text{)}_{\text{A}}}\left({t_{\text{c}}}\right)={\symbf{v}\text{(}t\text{)}_{\text{A}}}\left(t\right)+\frac{j}{{m_{\text{A}}}} \symbf{n}\] |
Description | |
Notes |
The output of the instance model will be the functions of position, velocity, orientation, and angular acceleration over time that satisfy the equations for the velocity and angular acceleration, with the given initial conditions for position, velocity, orientation, and angular acceleration. The motion is translational, so the position, velocity, orientation, and angular acceleration functions are for the centre of mass (from DD:ctrOfMass). All bodies are assumed to be rigid (from A:objectTy) and two-dimensional (from A:objectDimension). A right-handed coordinate system is used (from A:axesDefined). All collisions are vertex-to-edge (from A:collisionType). It is currently assumed that no damping occurs during the simulation (from A:dampingInvolvement) and that no constraints are involved (from A:constraintsAndJointsInvolvement). j is defined in GD:impulse |
Source | -- |
RefBy |
The Data Constraints Table shows the data constraints on the input variables. The column for physical constraints gives the physical limitations on the range of values that can be taken by the variable. The uncertainty column provides an estimate of the confidence with which the physical quantities can be measured. This information would be part of the input if one were performing an uncertainty quantification exercise. The constraints are conservative to give the user of the model the flexibility to experiment with unusual situations. The column of typical values is intended to provide a feel for a common scenario.
Var | Physical Constraints | Software Constraints | Typical Value | Uncert. |
---|---|---|---|---|
CR | 0 ≤ CR ≤ 1 | -- | 0.8 | 10% |
F | -- | -- | 98.1 N | 10% |
G | -- | -- | 66.743⋅10-12 \(\frac{\text{m}^{3}}{\text{kg}\text{s}^{2}}\) | 10% |
I | I > 0 | -- | 74.5 kgm2 | 10% |
L | L > 0 | -- | 44.2 m | 10% |
m | m > 0 | -- | 56.2 kg | 10% |
p(t) | -- | -- | 0.412 m | 10% |
v(t) | -- | -- | 2.51 \(\frac{\text{m}}{\text{s}}\) | 10% |
τ | -- | -- | 200 Nm | 10% |
ω | -- | -- | 2.1 \(\frac{\text{rad}}{\text{s}}\) | 10% |
ϕ | -- | 0 ≤ ϕ ≤ 2 π | \(\frac{π}{2}\) rad | 10% |
The Data Constraints Table shows the data constraints on the output variables. The column for physical constraints gives the physical limitations on the range of values that can be taken by the variable.
Var |
---|
p(t) |
v(t) |
ϕ |
ω |
This section provides the functional requirements, the tasks and behaviours that the software is expected to complete, and the non-functional requirements, the qualities that the software is expected to exhibit.
This section provides the functional requirements, the tasks and behaviours that the software is expected to complete.
This section provides the non-functional requirements, the qualities that the software is expected to exhibit.
This section lists the likely changes to be made to the software.
This section lists the unlikely changes to be made to the software.
As mentioned in the problem description, there already exist free open source game physics libraries. Similar 2D physics libraries are:
Free open source 3D game physics libraries include:
The purpose of the traceability matrices is to provide easy references on what has to be additionally modified if a certain component is changed. Every time a component is changed, the items in the column of that component that are marked with an "X" should be modified as well. Tab:TraceMatAvsA shows the dependencies of the assumptions on each other. Tab:TraceMatAvsAll shows the dependencies of the data definitions, theoretical models, general definitions, instance models, requirements, likely changes, and unlikely changes on the assumptions. Tab:TraceMatRefvsRef shows the dependencies of the data definitions, theoretical models, general definitions, and instance models on each other. Tab:TraceMatAllvsR shows the dependencies of the requirements and goal statements on the data definitions, theoretical models, general definitions, and instance models.
The purpose of the traceability graphs is also to provide easy references on what has to be additionally modified if a certain component is changed. The arrows in the graphs represent dependencies. The component at the tail of an arrow is depended on by the component at the head of that arrow. Therefore, if a component is changed, the components that it points to should also be changed. Fig:TraceGraphAvsA shows the dependencies of assumptions on each other. Fig:TraceGraphAvsAll shows the dependencies of data definitions, theoretical models, general definitions, instance models, requirements, likely changes, and unlikely changes on the assumptions. Fig:TraceGraphRefvsRef shows the dependencies of data definitions, theoretical models, general definitions, and instance models on each other. Fig:TraceGraphAllvsR shows the dependencies of requirements and goal statements on the data definitions, theoretical models, general definitions, and instance models. Fig:TraceGraphAllvsAll shows the dependencies of dependencies of assumptions, models, definitions, requirements, goals, and changes with each other.
For convenience, the following graphs can be found at the links below:
There are no auxiliary constants.