Comments (1)
I solved this problem. You need to set the rotation factor to (0, 0, 0) when W and S were pressed, and to (0, 1, 0) when A and D were pressed.
Example on OimoPhysics and Three.js:
- PlayCode: https://playcode.io/1508199
- Plunker: https://plnkr.co/edit/RbAXEd0f9oCvw2Lg
if (input === "u") {
/* ... */
playerBody.setRotationFactor(new OIMO.Vec3(0, 0, 0));
}
if (input === "d") {
/* ... */
playerBody.setRotationFactor(new OIMO.Vec3(0, 0, 0));
}
if (input === "l") {
/* ... */
playerBody.setRotationFactor(new OIMO.Vec3(0, 1, 0));
}
if (input === "r") {
/* ... */
playerBody.setRotationFactor(new OIMO.Vec3(0, 1, 0));
}
from oimophysics.
Related Issues (20)
- Please, upload a new version to NPM HOT 12
- Please,A new version Vehicle HOT 1
- Inertia of Cone Geometry seems wrong HOT 2
- Uncaught ReferenceError: HxOverrides is not defined HOT 2
- "Hello World" on the server side with OimoPhysics HOT 8
- I can't change gravity in OimoPhysics 1.2.4 HOT 2
- How can I find out which object I hit with the ray? HOT 3
- Incorrect behaviour of rigidbodies with high mass HOT 1
- Allow for models? HOT 2
- ConvexHullGeometry.hx - _volume (issue) HOT 1
- BvhBroadPhase.hx - Memory leak HOT 3
- Bug: RigidBody.setType before addShape makes body not work HOT 1
- Question: How to change the centre of mass location? HOT 10
- No longer compiles HOT 3
- about impulse HOT 1
- Support for Compiling to SWC HOT 3
- Please, create the Discussions tab HOT 1
- Add Linear Factor HOT 1
- Clarification on the use of the JavaScript modules HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oimophysics.