Jump to content

Mesh.CreateGround v2.3.0 addMesh not found


mwpowellhtx
 Share

Recommended Posts

I am getting an error with the latest BABYLON 2.3 (NuGet):

//var gn = this.getName;
//var cg = BABYLON.Mesh.CreateGround;

//totalLength, calculated elsewhere
//s === scene

this.field = cg(gn("field"), { width: totalLength, height: totalLength }, s);

Yield: Uncaught TypeError: Cannot read property 'addMesh' of undefined.

Stack trace:

babylon.js:5 Uncaught TypeError: Cannot read property 'addMesh' of undefined
i @ babylon.js:5
r @ babylon.js:11
i @ babylon.js:20
t.CreateGround @ babylon.js:12
r.CreateGround @ babylon.js:12
build @ gridiron.js:146
createScene @ TestFixture.html:79
(anonymous function) @ TestFixture.html:109

That I know of, I was not receiving the same error in 2.2.0.

I'll try downgrading and see if that makes a difference.

Link to comment
Share on other sites

Ground behavior has definitely changed.

I updated to call the non-object-param instead. That much works fine enough.

// perhaps subdivisions: 1 is incorrect?
this.field = BABYLON.Mesh.CreateGround(_gn('field'), totalLength, totalLength, 1, s);

However, now the field lines are not rendering. These are created with a rotated CreatePlane. Perhaps they could be created with CreateGround as well, but I do not know what the dynamics are, per se, why they would suddenly not be showing up.

Apart from the CreateGround nuanced call, the only difference is the version, swapping this:

<script src="BabylonJS.2.2.0/content/scripts/poly2tri.js"></script>
<script src="BabylonJS.2.2.0/content/scripts/oimo.js"></script>
<script src="BabylonJS.2.2.0/content/scripts/babylon.js"></script>
<!-- <script src="babylonjs.2.3.0/content/scripts/poly2tri.js"></script> -->
<!-- <script src="BabylonJS.2.3.0/content/scripts/oimo.js"></script> -->
<!-- <script src="BabylonJS.2.3.0/content/scripts/babylon.js"></script> -->

For this:

<!-- <script src="BabylonJS.2.2.0/content/scripts/poly2tri.js"></script> -->
<!-- <script src="BabylonJS.2.2.0/content/scripts/oimo.js"></script> -->
<!-- <script src="BabylonJS.2.2.0/content/scripts/babylon.js"></script> -->
<script src="babylonjs.2.3.0/content/scripts/poly2tri.js"></script>
<script src="BabylonJS.2.3.0/content/scripts/oimo.js"></script>
<script src="BabylonJS.2.3.0/content/scripts/babylon.js"></script>

See attached images.

babylon-2.2.0-ground-behavior.png

babylon-2.3.0-ground-behavior.png

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...