Fix to foreground orbits - spacecraft now look really cool!!

Report bugs, bug fixes and workarounds here.
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 11 months
Location: Los Angeles, CA

Post #21by BlindedByTheLight » 06.06.2005, 07:16

doctorjoe... wow - that was quick! Really looking forward to trying it. One problem, though. I can't seem apply the patch:

I saved the patch in a textfile called "patchfile.diff".

In Terminal (Mac OS X's line command app), I typed in:

1) cd celestia/src/celengine (I think that gets me to the right directory)
2) patch -p0 < patchfile.diff

But all I got was:

Steven-Binders-Computer:~/celestia/src/celengine stevenbinder$ patch -p0 < patchfile.diff
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: src/celengine/body.cpp
|===================================================================
|RCS file: /cvsroot/celestia/celestia/src/celengine/body.cpp,v
|retrieving revision 1.36
|diff -u -r1.36 body.cpp
|--- src/celengine/body.cpp 20 Oct 2004 06:55:50 -0000 1.36
|+++ src/celengine/body.cpp 6 Jun 2005 04:08:11 -0000
--------------------------
File to patch:

Since it told me it couldn't fine the file (I'm assuming it was looking for body.cpp) I just typed that in... but got this:

File to patch: body.cpp
patching file body.cpp
patch: **** malformed patch at line 9: // protos(-numeric_limits<double>::infinity()),

Steven-Binders-Computer:~/celestia/src/celengine stevenbinder$


Any thoughts? I know I'm a TOTAL newbie at this... so sorry about that. But DYING to try out your patch.

Steven

P.S. Regarding your previous post (1, 2, and 3) I just saw that... I will process it manana. But thanks!
Steven Binder, Mac OS X 10.4.10

BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 11 months
Location: Los Angeles, CA

Post #22by BlindedByTheLight » 06.06.2005, 08:39

Now I'm wondering if, maybe because there was no "[/code]" at the end of your patch's posting the bboard didn't render the code properly and didn't include the requisite spaces and things of that nature?
Steven Binder, Mac OS X 10.4.10

steffens
Posts: 162
Joined: 06.11.2003
With us: 21 years 3 months
Location: RP Germany

Post #23by steffens » 06.06.2005, 10:21

The patch tool could not find the file to patch.

Code: Select all

Steven-Binders-Computer:~/celestia/src/celengine stevenbinder$ patch -p0 < patchfile.diff
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: src/celengine/body.cpp
|===================================================================
|RCS file: /cvsroot/celestia/celestia/src/celengine/body.cpp,v
|retrieving revision 1.36
|diff -u -r1.36 body.cpp
|--- src/celengine/body.cpp 20 Oct 2004 06:55:50 -0000 1.36
|+++ src/celengine/body.cpp 6 Jun 2005 04:08:11 -0000
--------------------------
File to patch:


The file to patch is "src/celengine/body.cpp", but you are in directory "~/celestia/src/celengine".
Change to the directory "~/celestia/" or use -p2 instead of -p0 to strip off the first two directory levels.

Hope that helps,
steffens

BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 11 months
Location: Los Angeles, CA

Post #24by BlindedByTheLight » 06.06.2005, 20:02

Thanks steffens... I'm not home but I'll try it ASAP and post here the results. One question, though...

steffens wrote:The file to patch is "src/celengine/body.cpp", but you are in directory "~/celestia/src/celengine".
Change to the directory "~/celestia/" or use -p2 instead of -p0 to strip off the first two directory levels.

Hope that helps,
steffens


Isn't the file I am trying to patch IN the directory "~/celestia/src/celengine"? Or are you saying that I need to get into the directory listed at the beginning of the patch command (in this case "src") and run the patch from there?
Steven Binder, Mac OS X 10.4.10

BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 11 months
Location: Los Angeles, CA

Post #25by BlindedByTheLight » 06.06.2005, 20:39

Home now... tried to move the files to celestia directory... and the file is now found (however, I had already bypassed that problem before...

BlindedByTheLight wrote:Since it told me it couldn't fine the file (I'm assuming it was looking for body.cpp) I just typed that in...

...by manually typing in the pathname. However, as before, I'm still getting:

Steven-Binders-Computer:~ stevenbinder$ cd celestia
Steven-Binders-Computer:~/celestia stevenbinder$ patch -p0 < patchfilegoto.diff
patching file src/celengine/body.cpp
patch: **** malformed patch at line 9: // protos(-numeric_limits<double>::infinity()),

To repeat my earlier question (with a little clarification):

Now I'm wondering if, maybe because there was no "[/code]" at the end of your patch's posting the bboard didn't render the code properly and didn't include the requisite spaces and things of that nature?


In other words... all the spaces and formatting are lost with this lastest patch (as posted) and everything is flush left. I'm thinking that's important. Is it?

Thanks,
Steve
Steven Binder, Mac OS X 10.4.10

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 3 months

Post #26by dirkpitt » 06.06.2005, 23:43

BlindedByTheLight wrote:In other words... all the spaces and formatting are lost with this lastest patch (as posted) and everything is flush left. I'm thinking that's important. Is it?


It is.

Anyway, I've made the patch file available for download (click here). I hope
doctorjoe does not mind -- I'm not claiming that this patch is my work.

I can confirm that the patch at least applies correctly, using patch -p0 --dry-run <dategoto.diff
(--dry-run mean "don't actually apply the patch, just simulate).

BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 11 months
Location: Los Angeles, CA

Post #27by BlindedByTheLight » 07.06.2005, 00:00

thanks dirkpitt... no go. just curious - since you're on a Mac also... were you able to get it working? and do you know of other solutions besides terminal out there or is that the best way to patch a file? b/c i'm just thinking if there's some patching program that has a more intuitive GUI, i might have more look noodling on my own and bothering you guys less :)

UPDATE: oops - didn't see your prior post... I'll check the patch out ASAP, thanks! Just curious though - how did you get the spacing right? Manually?
Steven Binder, Mac OS X 10.4.10

Topic author
doctorjoe
Posts: 76
Joined: 23.05.2005
With us: 19 years 8 months
Location: Austin, Texas

Started wiki page for extensions

Post #28by doctorjoe » 11.06.2005, 17:40

I've started a wiki page that should contain a clean copy of the changes I've made to celestia. It is located at

http://www.gnacademy.org/twiki/bin/view ... Extensions

BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 11 months
Location: Los Angeles, CA

Post #29by BlindedByTheLight » 11.06.2005, 20:30

Thanks DoctorJoe! Applied like a charm and works even better. Thank you so VERY much - it really helps with maintaining the illusion by not having to switch out to the SSC to check dates. I hope your effort gets the attention it deserves and ends up in the official source code of Celestia!

Steve
Steven Binder, Mac OS X 10.4.10

BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 11 months
Location: Los Angeles, CA

Post #30by BlindedByTheLight » 11.06.2005, 20:48

Forgot to to post this... there actually was a prior discussion (several I think, actually) of the goto-in-time feature. Just thought I'd throw out some of the other ideas in case you had the interest (at some point - you've done more than enough now in my book) of expanding on this patch.

The ideas are of two variety. One is allowing a particular text to be declared (in the SSC) for the start time/end time dates.

So Mir, for example, is normally declared like this:

"Mir" "Sol/Earth"
{
Class "spacecraft"
Radius 0.0165 # Mir is 33 meters long

Beginning 2446482.0 # Launched 20 Feb 1986
Ending 2451989.77083 # Reentered 21 Mar 2001
}


Your patch, now, just uses the default text "start time" and "end time". But, instead, if we declare Mir like this:

"Mir" "Sol/Earth"
{
Class "spacecraft"
Radius 0.0165 # Mir is 33 meters long

Beginning 2446482.0 #Launched 20 Feb 1986
BeginningText "Launch Date"

Ending 2451989.77083 # Reentered 21 Mar 2001
EndingText "Re-Entered Atmosphere"
}


Or whatever the text (and text flag) may be. True, most of the time the text will probably just be Launch or Re-entry. But not always. And even if it is just that, this kinda tweak will allow add-on writers to put some nice little bits of unassuming data - like "Launch (Edwards)" and "Re-entry: Indian ocean". Or "Launch (Tbslisi)" and so on.

However, if you take the text/date declarations one step further and combine the ability to add particular text with the ability for multiple dates, the concept becomes much more powerful. Like so:


"Mir" "Sol/Earth"
{
Class "spacecraft"
Radius 0.0165 # Mir is 33 meters long

Beginning 2446482.0 #Launched 20 Feb 1986
BeginningText "Launch Date"

Date1 24221234.412
Date1Text "Docked With Discovery"

Date2 2421444.00
Date2Text "Blew a large gasket"


Ending 2451989.77083 # Reentered 21 Mar 2001
EndingText "Re-Entered Atmosphere"
}


The great thing is, by doing this, add-on suddenly have the possibility of becoming MUCH more dynamic - with much larger points of interest. So far, the only one who has really done this is Deep Impact but my feeling is, if such dates could be flagged and easily displayed in an add-on, creators would start creating far richer lives for them than just "now they exist" / "now they don't".

Fantasizing even more, there would, of course probably need to be some kind of keyboard short-cut that could cycle through dates (though I don't think it should "jump" - it should function the way the spatial "go-to" command works... speeding up time until you get to the next temporal marker).

Not sure how hard all this is - it seems, to my non-coder eyes, you have done lots of the heavy lifting already. But I can't really tell. Anyhoo -

Hope that is useful in some way and thanks again!

Steven
Steven Binder, Mac OS X 10.4.10

Tosv
Posts: 26
Joined: 14.02.2005
With us: 20 years
Location: Hudiksvall, Sweden

Post #31by Tosv » 12.06.2005, 01:05

"Mir" "Sol/Earth"
{
Class "spacecraft"
Radius 0.0165 # Mir is 33 meters long

Beginning 2446482.0 #Launched 20 Feb 1986
BeginningText "Launch Date"

Date1 24221234.412
Date1Text "Docked With Discovery"

Date2 2421444.00
Date2Text "Blew a large gasket"

Ending 2451989.77083 # Reentered 21 Mar 2001
EndingText "Re-Entered Atmosphere"
}

The great thing is, by doing this, add-on suddenly have the possibility of becoming MUCH more dynamic - with much larger points of interest. So far, the only one who has really done this is Deep Impact but my feeling is, if such dates could be flagged and easily displayed in an add-on, creators would start creating far richer lives for them than just "now they exist" / "now they don't".


I agree completely to this one. :wink:
Windows XP
AMD Sempron +2600 (1,83 MHz) CPU
VIA/S3 UniChrome Integrated
Celestia 1.4.0 Pre6

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 3 months

Re: Started wiki page for extensions

Post #32by dirkpitt » 12.06.2005, 08:40

doctorjoe wrote:I've started a wiki page that should contain a clean copy of the changes I've made to celestia. It is located at

http://www.gnacademy.org/twiki/bin/view ... Extensions


Thanks. Have you managed to duplicate and/or fix the foreground orbit "double-vision" issue?
It's a little hard to tell from the all-in-one patch file.


Return to “Bugs”