MCPcopy Create free account
hub / github.com/cuberite/cuberite / Expand

Method Expand

src/Cuboid.cpp:138–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136
137
138void cCuboid::Expand(int a_SubMinX, int a_AddMaxX, int a_SubMinY, int a_AddMaxY, int a_SubMinZ, int a_AddMaxZ)
139{
140 if (p1.x < p2.x)
141 {
142 p1.x -= a_SubMinX;
143 p2.x += a_AddMaxX;
144 }
145 else
146 {
147 p2.x -= a_SubMinX;
148 p1.x += a_AddMaxX;
149 }
150
151 if (p1.y < p2.y)
152 {
153 p1.y -= a_SubMinY;
154 p2.y += a_AddMaxY;
155 }
156 else
157 {
158 p2.y -= a_SubMinY;
159 p1.y += a_AddMaxY;
160 }
161
162 if (p1.z < p2.z)
163 {
164 p1.z -= a_SubMinZ;
165 p2.z += a_AddMaxZ;
166 }
167 else
168 {
169 p2.z -= a_SubMinZ;
170 p1.z += a_AddMaxZ;
171 }
172}
173
174
175

Callers 3

DoExplosionAtMethod · 0.45
ItemMethod · 0.45
ItemMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected