editor › Globals › JointHelper
Class: JointHelper
Hierarchy
- JointHelper
Index
Methods
Methods
Static joinObjectsByPossibility
▸ joinObjectsByPossibility(jointPossibilityA: any, jointPossibilityB: any, JointClass: any): any
Defined in src/model/data/Joints/Joints/JointHelper.ts:62
Translates two objects and then creates a joint between them
Parameters:
| Name | Type |
|---|---|
jointPossibilityA |
any |
jointPossibilityB |
any |
JointClass |
any |
Returns: any
the new instance of JointClass
Static joinObjectsByProximity
▸ joinObjectsByProximity(objectA: any, objectB: any, JointClass: any, params: object): any
Defined in src/model/data/Joints/Joints/JointHelper.ts:86
Creates a Joint between two objects if they are already aligned and the JointClass allows them to be joined
Parameters:
| Name | Type | Default |
|---|---|---|
objectA |
any | - |
objectB |
any | - |
JointClass |
any | - |
params |
object | {} |
Returns: any
Static recreateJointWithDifferentObject
▸ recreateJointWithDifferentObject(joint: Joint, objectToBeReplaced: PhysicalObject, replacementObject: PhysicalObject, createHelperJoint: boolean): any
Defined in src/model/data/Joints/Joints/JointHelper.ts:16
Tries to recreate a joint while replacing one of both objects. Example use case: A servo is joined with a plate, but the plate is subdivided and thus replaced with a new plate. Now, the servo should be joined with the new plate while maintaining its position
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
joint |
Joint | - | the joint to be recreated, will be destroyed |
objectToBeReplaced |
PhysicalObject | - | the object currently joined and to be replaced |
replacementObject |
PhysicalObject | - | the object that will replace one of both objects |
createHelperJoint |
boolean | true | Whether a temporary joint needs to be created to keep the assembly from falling apart |
Returns: any
array of newly created joints