BEPUphysics.Entities.Entity.BecomeDynamic C# (CSharp) Method

BecomeDynamic() public method

Forces the entity to become dynamic. Dynamic entities respond to collisions and have finite mass and inertia.
public BecomeDynamic ( float mass ) : void
mass float Mass to use for the entity.
return void
        public void BecomeDynamic(float mass)
        {
            Matrix3x3 inertiaTensor = collisionInformation.Shape.ComputeVolumeDistribution();
            Matrix3x3.Multiply(ref inertiaTensor, mass * InertiaHelper.InertiaTensorScale, out inertiaTensor);
            BecomeDynamic(mass, inertiaTensor);
        }

Same methods

Entity::BecomeDynamic ( float mass, Matrix3x3 localInertiaTensor ) : void

Usage Example

Beispiel #1
0
		public BepuBody(Entity realBody)
		{
			RealBody = realBody;
			RealBody.Tag = -1;
			RealBody.BecomeDynamic((float)_mass);
			//RealBody.CollisionInformation.LocalPosition = new Vector3(0, 0, -10); //center of mass?
			BepuEntityCollidableToBepuBody.Add(realBody.CollisionInformation, this);
		 //TODO. fix after new bodies.
			/*   RealBody.CollisionInformation.Events.InitialCollisionDetected += 
			(thisBody, other, x)=>
				{
					if (other is EntityCollidable)
						Body.RaiseCollisionEvent(BepuEntityCollidableToBepuBody[other as EntityCollidable].Body);
				};*/
			//IsStatic = false;
		}
All Usage Examples Of BEPUphysics.Entities.Entity::BecomeDynamic