Jump to content

How to stop free camera movement completely?


Majeed Siddiqui
 Share

Recommended Posts

I have free camera in orthographic camera mode. I don't want camera to move at all on mouse or any other kind of input. So I tried not calling attachControl with this, camera doesn't react at all (Good!) but boxes in this scene with actions registered to action manager also do not react to mouse inputs.

Second approach I tried is calling attachControl with following function:

scope.registerBeforeRender(function () {
    // I want top view
    camera.rotation.x = Math.PI / 2;
    camera.rotation.y = Math.PI / 2;
    camera.rotation.z = 0;
});

When I try to move ground with mouse it does move slightly. As shown in image.

Help needed.

Screen Shot 2016-08-16 at 5.25.05 PM.png

Link to comment
Share on other sites

Gosh @Pryme8, how would I have EVER found this 0-reply topic without your dedicated assistance?  :D

Yikes!

@Majeed Siddiqui, how's it going?  I hope well.

Here's a playground where I tried a few things and failed at most of them:  http://playground.babylonjs.com/#WX234#1

But, I did come across some thing that might work.  Look at lines 7/8.  Would that kludge-solve work for your situation?  In my minimum testing, I wasn't getting much camera movements, no matter what I tried.  (okay, okay, I still see a TINY bit of movement during fast mouse-drags. :)  Tolerable?)  

Picks and mouseovers are still working, so maybe we don't need to dig any deeper.  Holler back, as needed.  There's some Gods of the camera input system... hanging around.  Maybe they will visit.

Link to comment
Share on other sites

Ive done it before... hold on I thought I had it, but I was wrong.

 

camera.inputs.removeByType("FreeCameraKeyboardMoveInput");
camera.inputs.removeByType("FreeCameraMouseMoveInput");

https://doc.babylonjs.com/tutorials/Customizing_Camera_Inputs

looks like the mouse move is still working... but Im sure you will figure the solution out with this.

Link to comment
Share on other sites

  • 2 years later...

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