Пример #1
0
        public static void Move(Particle body, float dt, AABB worldBox)
        {
            body.pt += body.velocity * dt;

            // naive implementation, flip if hits border
			if (body.pt.X < worldBox.Min.X || body.pt.X > worldBox.Max.X)
				body.velocity.X *= -1;
			if (body.pt.Y < worldBox.Min.Y || body.pt.Y > worldBox.Max.Y)
				body.velocity.Y *= -1;
			if (body.pt.Z < worldBox.Min.Z || body.pt.Z > worldBox.Max.Z)
				body.velocity.Z *= -1;
        }
Пример #2
0
 public static void Move(Particle body, float dt)
 {
     body.pt += body.velocity * dt;
 }