Skip to content

Commit b650de0

Browse files
committed
refactor: DistanceData
1 parent ec3f7dc commit b650de0

File tree

3 files changed

+64
-48
lines changed

3 files changed

+64
-48
lines changed

fxgl-entity/src/main/java/com/almasb/fxgl/physics/box2d/collision/DistanceInput.java

Lines changed: 0 additions & 23 deletions
This file was deleted.

fxgl-entity/src/main/java/com/almasb/fxgl/physics/box2d/collision/DistanceOutput.java

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* FXGL - JavaFX Game Library. The MIT License (MIT).
3+
* Copyright (c) AlmasB (almaslvl@gmail.com).
4+
* See LICENSE for details.
5+
*/
6+
7+
package com.almasb.fxgl.physics.box2d.collision
8+
9+
import com.almasb.fxgl.core.math.Vec2
10+
import com.almasb.fxgl.physics.box2d.collision.Distance.DistanceProxy
11+
import com.almasb.fxgl.physics.box2d.common.Transform
12+
13+
/**
14+
*
15+
* @author Almas Baimagambetov (almaslvl@gmail.com)
16+
*/
17+
18+
/**
19+
* Input for Distance with the option to use the shape radii in the computation.
20+
*/
21+
internal class DistanceInput {
22+
23+
@JvmField
24+
var proxyA = DistanceProxy()
25+
26+
@JvmField
27+
var proxyB = DistanceProxy()
28+
29+
@JvmField
30+
var transformA = Transform()
31+
32+
@JvmField
33+
var transformB = Transform()
34+
35+
@JvmField
36+
var useRadii = false
37+
}
38+
39+
/**
40+
* Output for Distance.
41+
*/
42+
internal class DistanceOutput {
43+
44+
/**
45+
* Closest point on shapeA.
46+
*/
47+
@JvmField
48+
val pointA = Vec2()
49+
50+
/**
51+
* Closest point on shapeB.
52+
*/
53+
@JvmField
54+
val pointB = Vec2()
55+
56+
@JvmField
57+
var distance = 0f
58+
59+
/**
60+
* Number of gjk iterations used.
61+
*/
62+
@JvmField
63+
var iterations = 0
64+
}

0 commit comments

Comments
 (0)