Renderer/src/main/java/electrosphere/script/utils/AccessTransforms.java
2024-08-25 11:51:15 -04:00

28 lines
841 B
Java

package electrosphere.script.utils;
/**
* Used for transforming datastructures to and from the script-access forms
* ie, converting a "Vector3d" into a "Vector" and vice versa
*/
public class AccessTransforms {
/**
* Converts a JOML vector to an access vector
* @param source The JOML vector
* @return The access vector
*/
public static electrosphere.script.access.Vector getVector(org.joml.Vector3d source){
return new electrosphere.script.access.Vector(source.x, source.y, source.z);
}
/**
* Converts an access vector into a JOML vector
* @param source The access vectpr
* @return The JOML vector
*/
public static org.joml.Vector3d getVector(electrosphere.script.access.Vector source){
return new org.joml.Vector3d(source.x,source.y,source.z);
}
}