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.

[v3.1-alpha] Inspector fails to load after physics impostor is added to externally-loaded mesh

See original GitHub issue

I’m fetching a low-poly tree model from an external .obj file via the AssetsManager and adding a cylinder physics impostor after it has finished loading. All of this is working fine. Here’s my tree: image Next, I’m duplicating the tree and adding more because Bob Ross said they get lonely, but I digress.

Here’s the code:

var loader = new BABYLON.AssetsManager(scene);
var tree = loader.addMeshTask("happyTree", "", "meshes/", "tree.obj");
loader.load();
tree.onSuccess = function (task) {
  var treeMesh = BABYLON.Mesh.MergeMeshes(task.loadedMeshes);
  treeMesh.material = treeMaterial;

  var tree1 = treeMesh.clone();
  treeMesh.dispose();

  tree1.position = new BABYLON.Vector3(-20, 17, 10);
  tree1.physicsImpostor = new BABYLON.PhysicsImpostor(tree1, BABYLON.PhysicsImpostor.CylinderImpostor, { mass: 0, restitution: 8 }, scene);
  ...
}

If I comment out the line where I assign tree1.physicsImpostor, the inspector loads fine. As it stands, this is what I’m seeing in the JS console: image

I’m pulling down the relevant JS files from preview.babylonjs.com just to make sure I have the latest and greatest. Seen on Chrome v60.0.3112.101 on Windows 10.

This is the first issue I’ve filed in this repo, so please let me know if I’ve forgotten anything!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
treefortcommented, Sep 25, 2017

And since localCompare is used during string-comparison, maybe try giving tree1 a name

Nailed it! That fixed the issue.

Thanks! 😄

0reactions
Temechoncommented, Oct 31, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Physics Features | Babylon.js Documentation
A heightmap is not a mesh impostor. It is possible that objects coming from the side will not collide with it. The heightmap...
Read more >
Inspection Information for Residents - HUD
HUD property and unit inspections · Report an issue or concern · Step-by-step: REAC inspection process · Properties that fail inspection · Get...
Read more >
Adding PhysicsImpostor turning meshes upside-down
I'm loading a mesh from a GLB file that I've exported from Blender. The problem I'm having is that as soon as I...
Read more >
Motor Vehicle Inspection Regulations - New York DMV
79.2 Vehicles subject to inspection (Amended 12/29/10 and 7/01/12) . ... (d) If a vehicle subject to the OBD II emissions inspection fails...
Read more >
Construction Inspections - City and County of Denver
Schedule an inspection. Inspections will be completed within 2 business days. Inspections cannot be scheduled for permits that are still under review.
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