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

org.rsmod.game.pathfinder.util.RotationUtils.kt Maven / Gradle / Ivy

The newest version!
package org.rsmod.game.pathfinder.util

internal object RotationUtils {

    fun rotate(objectRot: Int, dimensionA: Int, dimensionB: Int): Int = when {
        objectRot and 0x1 != 0 -> dimensionB
        else -> dimensionA
    }

    fun rotate(objectRot: Int, blockAccessFlags: Int): Int = when (objectRot) {
        0 -> blockAccessFlags
        else -> ((blockAccessFlags shl objectRot) and 0xF) or (blockAccessFlags shr (4 - objectRot))
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy