aframe-orbit-controls-component icon indicating copy to clipboard operation
aframe-orbit-controls-component copied to clipboard

Forcing the camera to go back behind the object quickly

Open legojesus opened this issue 6 years ago • 2 comments

Hello,

We are using this aframe component in a proof of concept game that we’re working on, in which you control a spaceship in space, land on a planet and control a drone on the planet’s surface. You can check it out here: http://exoplanets.cc

We have an issue that we can’t figure out the solution for. When the object is moving slowly (e.g. the spaceship or the drone), the camera takes a very long time to position itself behind it so the player can see what he is pointing at.

The best example for it is the spaceship controls. When you are moving slowly and point the spaceship somewhere, it takes time for the camera to position itself behind the spaceship. But when you press “Space” and fly fast, then the camera is quick and responsive and it feels right. The movement of the object directly affects the speed of the camera's position around it.

In order to solve this when you land on a planet and control the drone, we currently just locked the camera behind the drone, but it doesn’t feel right. It feels forced and the movement is too sharp.

Is there a way to speed up the camera’s movement to return to a certain position (in this case, behind the object) even if the object is moving slow or not moving at all?

Thank you.

legojesus avatar Nov 12 '18 10:11 legojesus

Hey @legojesus,

thanks for using the component. Unfortunately i stopped working on it, as there is a much more performant alternative developed by the A-Frame core team. I put a message on top of the README. Please use this component instead: https://github.com/ngokevin/kframe/tree/master/components/orbit-controls

If you don't want to destroy your already invested time, i recommend you create a fork and have a look at the source code, especially the way the inertia is built. If you make this more configurable, i'm happy to merge this.

Sorry to be not of much help here.

Cheers

Till

tizzle avatar Nov 12 '18 11:11 tizzle

Hey @tizzle Thank you for the quick reply! Will check it out. Much appreciated!

legojesus avatar Nov 12 '18 12:11 legojesus