All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.de.fabmax.kool.physics.HitResult.kt Maven / Gradle / Ivy

There is a newer version: 0.15.1
Show newest version
package de.fabmax.kool.physics

import de.fabmax.kool.math.MutableVec3f
import de.fabmax.kool.math.Vec3f

class HitResult {
    val hitPosition = MutableVec3f()
    val hitNormal = MutableVec3f()
    var hitDistance = -1f
    var nearestActor: RigidActor? = null
    val hitActors = mutableListOf()

    val isHit: Boolean
        get() = nearestActor != null

    fun clear() {
        hitPosition.set(Vec3f.ZERO)
        hitNormal.set(Vec3f.ZERO)
        hitDistance = -1f
        nearestActor = null
        hitActors.clear()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy