Jump to content

NullEngine Vector3.Project returns broken Vector3


Hersir
 Share

Recommended Posts

Hi,

Tried to unit test my util function that involves Vector3.Project and it returns Vector3 with infinity in it.

Doing something wrong?

var engine = new NullEngine();
var scene = new Scene(engine);
var camera = new ArcRotateCamera("camera", 0, 0, 0, Vector3.Zero(), scene);
scene.render();
var pos = Vector3.Project(
              new Vector(0.5, 0.5, 0.5),
              Matrix.Identity(),
              scene.getTransformMatrix(),
              scene.activeCamera.viewport.toGlobal(
              engine.getRenderWidth(),
              engine.getRenderHeight(),
            );
// pos is Vector3 { x: Infinity, y: NaN, z: -Infinity }

Using: 3.1.1 babylon

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