Comments (4)
Hello. The physics bodies do not have a scale vector because scaling does not work well with physics simulation. However, you should be able to apply your scale before creating the collision shapes because I guess you also need to scale your 3D models for rendering right?
Note: Can I ask you to ask question in the Discussions section instead of creating a new issue?
from reactphysics3d.
Note: Can I ask you to ask question in the Discussions section instead of creating a new issue?
Yes, of course, my bad!
because I guess you also need to scale your 3D models for rendering right?
No, the rendered meshes remain at original scale.
The technique they follow is basically to multiply the up axis by 0.65 and divide positions of objects by 0.65 (therefore putting them back to where they were).
However, you should be able to apply your scale before creating the collision shapes
I tried this once with PhysX in Unity. Since I was limited by the C# API of Unity, I ended up duplicating the scene, removing all meshes in that duplicated scene and only leaving (mesh)colliders, this duplicate object's root was then multiplied by 0.65 on the up axis and the original objects remained at their original scale but copied the position of the duplicated objects (and divided that by 0.65). Horrible approach of course. The problem that remained was, that only mesh colliders ended up working because box/sphere/etc were not adjusted by parent transforms. I think PhysX does that for performance reasons? Not entirely sure.
Here is an image that shows the collision difference:
Ever since then I've been wondering if there is any way to get that done in a performant manner.
from reactphysics3d.
I am not sure I really understand the goal of scaling the vertical axis.
When you say:
to allow an easier movement across slopes (of any dynamic rigidbody).
What does that mean exactly?
Anyway, in the library it is not possible to scale the bodies. If you want a bigger body along the up axis, you need to do scale it when you create the collision shape for that body. Note that for instance when you create a triangular mesh using the PhysicsCommon::createConcaveMeshShape()
method, you can pass a scaling factor in parameter at this point. Once the body is created you cannot scale it anymore.
from reactphysics3d.
What does that mean exactly?
On the images I posted, there is a slope next to the capsule. The first one is taller than the second, which makes the second one easier to traverse. What I try to achieve is that the first one is just as easy to traverse as the second one. Exactly the same. That's pretty much it. I found ways to do this but simple dynamic rigidbodies were always a problem.
from reactphysics3d.
Related Issues (20)
- mBaseAllocator.release pure virtual method called causing SIGABRT HOT 2
- A ton of compiler errors when trying to compile with Make. HOT 1
- RigidBody::raycast gives incorrect result in raycastInfo for body with multiple colliders + solution HOT 1
- Objects going though each other HOT 1
- Set Collider Transform assumes that mBody is a RigidBody HOT 2
- How to get axis angles? HOT 4
- CollisionDetectionSystem::createContacts() assert crash HOT 2
- Transform::getOpenGLMatrix not including rotation HOT 2
- void PhysicsWorld::createIslands() dirty contactPairIndex crash HOT 4
- Will it work for Android? HOT 2
- testbed build error with glDisableVertexAttribArray HOT 1
- Build failing - Missing include in configuration.h HOT 3
- Assertion failed in OverlappingPairs, version release 0.10.0 HOT 5
- Destroying an empty physics world leads to assertion failure (after upgrading to 0.10.0) HOT 2
- 0.10.0 - Raycasting gives incorrect results for HeightFieldShape when scaling factor is applied HOT 2
- Child somewhat-static collision shape HOT 1
- Ticking different objects at different rates HOT 1
- v0.10.0: Assertion Failed in NarrowPhaseInfoBatch::addContactPoint() HOT 2
- Why is the collision not happening how I think it should? HOT 3
- 0.10.0 - createConvexMeshShape example provided in manual doesn't work 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 reactphysics3d.