- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
import {Vector} from "./Vector";
/**
* Represents a physical-object and its intrinsic properties. This is useful for approximating
* extended objects as a uniform, continous body mass (ignoring its particulate composition).
*
* ```mermaid
* flowchart TD
* PhysicalObject --> position
* ```
*/
export class PhysicalObject {
constructor() {
/**
* The mass of this object in kilograms.
*
* @member {number}
* @default 0
*/
this.mass = 0;
/**
* The absolute position of this object's center of mass (in the universal reference frame)
*
* @member {Vector<3>}
* @default [0, 0, 0]
*/
this.position = Vector.create3D();
/**
* The absolute velocity of this object (in the universal reference frame)
*
* @member {Vector<3>}
* @default [0, 0, 0]
*/
this.velocity = Vector.create3D();
/**
* The mesh enclosing this object. By default, it is a "point" object at the its own
* position.
*
* @member {Vector<3>}
*/
this.bounds = [this.position];
/**
* All causal interactions with other objects
*
* @member {Array<PhysicalInteraction>}
*/
this.interactions = [];
}
}
/**
* This is another road class.
*
* @memberof R
*/
class Road {
}
/**
* Checks whether the object is an instance of {@code PhysicalObject}.
* @param {Object} object
* @return {boolean}
* @author Shukant K. Pal <shukantpal@outlook.com>
* @see PhysicalObject
* @license MIT
* @since 2020
* @copyright Shukant K. Pal (C) 2020
*/
export function isPhysicalObject(object) {
return true;
}