Class: Joint
Hierarchy
- Joint
↳ TeeJoint
Index
Constructors
Properties
Methods
- _ensureAssigned
- _onObjectShapeChange
- _onObjectTransformsChange
- assign
- createTemporaryClone
- destroy
- flip
- getDestroyEventEmitter
- getDirection
- getId
- getIsAssigned
- getOtherPhysicalObject
- getPhysicalObjects
- getPlateA
- getPlateB
- isPhysicallyConnected
- recreate
- canBeJoined
- createFromPhysicalObjects
- getJointsBetween
- getRequiredPossibilities
- getSpansAcrossAssemblies
- performPreJoinTransformation
Constructors
constructor
+ new Joint(jointPossibilityA?: JointPossibility, jointPossibilityB?: JointPossibility): Joint
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: Joint
Properties
Protected Readonly destroyEventEmitter
• destroyEventEmitter: EventEmitter‹void› = new EventEmitter
Defined in src/model/data/Joints/Joints/Joint.ts:72
Private Readonly direction
• direction: IDirectionSpace
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:10
Private Readonly id
• id: number = Joint.maxId++
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:6
Protected isDestroyed
• isDestroyed: boolean = false
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
Private Readonly plateA
• plateA: Plate
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:8
Private Readonly plateB
• plateB: Plate
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:9
Static Private maxId
▪ maxId: number = 0
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:5
Methods
_ensureAssigned
▸ _ensureAssigned(): void | never
Defined in src/model/data/Joints/Joints/Joint.ts:122
Returns: void | never
Protected _onObjectShapeChange
▸ _onObjectShapeChange(changedObject: PhysicalObject): void
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
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
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
flip
▸ flip(): Joint
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:29
Returns: Joint
getDestroyEventEmitter
▸ getDestroyEventEmitter(): IPublicEventEmitterInterface‹void›
Defined in src/model/data/Joints/Joints/Joint.ts:86
Returns: IPublicEventEmitterInterface‹void›
getDirection
▸ getDirection(): IDirectionSpace
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:21
Returns: IDirectionSpace
getId
▸ getId(): number
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:25
Returns: number
getIsAssigned
▸ getIsAssigned(): boolean
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
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]
Defined in src/model/data/Joints/Joints/Joint.ts:146
Returns: [PhysicalObject, PhysicalObject]
getPlateA
▸ getPlateA(): Plate‹›
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:13
Returns: Plate‹›
getPlateB
▸ getPlateB(): Plate‹›
Defined in src/modules/kyub.core.reinforcement/src/Joint.ts:17
Returns: Plate‹›
isPhysicallyConnected
▸ isPhysicallyConnected(a?: any, b?: any): boolean
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
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(objectA: PhysicalObject, objectB: PhysicalObject, JointClass: object): Joint[]
Defined in src/model/data/Joints/Joints/Joint.ts:43
Convenience method to create a joint based on two PhysicalObjects that are already in the same assembly and correctly positioned. Override in subclass.
Parameters:
| Name | Type | Default |
|---|---|---|
objectA |
PhysicalObject | - |
objectB |
PhysicalObject | - |
JointClass |
object | Joint |
Returns: Joint[]
all created joints
Static getJointsBetween
▸ getJointsBetween‹T›(plateA: Plate, plateB: Plate, type: Constructor‹T›): T[]
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]
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
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
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