Jump to content

How to get vertex where ball collide ground


Recommended Posts

ground.position.y is always same (ground have his own origin/pivot point and ground.position.y is ground's origin vertex).
If ground is diagonally/alive/when_you_rotate_in_runtime than this ground.position.y is every time different (vertex where ball contact the ground).

I don't understand why 

onCollisionPositionChangeObservable : Observable<Vector3>
An event triggered when the collision's position changes

Are this functions for Mesh or Mesh's collider? Any example playground will be good to learn us how to use this callback functions.

Doesn't work. Or I don't know how to use this method/funciton of API. What is going on with this callback functions? I try debug but functions are not called.

I think we should do like (we define our callback function which it should invoked)

perplexus.onCollisionPositionChange = new function(vertex) {

// here we should get vertex (x,y,z) of point where ball collide with perplexus

console.log( vertex );


Is this onCollisionPositionChangeObserve function implemented and does it work? If this will work it will be perfect solution.
What am I doint wrong???
Can anybody help us to understand this three functions? 
I would like to made custom auto align FreeCamera (I am experimenting) and I need vertex=contact of Sphere and Perplexus for each frame.

Is there any another way to obtain vertext where two meshes touch each other

// I'am trying this but,
// callback functions don't invoke ?????
perplexus.onCollisionPositionChange = function(vertex) {
  console.log("Test"+ vertext+" "+this);
perplexus.onCollisionPositionChangeObservable = function(vertex) {
  console.log("Test1"+ vertex);
perplexus.onCollide = function() {

JohnK Thanks for your help.
Is BabylonJS capable to achive that with BabylonJS's APIs? Or should we hack math like JohnK is doing?



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.

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.


  • Recently Browsing   0 members

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