import Component from '../core/Component.js'; import Vector2 from '../math/Vector2.js'; /** * Component that holds physics-related data for a GameObject. */ export default class PhysicsComponent extends Component { /** Current velocity in pixels per second. */ velocity: Vector2; /** Current acceleration in pixels per second squared. */ acceleration: Vector2; /** Mass of the object (used for physics resolution). */ mass: number; /** Whether the object is immovable (e.g., walls). */ isStatic: boolean; /** Bounciness of the object (0 = inelastic, 1 = perfectly elastic). */ restitution: number; /** Resistance to sliding. */ friction: number; /** Whether the object should detect collisions but not respond to them physically. */ isSensor: boolean; }