I have been trying to make a physics engine for long enough and still haven’t found a way to get the vertices to detect collisions because I need obj meshes to have their own collisions but I only found ways for cubes and spheres but not obj meshes. I’ve tried to use geometry.vertices but it just says its undefined I think it has been deprecated is what I think. Here is an example of what I really wanted to use but its probably been deprecated because I console.logged object.geometry and I am pretty sure its just deprecated.
for (var vertexIndex = 0; vertexIndex < Player.geometry.vertices.length; vertexIndex++)
{
var localVertex = Player.geometry.vertices[vertexIndex].clone();
var globalVertex = Player.matrix.multiplyVector3(localVertex);
var directionVector = globalVertex.subSelf( Player.position );
var ray = new THREE.Ray( Player.position, directionVector.clone().normalize() );
var collisionResults = ray.intersectObjects( collidableMeshList );
if ( collisionResults.length > 0 && collisionResults[0].distance < directionVector.length() )
{
// a collision occurred... do something...
}
}