Skip to content

Commit

Permalink
refactor: DistanceData
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmasB committed Mar 22, 2023
1 parent ec3f7dc commit b650de0
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 48 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* FXGL - JavaFX Game Library. The MIT License (MIT).
* Copyright (c) AlmasB (almaslvl@gmail.com).
* See LICENSE for details.
*/

package com.almasb.fxgl.physics.box2d.collision

import com.almasb.fxgl.core.math.Vec2
import com.almasb.fxgl.physics.box2d.collision.Distance.DistanceProxy
import com.almasb.fxgl.physics.box2d.common.Transform

/**
*
* @author Almas Baimagambetov (almaslvl@gmail.com)
*/

/**
* Input for Distance with the option to use the shape radii in the computation.
*/
internal class DistanceInput {

@JvmField
var proxyA = DistanceProxy()

@JvmField
var proxyB = DistanceProxy()

@JvmField
var transformA = Transform()

@JvmField
var transformB = Transform()

@JvmField
var useRadii = false
}

/**
* Output for Distance.
*/
internal class DistanceOutput {

/**
* Closest point on shapeA.
*/
@JvmField
val pointA = Vec2()

/**
* Closest point on shapeB.
*/
@JvmField
val pointB = Vec2()

@JvmField
var distance = 0f

/**
* Number of gjk iterations used.
*/
@JvmField
var iterations = 0
}

0 comments on commit b650de0

Please sign in to comment.