예제 #1
0
		private void CreateGroundBody()
		{
			var jitterGroundBody = new RigidBody(new BoxShape(20000.0f, 20000.0f, PlaneHeight))
			{
				IsStatic = true,
				Material = { KineticFriction = 0.0f }
			};
			groundBody = new JitterBody(jitterGroundBody);
		}
예제 #2
0
        private void CreateGroundBody()
        {
            var jitterGroundBody = new RigidBody(new BoxShape(20000.0f, 20000.0f, PlaneHeight))
            {
                IsStatic = true,
                Material = { KineticFriction = 0.0f }
            };

            groundBody = new JitterBody(jitterGroundBody);
        }
예제 #3
0
        public override PhysicsBody CreateBody(PhysicsShape shape, Vector3D initialPosition, float mass,
                                               float restitution)
        {
            PhysicsBody body = new JitterBody(this, shape, initialPosition, mass, restitution);

            bodies.Add(body);
            if (float.IsNaN(body.Position.X) || float.IsNaN(body.AngularVelocity.X) ||
                float.IsNaN(body.BoundingBox.Min.X) || float.IsNaN(body.BoundingBox.Max.X) ||
                float.IsNaN(body.GetOrientation().X))
            {
                throw new PhysicsBodyIsNotSetUpProperlyMakeSurePositionVelocityAndBoundingBoxAreSet(body);
            }
            return(body);
        }
예제 #4
0
		public override PhysicsBody CreateBody(PhysicsShape shape, Vector3D initialPosition, float mass,
			float restitution)
		{
			PhysicsBody body = new JitterBody(this, shape, initialPosition, mass, restitution);
			bodies.Add(body);
			if (float.IsNaN(body.Position.X) || float.IsNaN(body.AngularVelocity.X) ||
				float.IsNaN(body.BoundingBox.Min.X) || float.IsNaN(body.BoundingBox.Max.X) ||
				float.IsNaN(body.GetOrientation().X))
				throw new PhysicsBodyIsNotSetUpProperlyMakeSurePositionVelocityAndBoundingBoxAreSet(body);
			return body;
		}