I have a object that looks to another object. But when I do my collision detection. He doesn't sees the rotation wish I do with the LookAt
. But he uses his default rotation. Why doesn't he uses the rotation wish I do with the LookAt
?
This is the problem:
The blue one is the default. The green one shows the blue one with the LookAt
.
Why does LookAt does not effect the collision detection?
My collision detection: (I make a RTS game that is why I only use X and Z)
function collisionXZ(o1, o2) {
if (Math.abs(o1.position.x - o2.position.x) > (o1.geometry.parameters.width + o2.geometry.parameters.width) / 2)
return false;
if (Math.abs(o1.position.z - o2.position.z) > (o1.geometry.parameters.depth + o2.geometry.parameters.depth) / 2)
return false;
return true;
}