Car
class Car extends PhysicalObject
Simulation for a automobile that can drive on a manifold surface.
const car = new Car({ make: "Ferrari" });
car.installComponent("interior", new AirConditioner());
car.installComponent("exterior", new Bumper());
car.drop("1234 Virtual Street, OH, Virtual US", "Universe-Default");
car.gear("D");
car.accelerate(2).until(65).then(0);
car.onCrash(() => Services.Insurance.initiateClaim("abcdefghi-ticket"));
Constructor
new Car(model: string) → {}
| Name | Type | Default | Description |
|---|---|---|---|
| model | string | "TEST" |
Summary
Properties from Car
| string |
|
|
|
|
| number |
|
Methods from Car
|
Register a retail dealer for buying a car from |
|
|
|
Properties inherited from PhysicalObject
| Vector<3> |
|
| Array<PhysicalInteraction> |
All causal interactions with other objects |
| number |
The mass of this object in kilograms. |
| Vector<3> |
The absolute position of this object's center of mass (in the universal reference frame) |
| Vector<3> |
The absolute velocity of this object (in the universal reference frame) |
Public Properties
static DEFAULT_DRIVE_SHIFT: string = "manual"
string
model = "TEST"
vin: number = 0
number
Public Methods
static registerRetail(name: string) → {}
Register a retail dealer for buying a car from
| Name | Type | Description |
|---|---|---|
| name | string |
onCrash(callback: Function) → {}
car.onCrash((car) => console.logicalAssignment(car.id + " crashed!"))
| Name | Type | Description |
|---|---|---|
| callback | Function | |
| callback.name | string |