Majeed Siddiqui

How to stop free camera movement completely?

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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.