|Description:||Creates a list of chained isEPE objects where all neighbors are connected via joint.|
Explanation regarding the massCoef:
The engine calculates the maximum mass from the fromObject and toObject. It takes into account that the objects may be attached to another object with a greater mass via the attachTo command. It will then use the maximum mass it finds between the two. So if a coke can is attached to a car, then the maximum mass will be the car's mass instead of the coke can. This is repeated for the toObject and if its attached to another object.
After it has calculated both the maximum mass of the fromObject and toObject it will choose the minimal mass of either one. This new minimal mass is divided against the total number of rope segments. This mass then is multiplied by the massCoef of 0.1 to derive at the final mass that will be applied to the rope segment being spawned and connected to each other via joints.In short, by applying a higher coef of 1.0 it will simulate a much strong heaver rope. By apply a lower coef of 0.01 you will have a lighter but weaker rope segment between the two objects that may break or fragment due to the mass of the object if its trying to pull a heavier object.
|Syntax:||createRope [fromObject, fromPoint, toObject, toPoint, ropeClassName, ropeBeg, ropeEnd, ropeSegments, [swingSpring, twistSpring, damping], collision, masscoef, maxlengthcoef, breakforce]|
- fromObject: Object - Object to start creating a rope from.
- fromPoint: String or Vector3D - Specifies where on the object the rope should start, either a string (name of memory point) or an array of three numbers (vector in model coordinates).
- toObject: Object - Object to attach last segment of rope to.
- toPoint: String or Vector3D - Specifies where on the object the rope should finish, either a string (name of memory point) or an array of three numbers (vector in model coordinates).
- ropeClassName: String - Name of class that will be created and that will represent a rope segment. Can be "vbs2_rope_segment","vbs2_rope_segment_0_6", or "vbs2_rope_segment_1_2".
- ropeBeg: String or Vector3D - Position on rope that will connect with the previous segment (either memory point name or vector - similar to fromPoint)
- ropeEnd: String or Vector3D - Position on rope that will connect with the next segment (either memory point name or vector - similar to fromPoint)
- ropeSegments: Number - Number of segments to be created
- swingSpring: Number - Spring created in swing directions, from interval <0, inf), 0 means no spring will be used
- twistSpring: Number - Spring created in twist directions, from interval <0, inf), 0 means no spring will be used
- damping: Number - Damping simulates environmental (air) friction and can be used for stabilizing the rope perpetual swinging, from interval <0, inf), 0 means no damping, reasonable values are around 0.2
- collision: Boolean - Disables collision between rope and attached vehicles and collisions between individual rope segments (Optional, default: true) (V1.31+)
- masscoef: Number - (Optional, default: 1.0) (V1.42+)
- maxlengthcoef: Number - Stability of the rope can be increased by setting maxLengthCoef. A value of 1.05 means that the rope can stretch by 5% over its max length. 0 disables this technology. This parameter can't be used on breakable ropes - If the rope is breakable (breakforce is set), then this parameter is ignored. (Optional, default: 0) (V1.34+)
- breakforce: Number - When forces acting on rope's joints exceeds breakForce the rope will break. Value less or equal to zero disables this technology. (Optional) (V1.40+)
|Return Value:||Array - Two nested arrays with created rope segments.|
rope1 = createRope [heli, [0,0,-1], box, [0,0,2], "vbs2_rope_segment_0_6", "bottom", "top", 10, [10,10,0.2], true, 0.1, 1, 20000];
|See also:|| destroyRope, winchCreate, isEPE |