Quantcast
Viewing all articles
Browse latest Browse all 388

Gravity with Heightfields

How can I get my mesh moving around on a height field when using Oimo Plugin in Babylon js?

 

This is "working":

Render.prototype.createScene = function(){
    this.ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", "textures/heightMap.png", 50, 50, 100, 0, 2, this.scene, false, onGroundCreated);
    this.ground.setPhysicsState(BABYLON.PhysicsEngine.BoxImpostor, {friction:0, mass: 0,  move : false });
}

function onGroundCreated(ground){
    ground.setPhysicsState(BABYLON.PhysicsEngine.BoxImpostor, {friction:0, mass: 0,  move : false });
}

The problem is, as the Imposter is a Box, my Mesh moves just on top of the height field.

 

In this tutorial:

https://blogs.msdn.microsoft.com/davrous/2014/11/18/understanding-collisions-physics-by-building-a-cool-webgl-babylon-js-demo-with-oimo-js/

It states four different possibilitys for colliders. Box, Sphere, Capsule and Mesh. Is Capsule and Mesh also available in the Babylon OimoJSPlugin? Because I guess thats what I would need to move around the height field i guess. Or maybe there are other valid options for that problem.

 


Viewing all articles
Browse latest Browse all 388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>