Pastel Comment: Class Vehicle
< Add the section you are commenting on and a subject to the issue title >
Document version of this comment
Branch: v1.3.0-RC2
Description:
< Add feedback here. Recommended: Add a screenshot of the part you want to comment on. Use a screenshot tool and CTRL + C and CTRL + V. >
These trailerHitch, and trailerCoupler elements will likely satisfy users’ needs for trailers, but there other use cases that involve attaching objects to vehicles that are nearly the same that this system does not support, and so I think a more general system should be considered.
Imagine a passenger vehicle with a bicycle rack on the back, or a pickup truck with a refrigerator in the back, that falls off of the truck. The same parent, and child attachment point information will be needed, but an x positional offset, as well as orientation may be needed. Additionally, a user may want these parent/child attachments to change during simulation, and having the parenting information saved here in the vehicle (trailer element) does not allow that.
Suggestion:
< Add a suggestion or things you want to change after this >
My proposal would be to add a list of named attachment points (AttachmentPoint type) to the vehicle, and MiscObject types, (maybe Pedestrian also), and add an AttachChild and DetachChild PrivateActions. These objects would look like this:
- AttachmentPoint object:
- Description: Holds attachment point name, and offset data
- Data:
- Attachment point name
- x,y,z offset from object origin
- (optional) yaw, pitch, roll orientation relative to object origin
- AttachChild action:
- Description: Causes an entity to be attached (parented to) another entity.
- Data:
- ChildEntityRef: child entity to be attached
- ParentAttachPoint: the name of the parent attachment point.
- ChildAttachPoint: the name of the child attachment point.
- Attachment type enum: fixed, balljoint
- Could add more joint types later: universal, revolute, prismatic, etc.
- The EntityRef of the parent would be contained in one of:
- entityRef element of the Private object for InitActions
- ManeuverGroup's Actors element for Story actions.
- DetachChild action:
- Description: Causes a previously attached child object to become detached from its parent.
- Data:
- ChildEntityRef: child entity to be detached
- The EntityRef of the parent would be contained in one of:
- entityRef element of the Private object for InitActions
- ManeuverGroup's Actors element for Story actions.
If this proposal were adopted, I would also advocate for the removal of the new 'trailer' element in vehicle, so that users always use an AttachChild action for parenting objects in order to make the use of the system more consistent.