import PhysicsEngine from '@mobilizing/library/js/Mobilizing/renderer/3D/three/physics/PhysicsEngine.js'
PhysicsEngine
Extends:
Constructor Summary
Public Constructor | ||
public | constructor(params: Object) |
Member Summary
Public Members | ||
public | G: * | |
public | bodies: *[] | |
public | ||
public | globalwind: * | |
public | iterations: * | |
public | joints: *[] | |
public | ke: * | |
public |
Private Members | ||
private | _time: * |
Method Summary
Public Methods | ||
public | addBody | |
public | addElectrostaticsJoint(body1: Mesh, body2: Mesh, charge1: Number, charge2: Number): Body addElectrostaticsJoint | |
public | addFixedJoint(body: Mesh, position: Vector3): Body addFixedJoint | |
public | addGravityJoint(body1: Mesh, body2: Mesh): Body addGravityJoint | |
public | addSpringJoint | |
public | addStickJoint(body1: Mesh, body2: Mesh, distance: Number): Body addStickJoint | |
public | addStringJoint(body1: Mesh, body2: Mesh, distance: Number): Body addStringJoint | |
public | setGlobalGravity(vector: Vector3) setGlobalGravity | |
public | setGlobalWind(vector: Vector3) setGlobalWind | |
public | setIterations(val: Number) Set the number of iteration made by the physic engine | |
public | setup() Initialization method | |
public | update() |
Inherited Summary
From class Component | ||
public | ||
public | context: * | |
public | events: * | |
public | id: * | |
public | name: * | |
private | _nexts: *[] | |
private | ||
public | byPass() | |
public | Adds a component to this chained component array | |
public | Returns the array of attached children components | |
public | off() Deactivate the component | |
public | on() Activate the component A call to this method calls the setup method if it has not been run yet | |
public | Run code after the update of all components is run This empty method is usually overriden to perform post-update actions for the component It is called periodically by an internal Mobilizing mechanism | |
public | preLoad() preLoad the component This empty method is usually overriden to perform preLoad actions for the component. | |
public | Run code before the update of all components is run This empty method is usually overriden to perform pre-update actions for the component It is called once per component by an internal Mobilizing mechanism | |
public | prepare() prepare the component This empty method is usually overriden to perform preparation actions for the component, from external process as a server. | |
public | setup() Set's up the component This empty method is usually overriden to perform setup actions for the component This is where all the initialization (such as adding event listeners)should be done It is called automatically by an internal Mobilizing mechanism and should thus not be called directly | |
public | update() Update the component This empty method is usually overriden to perform update actions for the component It is called periodically by an internal Mobilizing mechanism |
Public Constructors
public constructor(params: Object) source
Override:
Component#constructorPublic Members
public G: * source
public bodies: *[] source
public globalgravity: * source
public globalwind: * source
public iterations: * source
public joints: *[] source
public ke: * source
Private Members
private _time: * source
Public Methods
public addBody(position: Vector3, mass: Number, object: Mesh): Body source
addBody
Return:
Body | the added physic body |
public addElectrostaticsJoint(body1: Mesh, body2: Mesh, charge1: Number, charge2: Number): Body source
addElectrostaticsJoint
Return:
Body | the added joint body |
public addFixedJoint(body: Mesh, position: Vector3): Body source
addFixedJoint
Return:
Body | the added joint body |
public addGravityJoint(body1: Mesh, body2: Mesh): Body source
addGravityJoint
Return:
Body | the added joint body |
public addSpringJoint(body1: Mesh, body2: Mesh, distance: Number, k: Number, damping: Number): Body source
addSpringJoint
Return:
Body | the added joint body |
public addStickJoint(body1: Mesh, body2: Mesh, distance: Number): Body source
addStickJoint
Return:
Body | the added joint body |
public addStringJoint(body1: Mesh, body2: Mesh, distance: Number): Body source
addStringJoint
Return:
Body | the added joint body |
public setGlobalGravity(vector: Vector3) source
setGlobalGravity
Params:
Name | Type | Attribute | Description |
vector | Vector3 |
public setGlobalWind(vector: Vector3) source
setGlobalWind
Params:
Name | Type | Attribute | Description |
vector | Vector3 |
public setIterations(val: Number) source
Set the number of iteration made by the physic engine
Params:
Name | Type | Attribute | Description |
val | Number |
public update() source
Update the component This empty method is usually overriden to perform update actions for the component It is called periodically by an internal Mobilizing mechanism