#Octree implementation in third person

2 messages · Page 1 of 1 (latest)

sonic pivot
#

So I'm trying to implement Octree from fps example, and i have an issue that collision is detecting but there is ~1 additional unit spacing around the capsule (screenshot)
how to remove it?

I have basically copy-paste the collision checking logic

  const result = collider.capsuleIntersect( player );

  playerIsOnGround = false;

  if ( result ) {

    playerIsOnGround = result.normal.y > 0;
    console.log(result);


    if ( ! playerIsOnGround ) {

      playerVelocity.addScaledVector( result.normal, - result.normal.dot( playerVelocity ) );

    }

    player.translate( result.normal.multiplyScalar( result.depth ) );

  }
#

I'm using built in Capsule class, and I have attached this cylnder to it, just for the debugging