question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Physijs.ConcaveMesh scale property not respected

See original GitHub issue

It doesn’t seem scaling works for Physijs.ConcaveMesh:

var groundMesh = new Physijs.ConcaveMesh(geometry, faceMaterial, 0);
groundMesh.scale.set(10, 10, 10);
scene.add(groundMesh);

The mesh appears and can be collided with, but it is considered to be it’s default size by the physics engine. I had a look at 1afa96be42ba2b879a9dbb92984e6296f8bb9f91, then added a breakpoint at line 784, and the ConcaveMesh doesn’t seem to have object._physijs.width and friends. Setting those variables manually to 1 doesn’t help either.

Related to #20

Issue Analytics

  • State:open
  • Created 11 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chandlerprallcommented, Jan 20, 2014

As a work around you could apply the scale directly to the geometry itself. Something like

geometry.vertices.forEach(function( v ){ v.multiplyScalar( the_scale ) });
0reactions
JScottcommented, Oct 26, 2014

Has there been any traction on this issue? Applying the scale directly to the geometry causes weird errors with the entire scene and modifying the original model isn’t a great solution for me.

It’s worth mentioning that I have the same problem with Physijs.SphereMesh. I’m not sure if that’s related or another issue entirely.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Physijs object goes through concaveMesh - three.js
I already read that this issue could be caused by an error in scaling concaveMesh together with the model, so I exported my...
Read more >
Creating a Simple 3D Physics Game Using Three.js and Physijs
In this tutorial, you'll learn how to use Physi.js to add game physics to a 3D scene created using Three.js. We'll create a...
Read more >
Learning Three.js – the JavaScript 3D Library for WebGL
scale. This property allows you to scale the object around its x, y, and z axes. translateX(amount). This property moves the object the...
Read more >
Slopes - Envato Tuts+ Game Development - RSSing.com
If the tile is not transformed in any way, we just get an offset for an object ... Many freelancers use Envato Tuts+...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found