Jump to content

Intersect Mesh


csganja
 Share

Recommended Posts

Any reason why the intersectsMesh is triggered on the red line area and not on the green line (as would be normal i guess)?

Untitled-1.thumb.png.782066ed43f5660cc439ec1eff630017.png

Just using a simple code, nothing fancy... No physics engine...

// skillMesh - fireball thing
// m - monster
scene.registerBeforeRender(function() {
    if (skillMesh.intersectsMesh(m, false)) {
        // do your job [call hit(), unregister this e.t.c.]
        console.log("hit");
    }
    else {
        // set skillMesh.position
    }
}

Edit1: Played a bit more and rotated the mesh, the collision area is still in the back of monster, Could be a mesh problem? 

Edit.2 Replaced my monster with a sphere and collision works fine, i can't see the problem on my mesh...

Edit3: Solved, i have no idea how this helped but i change the rest pose and it's fine now

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...