Questions tagged [rigid-bodies]

Rigid body is a solid body which deformation is neglected. The mechanics of a rigid body are completely reducible to the mechanics of material points but it has its own content.

In a rigidBody is a component of a which allows the engine to calculate the behavior of the object and simulate a variety of physical interactions and collisions with other game objects.

Additional information:

Wikipedia article about Rigid Bodies

Unity RigidBody scripting reference

431 questions
30
votes
5 answers

How to make a 2D Soft-body physics engine?

The definition of rigid body in Box2d is A chunk of matter that is so strong that the distance between any two bits of matter on the chunk is completely constant. And this is exactly what i don't want as i would like to make 2D (maybe 3D…
Griffin
  • 2,399
  • 7
  • 48
  • 83
9
votes
1 answer

How can I make my physics object settle down?

I'm using BulletSharp, a C# distribution of the bullet library. I have been getting some bouncing in an object that supposedly has Restitution of 0.0f. I have one dynamic cylinder (what will be a mesh soon) falling to rest on two static cylinders. …
tugs
  • 583
  • 3
  • 18
8
votes
2 answers

Rigid Body Simulation Friction

I'm currently working on a 3D Rigid Body simulation program. I have currently managed to get the rigid bodies colliding with the floor and bouncing correctly using the impulse. However, my problem is once they have bounced they accelerate constantly…
Tommy Smith
  • 83
  • 1
  • 5
7
votes
4 answers

How to Prevent RigidBody from passing through other colliders

I've got a coin RigidBody and walls around it with box colliders. For trial purpose I've applied the following code to the coin. private void OnMouseDown() { rigidbody.AddForce(30.0f, 0f, 5.0f, ForceMode.Impulse); } But, sometimes the coin…
Ashish Beuwria
  • 975
  • 6
  • 13
  • 17
6
votes
5 answers

How can I compute the mass and moment of inertia of a polyhedron?

For use in a rigid body simulation, I want to compute the mass and inertia tensor (moment of inertia), given a triangle mesh representing the boundary of the (not necessarily convex) object, and assuming constant density in the interior.
batty
  • 7,528
  • 9
  • 31
  • 30
6
votes
2 answers

Integrate angular velocity as quaternion rotation

I have (somewhat blindly) been using quaternions for rotations in physics rigid body simulation for a while, but recently started getting confused about how quaternion rotations are generally defined and how I do it (based on the book Physics for…
JoeTaicoon
  • 1,383
  • 1
  • 12
  • 28
5
votes
1 answer

Add velocity to an object relative to its local axis

So I am struggling to realize how can I add velocity to a rb object relative to its rotation. Here is my script: using System.Collections; using System.Collections.Generic; using UnityEngine; using Cinemachine; …
user14656666
5
votes
1 answer

Kinematic Rigidbody moves on its own

I have a very weird issue in my 2D Unity game, which I was able to reduce to the following core problem/minimal reproducing test case. Follow these steps to reproduce (Unity 5.1.1f1): Create a player object (Cube) at location (0,0,0). Remove the…
scenia
  • 1,609
  • 14
  • 33
5
votes
2 answers

Unity. Attempting fake internal ship gravity. Rigid body children of rotating object keep sliding around

I'm attempting to simulate a ship/space station with internal gravity. To accomplish this, I'm making the player and all contents of the ship children of the ship. The ship itself has colliders, but no rigid body components. The idea is that as the…
Meathelix
  • 51
  • 2
5
votes
3 answers

Re-positioning a Rigid Body in Bullet Physics

I am writing a character animation rendering engine that uses Bullet Physics as a physics simulation engine. A sequence will start out with no model on the screen, then an animation will be assigned to that model, the model will be moved to frame 0…
bearsomg
  • 51
  • 1
  • 1
  • 4
4
votes
1 answer

unity - jump with rigidbody bug

I am trying to jump with rigidbody, and sometimes my jump is low like it stacks in something and sometimes is high. Why does it change? thank's for the answers My code: private void Update() { if (Input.GetKeyDown(KeyCode.Space) && isGrounded)…
4
votes
2 answers

Controlling a moving non-kinematic rigidbody along a path

I am working on an endless runner game for Android by Unity. I dont want to use a kinematic rigidbody. So physics is involved but the rigidbody is supposed to run along a predefined path by default. (and jumps or changes lanes by user actions).…
Aykut Karaca
  • 350
  • 3
  • 15
4
votes
1 answer

Unity: 3D movement/Collision detection failure (AddForce, MovePosition, transform.localPosition)

Problem: If I get the movement to work correctly, then the collision meshes are not detected. If I get the collision meshes detected, then the movement doesn't work correctly. Brief summary of project: I have a 3D environment with non-moveable…
user70711
  • 131
  • 1
  • 9
4
votes
1 answer

Damping a spring without affecting gravity

I implemented a spring particle system in OpenGL, where a particle B is constrained to A, with given offset distance. Particle B is affected by spring force and gravity. Here is the implementation: vec3 velocity; float k = 1.0f; float damping =…
Lenny White
  • 406
  • 4
  • 8
4
votes
2 answers

Predict the position of a Rigidbody Object in x second

Let's say that you have a Rigidbody Object that moves. Force is added to this Object via Rigidbody.AddForce or Rigidbody.velocity. The Object can roll hit another Object and change direction. I know about Extrapolation but in this case, it's nearly…
Programmer
  • 121,791
  • 22
  • 236
  • 328
1
2 3
28 29