Currently, I am working on developing a simple game project for my school. However, I have encountered an issue with the collisions in the game. The collision boxes appear to be misaligned.
If you wish to see the game I am working on, you can access it here:
The creation of these small boxes is done through this code snippet:
for(var x = 0; x < colliderPolygon.points.length; x++){
var test = new THREE.Mesh(new THREE.CubeGeometry(8,8,8),material)
test.position.x = colliderPolygon.pos.x + colliderPolygon.calcPoints[x].x
test.position.z = colliderPolygon.pos.y + colliderPolygon.calcPoints[x].y
this.mesh.add(test)
}
I made adjustments to the collision logic because ThreeJS positions are bound to the bottom center of the box while SAT's positions are bound to the top left corner of the box.
If you would like to take a look at the complete code of the program, it is available here: https://github.com/Hajtosek/ggEasy
Do you have any ideas or suggestions on what might be causing this issue?