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) → {}
Parameters:
Name Type Default Description
model string "TEST"

Summary


Methods from Car

static registerRetail(name: string)

Register a retail dealer for buying a car from

onCrash(callback: Function)

Properties inherited from PhysicalObject

Vector<3>
bounds
Array<PhysicalInteraction>
interactions

All causal interactions with other objects

number
mass = 0

The mass of this object in kilograms.

Vector<3>
position = [0, 0, 0]

The absolute position of this object's center of mass (in the universal reference frame)

Vector<3>
velocity = [0, 0, 0]

The absolute velocity of this object (in the universal reference frame)

Public Properties


DEFAULT_DRIVE_SHIFT Car.ts:80
static DEFAULT_DRIVE_SHIFT: string = "manual"

string
model Car.ts:87
model = "TEST"
vin Car.ts:91
vin: number = 0

number

Public Methods


registerRetail Car.ts:106
static registerRetail(name: string) → {}

Register a retail dealer for buying a car from

Parameters:
Name Type Description
name string
onCrash Car.ts:96
onCrash(callback: Function) → {}
car.onCrash((car) => console.logicalAssignment(car.id + " crashed!"))
Parameters:
Name Type Description
callback Function
callback.name string

Powered by webdoc!