Box2D 2.4.1
A 2D physics engine for games
b2_time_step.h
1// MIT License
2
3// Copyright (c) 2019 Erin Catto
4
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22#ifndef B2_TIME_STEP_H
23#define B2_TIME_STEP_H
24
25#include "b2_api.h"
26#include "b2_math.h"
27
29struct B2_API b2Profile
30{
31 float step;
32 float collide;
33 float solve;
34 float solveInit;
35 float solveVelocity;
36 float solvePosition;
37 float broadphase;
38 float solveTOI;
39};
40
42struct B2_API b2TimeStep
43{
44 float dt; // time step
45 float inv_dt; // inverse time step (0 if dt == 0).
46 float dtRatio; // dt * inv_dt0
47 int32 velocityIterations;
48 int32 positionIterations;
49 bool warmStarting;
50};
51
53struct B2_API b2Position
54{
55 b2Vec2 c;
56 float a;
57};
58
60struct B2_API b2Velocity
61{
62 b2Vec2 v;
63 float w;
64};
65
67struct B2_API b2SolverData
68{
69 b2TimeStep step;
70 b2Position* positions;
71 b2Velocity* velocities;
72};
73
74#endif
This is an internal structure.
Definition: b2_time_step.h:54
Profiling data. Times are in milliseconds.
Definition: b2_time_step.h:30
Solver Data.
Definition: b2_time_step.h:68
This is an internal structure.
Definition: b2_time_step.h:43
A 2D column vector.
Definition: b2_math.h:42
This is an internal structure.
Definition: b2_time_step.h:61