Class: GlueJoint
Class that represents a connection by glue.
Hierarchy
↳ GlueJoint
Index
Constructors
Properties
Methods
- _ensureAssigned
- _onObjectShapeChange
- _onObjectTransformsChange
- assign
- createTemporaryClone
- destroy
- getDestroyEventEmitter
- getIsAssigned
- getOtherPhysicalObject
- getPhysicalObjects
- isPhysicallyConnected
- recreate
- canBeJoined
- createFromPhysicalObjects
- getJointsBetween
- getRequiredPossibilities
- getSpansAcrossAssemblies
- performPreJoinTransformation
Constructors
constructor
+ new GlueJoint(jointPossibilityA?: JointPossibility, jointPossibilityB?: JointPossibility): GlueJoint
Inherited from Joint.constructor
Defined in src/model/data/Joints/Joints/Joint.ts:72
Either supply joint possibilities in constructor, or defer it and do it later with assign()
Parameters:
| Name | Type |
|---|---|
jointPossibilityA? |
JointPossibility |
jointPossibilityB? |
JointPossibility |
Returns: GlueJoint
Properties
Protected Readonly destroyEventEmitter
• destroyEventEmitter: EventEmitter‹void› = new EventEmitter
Inherited from Joint.destroyEventEmitter
Defined in src/model/data/Joints/Joints/Joint.ts:72
Protected isDestroyed
• isDestroyed: boolean = false
Inherited from Joint.isDestroyed
Defined in src/model/data/Joints/Joints/Joint.ts:71
Protected objectA
• objectA: PhysicalObject
Defined in src/model/data/Joints/Joints/Joint.ts:69
Protected objectB
• objectB: PhysicalObject
Defined in src/model/data/Joints/Joints/Joint.ts:70
Methods
_ensureAssigned
▸ _ensureAssigned(): void | never
Inherited from Joint._ensureAssigned
Defined in src/model/data/Joints/Joints/Joint.ts:122
Returns: void | never
Protected _onObjectShapeChange
▸ _onObjectShapeChange(changedObject: PhysicalObject): void
Inherited from Joint._onObjectShapeChange
Defined in src/model/data/Joints/Joints/Joint.ts:219
Method that is called when the shapes of one of the joined objects change. Can be overwritten in subclass.
Parameters:
| Name | Type |
|---|---|
changedObject |
PhysicalObject |
Returns: void
Protected _onObjectTransformsChange
▸ _onObjectTransformsChange(changedObject: PhysicalObject): void
Inherited from Joint._onObjectTransformsChange
Defined in src/model/data/Joints/Joints/Joint.ts:211
Method that is called when the transforms of one of the joined objects change. Can be overwritten in subclass.
Parameters:
| Name | Type |
|---|---|
changedObject |
PhysicalObject |
Returns: void
assign
▸ assign(jointPossibilityA: JointPossibility, jointPossibilityB: JointPossibility): void
Defined in src/model/data/Joints/Joints/Joint.ts:94
If the joint was created without specifying objects, this can be done later by using assign(). Joins the two objects together
Parameters:
| Name | Type |
|---|---|
jointPossibilityA |
JointPossibility |
jointPossibilityB |
JointPossibility |
Returns: void
createTemporaryClone
▸ createTemporaryClone(): Joint
Inherited from Joint.createTemporaryClone
Defined in src/model/data/Joints/Joints/Joint.ts:183
This method creates a new Joint with the two physicalObjects of this joint instance. This is useful for operations where you need a temporary joint to keep an assembly from falling apart (e.g. Joint.recreate).
Returns: Joint
the temporary joint
destroy
▸ destroy(): void | never
Defined in src/model/data/Joints/Joints/Joint.ts:158
Removes itself from the attached PhysicalObjects. The instance is invalid afterwards.
Returns: void | never
getDestroyEventEmitter
▸ getDestroyEventEmitter(): IPublicEventEmitterInterface‹void›
Inherited from Joint.getDestroyEventEmitter
Defined in src/model/data/Joints/Joints/Joint.ts:86
Returns: IPublicEventEmitterInterface‹void›
getIsAssigned
▸ getIsAssigned(): boolean
Inherited from Joint.getIsAssigned
Defined in src/model/data/Joints/Joints/Joint.ts:118
Returns: boolean
true, if the joint has been assigned to two objects
getOtherPhysicalObject
▸ getOtherPhysicalObject(thisPhysicalObject: PhysicalObject): PhysicalObject | never
Inherited from Joint.getOtherPhysicalObject
Defined in src/model/data/Joints/Joints/Joint.ts:131
Convenience function to get the 'other' physical object that is connected to this joint
Parameters:
| Name | Type |
|---|---|
thisPhysicalObject |
PhysicalObject |
Returns: PhysicalObject | never
getPhysicalObjects
▸ getPhysicalObjects(): [PhysicalObject, PhysicalObject]
Inherited from Joint.getPhysicalObjects
Defined in src/model/data/Joints/Joints/Joint.ts:146
Returns: [PhysicalObject, PhysicalObject]
isPhysicallyConnected
▸ isPhysicallyConnected(a?: any, b?: any): boolean
Inherited from Joint.isPhysicallyConnected
Defined in src/model/data/Joints/Joints/Joint.ts:202
Determines whether a joint still makes sense. Override in subclass
Parameters:
| Name | Type |
|---|---|
a? |
any |
b? |
any |
Returns: boolean
true, if both joined objects are still physically connected, false, if not
recreate
▸ recreate(): void
Defined in src/model/data/Joints/Joints/Joint.ts:194
This method creates a new instance of this joint while destroying the old instance. The new instance is created with the same parameters as this one. This is used in cases where the underlying data changes, but the references are still valid. E.g. an outline section moves between physicalObjects and the joint needs to be recreated with the new objects. However the referenced outline section is still valid.
Returns: void
Static canBeJoined
▸ canBeJoined(physicalObjectA: PhysicalObject, physicalObjectB: PhysicalObject): boolean
Inherited from Joint.canBeJoined
Defined in src/model/data/Joints/Joints/Joint.ts:56
Determines whether two objects can be joined with this type of joint based on their current transforms. Use together with createFromPhysicalObjects Override in subclass.
Parameters:
| Name | Type |
|---|---|
physicalObjectA |
PhysicalObject |
physicalObjectB |
PhysicalObject |
Returns: boolean
Static createFromPhysicalObjects
▸ createFromPhysicalObjects(physicalObjectA: PhysicalObject, physicalObjectB: PhysicalObject): [GlueJoint]
Overrides Joint.createFromPhysicalObjects
Defined in src/model/data/Joints/Joints/GlueJoint.ts:9
Parameters:
| Name | Type |
|---|---|
physicalObjectA |
PhysicalObject |
physicalObjectB |
PhysicalObject |
Returns: [GlueJoint]
Static getJointsBetween
▸ getJointsBetween‹T›(plateA: Plate, plateB: Plate, type: Constructor‹T›): T[]
Inherited from Joint.getJointsBetween
Defined in src/model/data/Joints/Joints/Joint.ts:11
Type parameters:
▪ T: Joint
Parameters:
| Name | Type |
|---|---|
plateA |
Plate |
plateB |
Plate |
type |
Constructor‹T› |
Returns: T[]
Static getRequiredPossibilities
▸ getRequiredPossibilities(): [JointPossibility, JointPossibility]
Inherited from Joint.getRequiredPossibilities
Defined in src/model/data/Joints/Joints/Joint.ts:21
Defines the required JointPossibilities in order to instantiate this kind of Joint. Override in subclass.
Returns: [JointPossibility, JointPossibility]
an array with exactly two JointPossibility (sub)classes.
Static getSpansAcrossAssemblies
▸ getSpansAcrossAssemblies(): boolean
Inherited from Joint.getSpansAcrossAssemblies
Defined in src/model/data/Joints/Joints/Joint.ts:65
Returns: boolean
whether joints of this class span across assemblies. In that case, physical objects will be linked with physics constraints rather than merging assemblies during joining
Static performPreJoinTransformation
▸ performPreJoinTransformation(jointPossibilityA: JointPossibility, jointPossibilityB: JointPossibility): void
Inherited from Joint.performPreJoinTransformation
Defined in src/model/data/Joints/Joints/Joint.ts:29
Translates the objects in order to make sure they can be joined. Override in subclass with actual translation logic.
Parameters:
| Name | Type |
|---|---|
jointPossibilityA |
JointPossibility |
jointPossibilityB |
JointPossibility |
Returns: void