@physion/app / Exports / GearNode
Class: GearNode
Represents a simple spur gear.
The gear geometry is specified by 3 parameters:
Radius is essentially the outer radius of the gear. The height of each gear tooth is defined by toothHeight. This means that the inner radius of the gear is radius - toothHeight. Finally the density of the gear teeth is specified by toothDensity.
Hierarchy
-
↳
GearNode
Constructors
constructor
• new GearNode(radius?, toothHeight?, toothDensity?): GearNode
Parameters
| Name | Type | Default value |
|---|---|---|
radius | number | defaultRadius |
toothHeight | number | defaultToothHeight |
toothDensity | number | defaultToothDensity |
Returns
Overrides
Properties
userData
• userData: Record<string, unknown>
Inherited from
EVT_CHILD_ADDED
▪ Static Readonly EVT_CHILD_ADDED: "childAdded"
The name of the event that is emitted whenever a child is added to this node.
The argument supplied is the child that was just added to this node.
Inherited from
MultipartBodyNode.EVT_CHILD_ADDED
EVT_CHILD_REMOVED
▪ Static Readonly EVT_CHILD_REMOVED: "childRemoved"
The name of the event that is emitted whenever a child is removed from this node.
The argument supplied is the child that was just removed from this node.
Inherited from
MultipartBodyNode.EVT_CHILD_REMOVED
EVT_CHILD_REORDERED
▪ Static Readonly EVT_CHILD_REORDERED: "childReordered"
The name of the event that is emitted whenever a child of this node is reordered.
The arguments supplied are: (1) The child that was just reordered (2) the old index of the child and (3) the new index of the child.
Inherited from
MultipartBodyNode.EVT_CHILD_REORDERED
EVT_NAME_CHANGED
▪ Static Readonly EVT_NAME_CHANGED: "nameChanged"
The name of the event that is emitted whenever the name of this object changes.
The argument suplied is the new CoreObject.name of the object.
Inherited from
MultipartBodyNode.EVT_NAME_CHANGED
EVT_PROPERTY_CHANGED
▪ Static Readonly EVT_PROPERTY_CHANGED: "propertyChanged"
The name of the event that is emitted whenever a property of this object changes.
The arguments supplied are: (1) The name of the property that has changed and (2) the new value of that property.
Inherited from
MultipartBodyNode.EVT_PROPERTY_CHANGED
EVT_TRANSFORM_CHANGED
▪ Static Readonly EVT_TRANSFORM_CHANGED: "transformChanged"
The name of the event that is emitted whenever the x, y or angle properties of this Node are changed.
Note that this event is not emitted when x, y or angle properties are changed as a result of
an update().
Inherited from
MultipartBodyNode.EVT_TRANSFORM_CHANGED
ID_LENGTH
▪ Static Readonly ID_LENGTH: 12
Inherited from
MAX_NAME_LENGTH
▪ Static Readonly MAX_NAME_LENGTH: 128
Inherited from
MultipartBodyNode.MAX_NAME_LENGTH
MIN_RADIUS
▪ Static Readonly MIN_RADIUS: 0.2
MIN_TOOTH_DENSITY
▪ Static Readonly MIN_TOOTH_DENSITY: 1
MIN_TOOTH_HEIGHT
▪ Static Readonly MIN_TOOTH_HEIGHT: number = minToothHeight
Accessors
active
• get active(): boolean
Returns true if this body is active, otherwise returns false.
An inactive body will be visualized but it won't participate in the simulation.
Returns
boolean
Inherited from
MultipartBodyNode.active
• set active(v): void
Sets this body's active property
Parameters
| Name | Type |
|---|---|
v | boolean |
Returns
void
Inherited from
MultipartBodyNode.active
allowSleep
• get allowSleep(): boolean
Returns true if this body is allowed to sleep, otherwise returns false.
By default, all bodies are allowed to sleep. This basically means that when a body has come to rest and it has no collisions then it will go to sleep. Setting a body to sleep reduces then number of object we have to simulated (thus increasing performance).
Returns
boolean
Inherited from
MultipartBodyNode.allowSleep
• set allowSleep(v): void
Sets this body's allowSleep property
Parameters
| Name | Type |
|---|---|
v | boolean |
Returns
void
Inherited from
MultipartBodyNode.allowSleep
alpha
• get alpha(): number
Node's alpha
This value is between 0 (transparent) and 1.0 (opaque). This property can be considered as the "master" opacity of the node. Defaults to 1 (fully opaque)
Returns
number
Inherited from
MultipartBodyNode.alpha
• set alpha(v): void
Parameters
| Name | Type |
|---|---|
v | number |
Returns
void
Inherited from
MultipartBodyNode.alpha
angle
• get angle(): number
Returns the angle (in degrees) of this body
Returns
number
Inherited from
MultipartBodyNode.angle
• set angle(v): void
Sets the angle (in degrees) of this body
Parameters
| Name | Type |
|---|---|
v | number |
Returns
void
Inherited from
MultipartBodyNode.angle
angularDamping
• get angularDamping(): number
Returns
number
Inherited from
MultipartBodyNode.angularDamping
• set angularDamping(v): void
Parameters
| Name | Type |
|---|---|
v | number |
Returns
void
Inherited from
MultipartBodyNode.angularDamping
angularVelocity
• get angularVelocity(): number
Returns
number
Inherited from
MultipartBodyNode.angularVelocity
• set angularVelocity(v): void
Parameters
| Name | Type |
|---|---|
v | number |
Returns
void
Inherited from
MultipartBodyNode.angularVelocity
blendMode
• get blendMode(): BLEND_MODES
Returns
BLEND_MODES
Inherited from
MultipartBodyNode.blendMode
• set blendMode(v): void
Parameters
| Name | Type |
|---|---|
v | BLEND_MODES |
Returns
void
Inherited from
MultipartBodyNode.blendMode