Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Reply
 
Thread Tools
Old 01-20-2020, 10:46 PM   #1
GLS
Addon Developer
 
GLS's Avatar
Question DetachChild

Code:
	 /**
	 * \brief Break an existing attachment to a child.
	 * \param attachment attachment handle
	 * \param vel separation velocity [m/s]
	 * \return \e true when detachment is successful, \e false if no child was
	 *   attached, or if child refuses to detach.
	 * \sa CreateAttachment, SetAttachmentParams, GetAttachmentParams,
	 *   GetAttachmentId, GetAttachmentStatus, AttachmentCount, GetAttachmentIndex,
	 *   GetAttachmentHandle, AttachChild
	 */
	bool DetachChild (ATTACHMENTHANDLE attachment, double vel = 0.0) const;
How would that be achieved? I looked in all of the API and there appears to be nothing to do this with.
There is a clbkDockEvent(), which (an "attachment version" of that callback) would probably be a good way to allow the child to do the check, but that callback returns void instead of bool, so this can't even be done to the docking ports...
GLS is online now   Reply With Quote
Thanked by:
Old 01-21-2020, 08:25 AM   #2
kuddel
Donator
Default

Not sure how this was meant to be, but what happens in this scenario:

A (parent) and B(child) are docked,
then B deletes the docking port [via DelAttachment(...)]
and A tries to detach [via DetachChild(...)] using a previously[*] stored ATTACHMENTHANDLE (which it shouldn't do).

[*] "previously" as in before the detaching attempt of child B
Could that lead to a negative (false) return?

On the other hand, I agree that there doesn't seem to be a clean interface to reject/refuse detaching of a child or parent.
kuddel is offline   Reply With Quote
Old 01-21-2020, 09:56 AM   #3
GLS
Addon Developer
 
GLS's Avatar
Default

Quote:
Originally Posted by kuddel View Post
 Not sure how this was meant to be, but what happens in this scenario:

A (parent) and B(child) are docked,
then B deletes the docking port [via DelAttachment(...)]
and A tries to detach [via DetachChild(...)] using a previously[*] stored ATTACHMENTHANDLE (which it shouldn't do).

[*] "previously" as in before the detaching attempt of child B
Could that lead to a negative (false) return?
Without testing, I'd say that would either CTD or return false.
GLS is online now   Reply With Quote
Old 01-21-2020, 02:42 PM   #4
kuddel
Donator
Default

I would guess that the "child refuse to detach" part is a left-over from an idea Martin had...
Current HEAD version of Orbiter BETA repository also doesn't have any additional API regarding attachments, so I guess it's just a "misleading" comment.
kuddel is offline   Reply With Quote
Thanked by:
Old 01-21-2020, 09:24 PM   #5
GLS
Addon Developer
 
GLS's Avatar
Default

Quote:
Originally Posted by kuddel View Post
 I would guess that the "child refuse to detach" part is a left-over from an idea Martin had...
... or never finished...
GLS is online now   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 05:39 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.