Explore core concepts of gravity, collision handling, and force dynamics in physics scripting. This quiz assesses your understanding of realistic motion simulation, force calculation, and managing object interactions within a digital environment.
In a scripted 2D physics simulation, which of the following formulas best applies constant downward gravity to an object each frame?
Explanation: The correct way to apply gravity is by incrementally changing the object's vertical velocity using gravity multiplied by the time step (deltaTime). This mirrors real-world acceleration due to gravity. Subtracting gravity from position skips velocity, leading to unrealistic movement. Applying gravity to the x-axis does not simulate downward gravity. Adjusting mass with gravity is physically nonsensical in this context.
Which collision response best represents an elastic collision between two moving balls in a simulation?
Explanation: An elastic collision preserves both momentum and kinetic energy, resulting in an exchange of velocities depending on masses. One ball stopping and the other moving with combined speed represents a non-physical scenario. Sticking together after impact (option three) describes a perfectly inelastic collision. Simply reversing directions ignores mass and initial velocities, making it an inaccurate representation.
If an object slides across a surface and slows down due to friction, which script would most accurately simulate this effect?
Explanation: Friction is modeled by decreasing the velocity over time in the direction of movement, hence subtracting friction from the x-component of velocity is appropriate here. Adding friction to position bypasses velocity, resulting in improper simulation. Adjusting mass with friction is incorrect since friction does not affect mass. Modifying the y-velocity simulates vertical friction, whereas sliding here occurs along x.
When two objects collide and you want to instantly change their velocities based on impact force in a script, which concept should be applied?
Explanation: Impulse describes the change in momentum as a result of a force applied over a short time, which is how brief impacts are handled in collision scripts. Gravity does not become stronger during collision; its effect is continuous. Friction never increases speed; it reduces it. Velocity cannot be ignored since it directly impacts the momentum before and after the collision.
In physics scripting, what method is typically used to check if two rectangular objects have collided?
Explanation: The standard approach is to compare the bounding boxes of objects to determine if they overlap, indicating a collision. Multiplying velocities or subtracting masses does not relate to collision detection. Adding gravity values is unrelated to detecting overlaps between objects, as gravity refers to force, not spatial proximity.