Comments (6)
I have resolved this manually by running the following code:
var vel = object.getLinearVelocity(),
factor = -1;
object.applyCentralForce(new THREE.Vector3(vel.x / factor, vel.y / factor, vel.z / factor));
However, I am still wondering if drag can be applied by just passing a number to Physijs.
from physijs.
Air resistance can be simulated by using damping - however that's not yet available; I should have it in there for you tomorrow.
from physijs.
setDamping
method has been added to the mesh objects. It takes two arguments, a linear damping and an angular damping. Values can range from 0 (no damping) to 1 (object stops almost immediatley)
var linear_amount = .6;
var angular_amount = 0;
mesh.setDamping( linear_amount, angular_amount );
from physijs.
Sweet! Cheers!
from physijs.
great work! This will come in handy
from physijs.
notice it works only when values set after mesh added to the scene!
from physijs.
Related Issues (20)
- Refused to execute script (from xyz) because its MIME type ('text/js') is not executable. HOT 1
- How to deform an Physijs.SphereMesh like a WaterDrop?
- PhysijsWorker is not a constructor HOT 2
- How to move blocks out of blocks faster HOT 1
- how to load GLTF model ? HOT 2
- No updates for years, any recommendations for an alternative lib? HOT 3
- THREE.InstancedMesh is not supported
- How do I get the number of layers and roots with a mouse click HOT 1
- Objects after coming to rest are stuck in that state.
- Scenegraph Skipping collision checks - possible issue or me being silly
- How to check for an overlap event
- applyImpulse to object: vector: NaN ? HOT 1
- Use physijs to give three.js Questions about adding physical effects?
- When I used concavemesh to transform the externally introduced obj model, the browser reported an error
- Uncaught TypeError: class constructors must be invoked with 'new' when trying to create Physijs Scene HOT 3
- Vehicle physics HOT 1
- How to use it in vue-cli3?
- Döner alike fractal terrain rolled up
- Physi
- Is it possible to set restitution on objects?
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 physijs.